-
-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: All entities unavailable once HASS.agent disconnects/machine is shutdown #301
Comments
I just set this up last night (6/18/2023) and I have run into the same issue. I don't know if it's the MQTT add-on or this one, but having it all set to "unavailable" kinda stinks. I have a feeling it's HA/MQTT doing it though when the connection is lost. Edit: To be clear, my issue is that as soon as the computer is off/asleep, all sensors are set to "unavailable". Would be nice for some of them to keep the same value, like "lastsystemstatechange" |
Exactly that's the point here ✔ That current behaviour is not common sense and different to common implementation approaches where the last state is kept active until it is refreshed/overwritten by a newer state. Magical |
Hello, HASS.Agent handles availability topic properly and sets the sensors as "offline", that's why the HA shows them as "Unavailable". If the device is not powered on the sensors should not stay available (for example, the CPU load of 45% wouldn't make sense on powered down PC). |
But not all sensors fall under that rule. I.e. (as I mentioned in the other issue), Last User Logged In would be nice to have it retain its value. From my understanding it is possible to configure MQTT to allow this (though I am not overly familiar with MQTT yet) |
Double what sirmeili said. Plus regarding the CPU load example: if the machine is off, the load is 0 %. 0 is a valid state. While unavailable and unknown stand for problematic states in the HA universe. My devices ('s entities) are not problematic, they are just off. |
A hard theory from my side (at least for now), but CPU Load will almost never be exactly zero, even if I do implement the option not to send availability topics, the last value from things like CPU Load Sensor most likely won't be zero but the last known value (and this applies to all other sensors that would be configured that way - it will be up to the user to handle this on the HA side, just like it is now with the "unavailable" problem, user can retrieve the last valid value from HA itself). |
Won't this be relevant here or at least be of interest? https://www.home-assistant.io/blog/2023/03/01/release-20233/#breaking-changes At least it shows how other folks (the HA core team) care about entity states and what they represent and might trigger. |
Describe the bug
Is it normal for all Home Assistant entities (buttons and sensors) provided by HASS.Agent through MQTT to render unavailable once the client/Windows machine running HASS.Agent is switched off?
To Reproduce
Steps to reproduce the behavior:
unavailable
Expected behavior
I expected all entities to keep the latest state, as all integrations do.
If it's not a bug but "works as designed": That "show current state" instead of "show latest state (which is not
unavailable
) approach has quite some downsides.Screenshots
![grafik](https://user-images.githubusercontent.com/13799156/229382350-56ec7d2b-1a11-41d9-90b4-eeda676a2733.png)
![grafik](https://user-images.githubusercontent.com/13799156/229382361-827257ab-88f6-4f88-86d5-dcee94de7238.png)
Misc info (please complete the following information):
winver.exe
output):Please check what's applicable (multiple answers possible):
Additional context
I was not sure if this issue shall be created in https://github.com/LAB02-Research/HASS.Agent-Integration/issues instead. But the integration does nothing on that ("only" provides notifications and media player), right?
The text was updated successfully, but these errors were encountered: