Hi,
I’m have some sensors connected to Zigbee2Mqtt that are transmitted to HASS using Mosquitto Broker.
Those sensors send their value to Zigbee2Mqtt multiple time per hour. For example:
2023-10-10 21:31:01MQTT publish: topic 'zigbee2mqtt/sonoff_snzb_02d', payload '{"battery":100,"humidity":53.8,"linkquality":228,"temperature":23.9}'
2023-10-10 21:41:01MQTT publish: topic 'zigbee2mqtt/sonoff_snzb_02d', payload '{"battery":100,"humidity":53.8,"linkquality":228,"temperature":24.0}'
Each message contains the entire device state but only changed values are transmitted to HASS
In previous example, at 21:41
a state_changed
event is sent to HASS containing only the new temperature, but the humidity is not updated because it is the same as in previous message (I observed this in the developer tools > events
page).
This as three impacts:
-
First the
last updated
value is not updated for a sensor (it is always the same aslast changed
) until this sensors’ value changes and triggers astate_changed
event. Here the same device has 2 differentlast updated
values even if every payload contains both sensors values. Sometimes values are not updated for many hours
-
Second, when the value changes, if the change is big enough, then graphs draw a straight line from previous values many hours ago to the new value. In the following example the graph suggests that the line growth from 12:00 to 21:00, but the value was still 0 at 20:59
-
Third, if none of the sensor’s value changes for many hours, my dashboard may suggest that the connection was lost because no update was received for too long even if zigbee2mqtt received many messages from the device during that interval
Is there a way to update the entire device state on each zigbee2mqtt event? Or am I misunderstanding how it works? (I’m pretty new at using HASS)