I am looking for a way to detect if my PC is powered on or recently went to sleep but unsure on the best method to achieve it.
My PC is set to sleep after 20 mins of idle and I essentially want to turn off my TV when the PC goes to sleep.
I don’t want to use anything that pings the PC else it will wake up which is not what I want to happen. Is there a way to poll what devices are connected to my router? I have an ASUS RT-AC66U. Home assistant is able to pick up some elements from the router via the UPnP integration but I was hoping it could also detect connected devices.
Another option would be a smart or a connected power meter. I have a ‘dumb’ one which merely reads the current energy usage. If this is easier can anyone recommend a brand that would do what was needed? I don’t mind making something as I have a number of ESP8266 boards.
Ah so essentially the pc posts an mqtt update if it’s up? What do you have doing the logic to detect when it isn’t?
I have MQTT set up as it’s what I use to push sensor status updates, but can you also use subscribers to send mqtt messages on response or lack there of an update from the PC? May be thinking too far into this.
It’s not super clear from your post, but I think you are looking for something specific to Windows. If that isn’t the case I use this switch to detect if my monitor is on or not in linux:
I don’t care about turning it on or off, just want the state reported for automations to help determine if I am at my computer or not. That’s why I have commands that don’t do anything for on/off.
Thanks. I was looking at something specifically for a Windows 10 machine. I have installed IOTLink and got it to send a load of data via MQTT to Home Assistant. I just have to work out the best way to create the automation now. I couldn’t work out how to get Eventghost to do what i wanted. I dont want to be able to control the PC just merely perform actions to the TV depending on what the PC is doing, i.e. turn the screen off when it isnt in use.
So, I’ve tried EventGhost and created two macros based on System.UnIdle and System.Idle which publish a topic: EventGhost/BRUNT-WIN10/status = active and EventGhost/BRUNT-WIN10/status = idle but I cannot figure out a binary_sensor for HA. My last try is: