How do I view 'last seen' status of zigbee/mqtt devices

Zigbee2mqtt dashboard shows ‘last seen’ for each device.

I is presented in mqqt payload:

image

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.

1 Like

how do you enable them?

1 Like

Were you able to enable them?

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.

In z2m configuration.yaml:

device_options:
  homeassistant:
    last_seen:
      enabled_by_default: true
2 Likes

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.

I just enabled last_seen.enabled_by_default in Z2M and enabled last_seen entities. Worked flawlessly.

How did you do it? Do you need to edit HA configuration.yaml?

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.