sleevezipper / hass-workstation-service

Provide useful sensors and services from your workstation to Home Assistant.
Apache License 2.0
615 stars 53 forks source link

sensors unavailable. #46

Open ReneTode opened 3 years ago

ReneTode commented 3 years ago

i love your work, and from what i have seen i love what enhancements you plan to do.

at the moment all sensors and switches show unavailable, the moment i shutdown a PC. for switches i can see that as usefull, but for sensors like last active, i think thats unwanted, that should stay at the last value.

can that be changed?

sleevezipper commented 3 years ago

That's a good point. I'll look into it!

amaisano commented 2 years ago

Also very interested in this. I have to do a bit of extra logic work in home assistant to group unknown and unavailable statuses with the off state.

I'd like home assistant to keep the state sensor in an "Off" state, and not switch to "unavailable" when my PC goes to sleep.

I played around with the beta LWT feature, but didn't notice a difference (disabling the option still put my sensors into "unavailable" after a couple minutes of my PC being off).

In MQTT land, I think LWT and/or the Retain payloads control this.

amaisano commented 2 years ago

@ReneTode FYI the lastActive sensor's availability has been adjusted to be retained, instead of going unknown. See https://github.com/sleevezipper/hass-workstation-service/issues/58.

I'm looking to get the same "fix" or optional feature for the SessionStateSensor, which is driving me crazy because it goes from InUse -> Locked -> off -> Unknown every time I sleep my computer.