Device status updates #578
-
Is it intended for the status topic to be updated regularly or does it only get updated on changes? I am finding it gets updated on a regular basis for the first few minutes and then doesn't get updated until something goes offline. I am doing something wrong or is there is a way to request a status update? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There are no status updates unless state changes. I've considered using retain only for status messages but, honestly, it doesn't help much since you still wouldn't know the current state and using retain for state messages is a mess. Retain just caused so many problems with users in the early days of this project that I just swore it off completely. During startup all state updates, including online/offline state, are sent every 30 seconds for 3 minutes. This is mostly to work around the fact that HA sometimes sends its online message before it's really ready to accept device discovery and state update information. There's no direct way to request a state update, but the code does listen for online/offline events from Home Assistant on the homeassistent/status topic, and uses this to know when it needs to resend all state updates, so you can do the same thing with your code. Note that any sending of "online" will cause the 30 seconds updates to occure for 3 minutes. |
Beta Was this translation helpful? Give feedback.
There are no status updates unless state changes. I've considered using retain only for status messages but, honestly, it doesn't help much since you still wouldn't know the current state and using retain for state messages is a mess. Retain just caused so many problems with users in the early days of this project that I just swore it off completely.
During startup all state updates, including online/offline state, are sent every 30 seconds for 3 minutes. This is mostly to work around the fact that HA sometimes sends its online message before it's really ready to accept device discovery and state update information.
There's no direct way to request a state update, but the code does listen…