I use a TV as my computer monitor. Unfortunately the TV does not switch off when the PC turns off the monitor on idle or enters standby.
I have the monitors connected to a Xiaomi smart socket which I can control via Google Home at the moment, but would like to automate it. One way would be to get a USB-CEC adaptor but they’re pretty expensive. If I could turn off the Xiaomi socket after an idle period, and turn it back on when the mouse is moved, that would be perfect.
I can configure Windows Task Scheduler to run a program when the screen saver starts and stops, but is there a way to control Home Assistant directly from Windows? Triggering with a URL? The closest I could find is this, but the poster went for the iOS app instead.
This gave me an idea and I’ve done similar - after 10 mins of inactivity I’ve got my TV turning off and it turns back on when I move the mouse.
Luckily, my TV is an LG with webOS so can use the media player integration for it to turn it on and off.
I used an MQTT binary sensor that gets its state from eventghost and used that in automations