Template to generate string of entity_ids with low battery. Only include entities ending in "battery_level"

oh, thank you. i realize i typed “light|spotlight” for test. may be that’s problem!! thank you again

Maybe you should try this

{%- for s in states.sensor | selectattr('attributes.device_class', '==',
        'battery') if is_number(s.state) and s.state|int < 25
          %}
          {{s.entity_id}}{% if not loop.last %}, {% endif %}
        {%- endfor %}
1 Like