H
eastern-cyan
MonitorPowerState status not changing on MQTT after waking up
Hello! I'm new to HASS and I've been configuring it using the wiki. The sensor that I want to use is MonitorPowerState to turn on my Speakers when the monitor wakes up.
But it was working erratically (mostly never, but sometimes it does work) and I¡ve been trying to figure out why.
So I installed MQTT Explorer an realised this:
When the computer sleeps (and monitor goes off) the state changes to PowerOff and MQTT received PowerOff....but when I wake up the PC, the state changes to PowerOn on hass.agent but on MQTT Explorer it does not change (and therefore my automation does not trigger)
could someone help me figure out the reason? thank you




5 Replies
eastern-cyanOP•4w ago
Update: I've been able to see that this happens only when the computers wakes up from suspension (which is my main use case)
If the screen turns on but the pc was not suspended, it works properly
idk how to fix this, but to get around it, you can use LastSystemStateChange and trigger when it changes to being not unavailable or Suspend. That one will always show either resume or session unlock when the pc wakes and be unavailable or Suspend when its asleep
here's a template i use for a PCState Switch Entity
@Amadeo i feel like we talked about this a while back, should maybe be a docs comment?
I actually though about it a day or two ago, some 2 sections or so about "m0e3rn sleep" and the basics - the question is how do we create one that covers all cases 😄
optimistic-gold•2w ago
I was trying to do the exact same, but I found giving my PC a static IP and using the ping integration to determine if my PC was on or not worked out better. I will start my own thread with more details.