Sensor to check if PC is on?

Hello, is there a sensor to check if the pc is simply powered on?. I had a manually created entity that uses Wake On Lan + RPC Shutdown to detect the pc state and switch it on/off accordingly with a single switch, but the state detection on that has long since stopped working. I was hoping to replace the shutdown/state detection part using HASS Agent/integration. Is this possible?
5 Replies
wee-brown
wee-brownOP2w ago
Managed to get this working by using the "Battery" sensor. A bit un-intuitive for a PC but this sensor provides a "powerline" status/entity which will either be Online or unavailable, this works for checking if the pc is active with minimal delay
flat-fuchsia
flat-fuchsia2w ago
I use the "MonitorStromStatus" sensor for this. It is sufficient for me. But also a "crutch", of course.
Amadeo
Amadeo2w ago
best would be to use the availability topic, for example:
homeassistant/sensor/AMADEO-PC/availability
homeassistant/sensor/AMADEO-PC/availability
there is a last will message ("offline") that should be sent by mqtt broker in case of "a problem"
wee-brown
wee-brownOP2w ago
Is that set up via the agent client?
Amadeo
Amadeo6d ago
HASS.Agent uses this mqtt topic to notify HA if entities are available - "online" message when HASS.Agent is running and "offline" one if it's shut down or someone bashed the pc and it crashed (then the MQTT broker sends the "offline" message once it determines that connection to HASS.Agent is no longer there)

Did you find this page helpful?