H
HASS.Agent5mo ago
extended-salmon

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
extended-salmon
extended-salmonOP4mo 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
rare-sapphire
rare-sapphire4mo ago
I use the "MonitorStromStatus" sensor for this. It is sufficient for me. But also a "crutch", of course.
Amadeo
Amadeo4mo 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"
extended-salmon
extended-salmonOP4mo ago
Is that set up via the agent client?
Amadeo
Amadeo4mo 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?