I had the same problem! I've created a CCF with a panel that contains each of the possible devices I can be watching - ie DSS, DVD, VCR, HDTV - Each of those buttons on the "all off" screen will power off only the things that are on while watching that device. I have "switch" and "switch to" panels also that work the same way.
Download my ccf at:
[Link: remotecentral.com]Pay special attention to the Macro button "all off" and also the panels "Switch" and "switch to" They work like a charm after programming to your devices.
No discrete on/off codes are needed for the way this is set up. Good luck!
Kim