Hi,
I have a simple automation which sends me a message to my phone when the battery_level of an entity is below 15. As trigger for this automation I have inserted a list of all the entities. Did someone know if i can template this entity list? All entities have “battery_level” in their name.
Here is the code for the automation:
- alias: 'Notify Battery'
trigger:
platform: numeric_state
entity_id: sensor.hue_motion_sensor_wohnzimmer_battery_level,
sensor.hue_motion_sensor_esszimmer_battery_level,
sensor.motion_sensor_arbeitszimmer_battery_level,
sensor.motion_sensor_schlafzimmer_battery_level,
sensor.arbeitszimmer_dimm_battery_level,
sensor.button_tim_battery_level,
sensor.button_kitchen_battery_level,
sensor.rechtes_fenster_schlafzimmer_battery_level,
sensor.arbeitszimmer_tuer_battery_level,
sensor.wc_guests_door_battery_level,
sensor.lumi_sensor_smoke_battery_level,
sensor.linkes_fenster_schlafzimmer_battery_level,
sensor.wohnzimmer_dimm_battery_level,
sensor.esszimer_fernbedienung_battery_level
below: '15'
action:
- service: notify.ios_devices
data_template:
title: "Batterien"
message: "{{ trigger.to_state.attributes.friendly_name }} benötigt eine neue Batterie!"
data:
push:
thread-id: "Batterie"
- service: persistent_notification.create
data_template:
title: Batterien
message: "{{ trigger.to_state.attributes.friendly_name }} benötigt eine neue Batterie!"
notification_id: Batterien