I’m attempting to cut down on the vast number of automations that I’ve accumulated over the many many years… Oh, October 2019 you say? Wow 2020 HAS sucked! Anyhow, I’ve removed all of my previous individual low-battery notifications and consolidated them into one automation that runs at a set time each evening (giving me a window of time that I can actually DO something about said low batteries) with each sensor added to an ‘OR’ condition. Instead of attempting to describe it, I’ll just post the code below:
- id: '1589688330541'
alias: General - Low Battery - Alert
description: Alert on low battery
trigger:
- at: '18:00:00'
platform: time
condition:
- condition: or
conditions:
- below: '100'
condition: numeric_state
entity_id: sensor.august_asl_03_smart_lock_battery_level
- below: '20'
condition: numeric_state
entity_id: sensor.dryer_battery
- below: '20'
condition: numeric_state
entity_id: sensor.washer_battery
- condition: numeric_state
entity_id: sensor.livingroom_motion_battery
below: '20'
- condition: numeric_state
entity_id: sensor.ecolink_door_window_sensor_battery_level
below: '50'
action:
- data:
message: Check battery for Home Assistant things.
title: Low Battery
service: notify.mobile_app_phone
mode: single
Now what I’d REALLY love to know is if there is some way to use a template to show me SPECIFICALLY which condition triggered. Something along the lines of:
action:
- data:
message: The following device(s) have a low battery: {{ state_attr('automation.alert_on_low_battery', 'which_condition_triggered_me') }}
title: Low Battery
service: notify.mobile_app_phone
Is this even possible in HA as it stands today? And if not, is this something that other folks even want? Just curious on if anyone else has had this thought before.