I’ve recently added some smoke detectors to my setup and I would like to be notified when their batteries are about to run out. I’ve set up a single automation with these rules:
- id: '1581432210567'
alias: Smoke detector battery level notification
description: Notify me when a smoke detector needs a battery change.
trigger:
- below: 10
device_id: <irrelevant>
domain: sensor
entity_id: sensor.smoke_detector_hallway_battery
platform: device
type: battery_level
- below: 10
device_id: <irrelevant>
domain: sensor
entity_id: sensor.smoke_detector_hobby_room_battery
platform: device
type: battery_level
condition: []
action:
- data_template:
message: Replace batteries for {{ trigger.entity_id }}.
title: Smoke detector battery level below {{ trigger.below }}%
service: notify.notify
As you can see I have two different triggers, one for each smoke detector. I want to be notified if either one of them triggers but I want to include the name of the entity that triggered the notification as well. The setup above works, but it shows the ID rather than its corresponding human-friendly alias. Is there any way for me to show the friendlier text? I read the documentation of course, which seems to imply that it’s impossible but I wanted to make sure.
Also, is there a way to make this automation trigger on all battery_level
events or do I have to manually add every new device I get that reports a battery status?