are you missing a % sign at the beginning of this? You have one at the end of that line. I don’t know scripting well so this may not be a problem, but it just looked strange.
I actually don’t see anything that would prevent the first one from running when manually triggered. Are there no errors?
In any case, there is at least a problem in the trigger section. Without dashes you’ll just get the last one. Also you can make things simpler in the actions. I would write it as follows. Still, not sure it will help with the root cause.
- alias: "Mobilnotis: Batteribyte behövs"
trigger:
- platform: time
at: '06:00:00'
- platform: time
at: '12:00:00'
- platform: time
at: '18:00:00'
action:
- service: notify.ilias_galaxy_note_8
data_template:
title: "HEMMET {{ now().strftime('%H.%M') }}"
message: >
Dags att byta batterier.
{% for entity_id in state_attr('group.battery_levels', 'entity_id')
if states(entity_id)|int(20) < 20 %}
{{ state_attr(entity_id, 'friendly_name') or entity_id }}: {{
states(entity_id) }}%
{% endfor %}
That is very strange. I wonder if the notify.ilias_galaxy_note_8 service itself has a problem with a message string that contains that character, because I would think it should not be causing problems with the template and automation. It would be interesting to see (with that character still there) in home-assistant.log if the automation was triggered and the service was called and what the parameters of the service call were, and if it was the service itself that didn’t work.
I guess the notification service I am using (Join) might be the culprit here.
When adding the %-sign to another working automation that uses Join för the notification, that automation also stopped working.