Skip to content
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

Reflect device status in home assistant entity #166

Closed
leranp opened this issue Apr 5, 2023 · 9 comments
Closed

Reflect device status in home assistant entity #166

leranp opened this issue Apr 5, 2023 · 9 comments

Comments

@leranp
Copy link

leranp commented Apr 5, 2023

Hi,

Thank you for your project!
Recently my ESP device was disconnected from the network, but the automation in HA didn't sent me a message about it, so i tried to see why and saw that the device in HA isn't going to "unavailable" when it's going offline, Do I miss something?
It looks like there is no "Offline/Online" MQTT sensor that switches the device to unavailable state

@technyon
Copy link
Owner

technyon commented Apr 5, 2023

Which firmware version are you on?

@mundschenk-at
Copy link
Collaborator

@technyon That's something for the auto-discovery rewrite.

@technyon
Copy link
Owner

technyon commented Apr 5, 2023

Well yes, but the latest firmware has a connection state topic (including auto discovery) which does exactly this.

@mundschenk-at
Copy link
Collaborator

No, not in the sense that the OP likely means. In HA, when a device becomes unavailable, the state of the entities changes to unavailable (or unknown with slightly different semantics). To get that behavior with MQTT, the discovery payload has to include some additional keys.

@technyon
Copy link
Owner

technyon commented Apr 5, 2023

ok I see

@yasars
Copy link

yasars commented May 5, 2023

same problem here, yes, I also have after a restart that sometimes the status is unavailable ... after a renewed restart it works again ... I'll try with the automation if I can do something that it reboots again if unavailable ... so it would be on small fixx....

@mundschenk-at
Copy link
Collaborator

same problem here, yes, I also have after a restart that sometimes the status is unavailable ... after a renewed restart it works again ... I'll try with the automation if I can do something that it reboots again if unavailable ... so it would be on small fixx....

Please open your own issue, this is the opposite of what the OP wants (explicitly setting the state to unavailable because currently it isn't).

@technyon technyon changed the title Status of the device Reflect device status in home assistant entity May 13, 2023
@iranl
Copy link
Collaborator

iranl commented Feb 7, 2024

After merging #292 all entities in Home Assistant discovery now include the activity topic which (in conjunction with LWT) ensures all entities (not just the lock entity) become unavailable when the device goes offline/becomes unavailable to the MQTT broker for whatever reason. Tested in my own build including #292 by pulling the USB power cable from the wall.

I propose this issue is marked as fixed by #292 and closed.

@technyon
Copy link
Owner

technyon commented Feb 8, 2024

ok, closing this

@technyon technyon closed this as completed Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants