This is a head scratcher and I’m hoping someone can put me right on this. (there was no tag for last_reported)
I’m using last_reported to determine whether my temperature sensors are active.
According to the zigbee2mqtt log, HA is receiving the updates from the temperature sensors… or rather the zigbee integration is. However, in HA, the last_reported is not being updated.
I’m not sure where to go with this. Is it an issue with the zigbee2mqtt integration? With the HA integration? I’m lost with where to go forward with this one.
Grateful for thoughts and advice please.
EDIT - i’m up to date on HA and Zigbee2MQTT installations.
Core 2025.4.2
Supervisor 2025.04.0
Operating System 15.1
Frontend 20250411.0
Zigbee2MQTT version 2.2.1 commit: unknown
Coordinator type
EmberZNet
Coordinator revision
7.4.5 [GA]
Frontend version
0.9.7
zigbee-herdsman-converters version
23.20.1
zigbee-herdsman version
3.4.11
I’m no further forward on this. I can’t find any settings anywhere, or any other log entries that explain why the device reports are hitting the Zigbee2MQTT integration, but aren’t updating in HA entities.
I’m running a heating system off these sensors so this is important to me. If I have to up the reporting rate to cover for this issue, it’s going to have quite a negative effect on battery life.
I may be off the mark, but that thread concerned the lack of updating of that entity on the screen. ie. the last_reported changing in the system, but not changing on screen.
Where I’m coming from is that the update of the entity itself isn’t happening… within the actual HA “engine” … that events are coming in and showing on the Z2M logs, but the time stamps against last_reported aren’t changing.
My understanding is that when something reports… last_reported should update.
Or am I understanding this wrong? If I’ve got this wrong, then how do I achieve what I need to achieve please?
OK - I observed for a while and it looks like last_reported is only updating if there is a change to that value. To me, reading this - State and state object - Home Assistant - I interpreted that as something which last_changed should be doing… but last_reported looks to be behaving that way also.
Ergo - “Time the state was written to the state machine in UTC time. This timestamp is updated regardless of any changes to the state or state attributes.” … but if the state is only being updated when there is a change, then this renders it kind of moot in this application and the only thing that is, “saving,” me is that the temperature is reporting to two decimal digits so a very small fluctuation is enough to trigger a change and thus an update.
Hmmm… a little frustrating for what I’m trying to do.
There is an option that can be set per sensor in the MQTT payload to force sensor data update even if the data hasn’t changed. See force_update
From the Z2M side, the process described in Home Assistant | Zigbee2MQTT can be used to add a per-sensor force_update: true setting to the z2m configuration.yaml. Because only this one option is set in the file, all GUI-controlled settings remain editable. Looks like this;
Reporting is set this way and the sensor does report back as scheduled. I can see the payload come back to Z2M in the Z2M logs. The issue is that the reporting doesn’t seem to make it through to HA where the automations can see it.
Unfortunately the situation is still the same. If the sensor reports back and the temperature hasn’t changed, then the last_reported doesn’t change. Only when the temperature actually changes does that change, and the only thing that’s doing it, is because it’s going down to two decimal points so there’s a reasonable chance that it notices a change.
After a complete restart of HA, a packet came back because the humidity had changed, but the temperature hadn’t. Net result, the last_reported on the temperature didn’t change.
So it looks like the last_reported isn’t going to work at the level I need it to, because the last_reported will only change when there is a change to “report” to HA.
I wonder if the whole sensor has a last_reported that I can latch on to, so whenever the sensor reports, for any reason, I see the change. (doesn’t look like such a thing exists)