Good deal, Just sharing for others who may want to use the zha domain to report offline devices.
- platform: template
sensors:
zigbee_offline:
value_template: >
{% set zigbee = [ states.zha.motion_sensor_garage, states.zha.motion_sensor_hallway, states.zha.motion_sensor_kitchen, states.zha.motion_sensor_office, states.zha.motion_sensor_sensor_living_room, states.zha.office_lamp_one, states.zha.open_close_sensor_back_door, states.zha.open_close_sensor_front_door, states.zha.open_close_sensor_garage_door, states.zha.open_close_sensor_garage_fridge, states.zha.open_close_sensor_mailbox, states.zha.water_sensor_kitchen, states.zha.zigbee_plug_one ] %}
{% set offline = zigbee | selectattr('state','eq','offline') | list %}
{{ offline | length >= 1 }}
friendly_name: 'Zigbee Devices Offline?'
These are my zigbee devices, so change names as needed.
Then this automation
- alias: Zigbee Device Offline
trigger:
- platform: state
entity_id: binary_sensor.zigbee_offline
to: 'on'
for:
minutes: 15
action:
- service: script.sms_notify_with_images
data_template:
service: notify.sms_me
title: Zigbee Devices Offline
message: >
{% set offline = states | selectattr('entity_id', 'in', state_attr('group.all_zigbee','entity_id')) | selectattr('state','eq','offline') | map(attribute='name') | join(', ') %}
The following zigbee devices are offline: {{ offline }}
Of course replace with your notifyer of choice
Oh, and I created a group as well
all_zigbee:
name: Zigbee Devices
view: no
icon: mdi:lock-outline
entities:
- zha.motion_sensor_garage
- zha.motion_sensor_hallway
- zha.motion_sensor_kitchen
- zha.motion_sensor_office
- zha.motion_sensor_sensor_living_room
- zha.office_lamp_one
- zha.open_close_sensor_back_door
- zha.open_close_sensor_front_door
- zha.open_close_sensor_garage_door
- zha.open_close_sensor_garage_fridge
- zha.open_close_sensor_mailbox
- zha.water_sensor_kitchen
- zha.zigbee_plug_one
I will say, I removed the battery from one device to test and itās been 30+ minutes with no change. Makes sense though, as I would not expect reguluar updates due to saving battery life.