What am I missing from my alert for low battery devices?

I am trying to notify myself whenever a battery powered device gets too low and tell me what device tripped that alert. I have a helper group called “sensor.battery_devices” that they all belong to.

alias: “Environment: Sensor Battery Low”
description: “”
trigger:

  • platform: numeric_state
    entity_id: sensor.battery_devices
    below: 10
    condition:
    action:
  • service: notify.mobile_app_sm_s908u
    data:
    message: >-
    {{ trigger.entity_id }}, Date: {{ now().strftime(‘%Y-%m-%d’) }}, Time:
    {{ now().strftime(‘%H:%M’) }}
    title: “Environment: Sensor Battery Low”
    mode: single

Please encluse the code in three backticks so we can properly read it, as per point 11 in this post:

The problem with this approach is that only one low battery will keep your indicator active, so it won’t fire again when the next battery goes low. Luckily there’s a great blueprint to help you do battery notifications, so maybe you do not need to do all the hard work yourself. It is in the list when you add a new automation I believe.

alias: "Environment: Sensor Battery Low"
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.battery_devices
    below: 10
condition: []
action:
  - service: notify.mobile_app_sm_s908u
    data:
      message: >-
        {{ trigger.entity_id }}, Date: {{ now().strftime('%Y-%m-%d') }}, Time:
        {{ now().strftime('%H:%M') }}
      title: "Environment: Sensor Battery Low"
mode: single

i really wanted to find a way to do this without the for loop… using select/map, but i couldn’t figure it out… so here’s a for loop. hopefully someone else can tell how this might get done in a single non-for loop method, so try this.

alias: "Environment: Sensor Battery Low"
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.battery_devices
    below: 10
condition: []
action:
  - service: notify.mobile_app_sm_s908u
    data:
      message: >-
        {% for entity in state_attr('sensor.battery_devices', 'entity_id') %}
          {% if states(entity) | float < 10 %}
              {{ entity }}
          {% endif %}
        {% endfor %}
        Date: {{ now().strftime('%Y-%m-%d') }}, Time:
        {{ now().strftime('%H:%M') }}
      title: "Environment: Sensor Battery Low"
mode: single

I tried that blueprint, which I can go to if that is a better option but something is not liked in it. Here is the code from the blueprint:

alias: Low Battery Notifications & Actions
description: ""
use_blueprint:
  path: Blackshome/low-battery-notifications-and-actions.yaml
  input:
    custom_group:
      entity_id: sensor.battery_devices
    include_easy_notify: enable_easy_notify
    notify_device:
      - 097eceda585b6bb990890e1d8777a73f
      - 916a01094c3b91df2e820869510bd8c6
    time: "09:00:00"
    include_persistent_notification: disabled_persistent_notification
    sensor_selection: enable_battery_sensors_custom_group
    notify_message: sensors