hi folks
I have a bunch of smokedetectors and I want to have an auutomation that reminds me to change the battery.
is it somehow possible to let them all trigger the automation and let the automation tell which one has triggered?
hi folks
I have a bunch of smokedetectors and I want to have an auutomation that reminds me to change the battery.
is it somehow possible to let them all trigger the automation and let the automation tell which one has triggered?
Trigger with a list of sensors, then use trigger.entity_id in a template to do the notification:
- alias: Battery Low
initial_state: true
trigger:
- entity_id: binary_sensor.back_door_reed_battery, binary_sensor.east_front_window_reed_battery,
binary_sensor.front_door_reed_battery, binary_sensor.lounge_door_reed_battery,
binary_sensor.office_window_reed_battery, binary_sensor.sunroom_east_door_reed_battery,
binary_sensor.west_front_window_reed_battery, binary_sensor.lounge_lights_switch_battery,
binary_sensor.hall_lights_switch_battery, binary_sensor.office_lights_switch_battery,
binary_sensor.verandah_light_switch_battery, binary_sensor.side_verandah_light_switch_battery,
binary_sensor.pergola_light_switch_battery, binary_sensor.garage_door_reed_battery,
binary_sensor.side_garage_light_switch_battery, binary_sensor.shed_door_reed_battery,
binary_sensor.shed_roller_door_reed_battery
platform: state
to: 'on'
action:
- service: persistent_notification.create
data_template:
message: Sensor {{ trigger.entity_id }} low battery
title: Low Battery Alert
is it somehow possible to show the name of the device instead of the cryptic entity_id
?