I saw the ‘monster-card’ thing, but that requires a visible interface, which I haven’t made, and I’m not sure I really want to.
My thought was to make a loop that runs through all the entities in a group, and then sends out Google Voice TTS messages for low battery levels accordingly.
I can read that I need to use templates for that.
The more I’ve read about this the more confused I’ve gotten, it looks like it’s a changing field for HA.
I can of course just make an automation for each entity, but it seems kinda silly.
My idea was to make a timed trigger that would iterate through a group.
By beg, borrow and steal, this is what I’ve gotten to so far, but of course it doesn’t work.
- alias: Batterycheck
initial_state: 'on'
platform: time
at: '17:30:00'
condition:
- condition: template
{%- for entity_id in states.group.batterycheck.entity_id -%}
{% set parts = entity_id.split(’.’) -%}
{%- if states(entity_id.battery_level) < ‘20’ %}
{%- if loop.first %} {% elif loop.last %} and the {% else %}, the {% endif -%}{{ states[parts[0]][parts[1]].name }}
{% endif -%}
{%- endfor %}
action:
- service: tts.google_say
data_template:
message: 'Battery alert'
Anybody that has done something like this? I have no experience in Python, I would prefer keeping it in HA.