Hi,
Trying to create a blueprint for verifying that water sensor sends some update once per 54 minutes. If it doesn’t, I’m trying to send a persistent notification with the device name that failed to send the update. My problem is that I don’t seem to find a way to get a friendly name of the device. Any hints are appreciated! I have found similar questions related to state_change, but not for event.
blueprint:
domain: automation
name: Availability check for Aquara water sensor
description: Script will notify if the sensor does not update at least every 54 minutes.
input:
zha_device:
name: Water sensor
description: The sensor to be followed
selector:
device:
integration: zha
model: lumi.sensor_wleak.aq1
multiple: false
source_url:
mode: restart
max_exceeded: silent
variables:
device_id: !input zha_device
trigger:
- platform: event
event_type: zha_event
condition: '{{ trigger.event.data.device_id == device_id }}'
action:
- service: logbook.log
data:
name: Sensor_update
message: '{{ device_id }}'
- delay:
hours: 0
minutes: 54
seconds: 0
milliseconds: 0
- service: notify.persistent_notification
data:
title: Connection problem (Zigbee)
message: Sensor {{ state_attr(device_id, 'name_by_user') }} report timeout!
This will trace “Sensor None…”. Using “friendly_name” gives the same.