Zigbee2mqtt dashboard shows ‘last seen’ for each device.
I is presented in mqqt payload:
However, I don’t see ‘last seen’ as a sensor/entity property. All I see is the following:
- entity: sensor.aqara_outdoor_temperature
- entity: sensor.aqara_outdoor_humidity
- entity: sensor.aqara_outdoor_pressure
- entity: sensor.aqara_outdoor_battery
How do I add/enable the ‘last seen’ property?
Thanks
After some digging, I figured out that ‘last_seen’, as well as ‘link_quality’, are attributes that are disabled. After enabling them, now I can see them on dashboards.
2 Likes
Were you able to enable them?
vSHADOWv
(Alex)
September 16, 2023, 3:29pm
5
You can easily enable it by following this path: Zigbee2MQTT → Settings → Availability → Availability (Advanced)
2 Likes
Did anyone find how to enable the last_seen entity by default?
I just enabled 100+ entities one-by-one.
jerrm
(Jerrm)
November 19, 2023, 3:00pm
7
In z2m configuration.yaml:
device_options:
homeassistant:
last_seen:
enabled_by_default: true
3 Likes
jimmydwn
(Jimmydwn)
September 16, 2024, 9:46am
8
For some extra info. To be able to enable the “last_seen” attribute of existing devices, you will need to rename the sensor in Z2M to force a regeneration in Home Assistant and then rename it back to it’s original name.
nfu
(nfu)
September 27, 2024, 10:20pm
9
I just enabled last_seen.enabled_by_default in Z2M and enabled last_seen entities. Worked flawlessly.
luispb
(Luis)
October 14, 2024, 2:56pm
10
How did you do it? Do you need to edit HA configuration.yaml?
nfu
(nfu)
October 24, 2024, 1:45pm
11
I’ve enabled from Zigbee2mqtt so it started to report this data. You might have entities already in HA but not enabled yet. So you have to mass enable from entities page.
But I’ve disabled last-seen data completely, it’s spamming DB too much and couldn’t exclude from recorder reliably.
Hello, unfortenately it doesn’t seem to be working for me.
I’m getting a bit crazy at this. For some reason I can get availability but last seen is alway NA on my aquara H1 neutral rockers.
'xxxxxxxxxxxxxxxxxxxxx':
friendly_name: Int - Bureau
homeassistant:
enabled: true
last_seen:
enabled_by_default: true
availability:
topic: zigbee2mqtt/bridge/state
payload_available: online
payload_not_available: offline
Am I doing it wrong?
Captain_Kiwii:
Am I doing it wrong?
Indentation is extremely important in yaml. Move that enabled_by_default: true by 4 spaces to the right, like this:
'xxxxxxxxxxxxxxxxxxxxx':
friendly_name: Int - Bureau
homeassistant:
enabled: true
last_seen:
enabled_by_default: true
availability:
topic: zigbee2mqtt/bridge/state
payload_available: online
payload_not_available: offline
bcjmk
(Bcjmk)
December 22, 2025, 6:15pm
14
It’s easier now, just have to:
Open Zigbee2MQTT from the sidebar
Click on SETTINGS in Z2M sidebar
Click on SETTINGS in toolbar
Click on ADVANCED
Scroll down to find LAST_SEEN
Choose the reporting attribute (I chose ISO_8601 over ISO_8601_local and epoch )
Restart Z2M (may not be necessary, but always a good practice)
Then go into MQTT and have to enable for each device. I did NOT have to change the device name anywhere, it just appeared.
Hope this helps someone.
2 Likes