Ok, first iteration here:
Structure is inspired from @nclark's Advanced Virtual Thermostat.
It has two types of "advanced broadlink remote". One is a simple interface for a broadlink remote and a power sensor (to use as feedback mechanism so that it detects if the device is on or off), the other is an interface for a TV which can combine two broadlink remotes, with two power sensors. The idea being that it is quite typical to have one IR device as a TV and one IR device as a sound system. Once the commands are defined, it will use the broadlink remote to send the proper commands (channel up, down, volume up, down, mute, input1, input2, on/off) to the two devices.
Both types of devices also support "push" to relay the commands in the same way as you can already do in a dashboard.
The first device supports Switch and PowerMeter capabilities, the second device supports Switch, PowerMeter and TV capabilities.
Based on the Power meter measured and a configurable threshold, the switch state is adjusted.
Now, I just wish there existed a Dashboard tile for "TV" capability like there is one for "Music Player", at is could be an all in one... Maybe I will implement "Music Player" capability so that the existing tile can be used (but I don't know what to map the sound volume to...)