I’m using a Broadlink device to send RF/IR commands using HTTP. Most of the devices don’t have a dedicated ON and OFF buttons (single command to toggle power). I wanted to use the command line switch to keep track of the On/Off state. I’ve come across other posts requesting a similar application but I cannot figure out how to do this.
For example, I send a state ON command to Home Assistant. HA send a cURL command to my device and changes the state to ON. It remains ‘On’ and does not respond to additional On commands. Then, I can send an OFF command to change the state to ‘Off’ and send the same cURL command.
Does anyone have a working example I can use and customize? Thanks!