When there is no discrete hex code for on/off functions on a device, you can in some cases use pseudo-on/off. The idea is to determine or ensure a given state, normally 'on'. Once you know it's on, then you know pressing the toggle power button will turn the device off.
As an example, many dvd players will power on when pressing play. Another example is the Scientific-Atlanta (now Cisco) cable boxes: you can configure any numeric key, Favorite or Last on the remote to power on the device.
So, to definitely power off a device, regardless of its current state, first make sure it's turned it on using hopefully one of the above mechanisms, then use the power toggle button to turn it off. Extra step, but it works.
Another more painfull method is to keep track of context when you program your remotes. Obviously there's an assumption that, when you first sit down at your entertainment system, everything is off. My approach goes like this:
1- I have a master remote with buttons for activities; each of those buttons powers up the required devices, then jumps to a remote specific to that activity
2- On each specific activity remote, I have a power off button that shuts off everything that was on and jumps back to the master remote; if I'm on this remote, then I know what was turned on that needs to be off
3- On each specific activity remote, I also have a macro drawer of alternate activities; each 'next' activity button shuts off what's currently on but not required for the next activity, turns on what is not and is required and leaves the rest as is. An alternate way could shut off everything currently on, then power on what is needed for the next activity; simpler, but you'll find yourself turning off then back on (with delays for many devices) the same components (amp., TV)
Inevitably, especially with the L5 relatively narrow beam, once in a while some device won't properly receive it's power command. That's why I also have, on each specific activity remote, a macro drawer with all my remote power on/off/toggle, just in case.