Set switch to "on" without firing command

Hello all, I have a challenge which I would like your ideas on. This is the case:

I’m using a Broadlink RM Mini 3 to turn my TV on/off via IR. This creates a switch in Home-Assitant and it works great. However, I still want to be able to turn my TV on with the normal remote. This is no problem, but when I do that, the switch in Home Assistant is still ‘off’. That causes problems with other automations.

I already tought of a way to monitor if my TV is on, by pinging it’s IP address (I gues that is possible?). But the problem is that I don’t know how to toggle the switch, without also sending the IR command that is associated with that switch. That would be a problem because the on/off command have the same IR code, so I would land in an infinite loop.

You could try using a Template Switch. The turn_on and turn_off parameters would use the existing switch, and the value_template would read the state of the ping binary_sensor.

1 Like