Do you want to make an ir remote, or do you want to use an existing remote ?
If you want to make one, then make a MySensors remote control directly.
If you want to use an existing remote control, then I would process like this :
- make 2 arrays of the same size, one for bytes that contains the child id, one (not sure of the data type) for related IR codes. If you don't have too many codes then you can make one 2 dimensional array and use same data type for child ID and for IR code (not too many so not taking up too much memory)
- in the presentation method, loop in the array and present all child ids as buttons (or scenes, up to you)
- in the code, when you receive an IR code, loop in the IR codes array to find the code. Then get the related child id in the child id array, and send a "on" mysensors message for this child.