Html5 Notification with service template and action

Hi
i have trouble in getting this automation to work
it is just a test setup.

- alias: Garagentor Jogi test
  trigger:
  - entity_id: light.magichome_1
    platform: state
    to: 'on'
  condition:
  action:
    - service_template: >
        {% if (is_state('device_tracker.mi9tpro_miphone', 'home')) and (is_state('device_tracker.mi9tpro_miphone_2', 'home'))  %}
          notify.push_html5
        {% elif is_state('device_tracker.mi9tpro_miphone', 'home') %}
          notify.push_html5
        {% elif is_state('device_tracker.mi9tpro_miphone_2', 'home') %}
          notify.push_html5
        {% endif %}
      data:
        message: 'test message'
        title: 'test message title'
        actions:
        - action: garage_jogi_schliessen
          title: Garage schliessen

if i remove the action part at the end the notification is working. but how can i implement the action in this setup. any idea?

Your indentation is wrong on that last action.

     data:
        message: 'test message'
        title: 'test message title'
        actions:
          - action: garage_jogi_schliessen
            title: Garage schliessen

Not saying it’s the only problem, but it’s certainly a problem.

You should have an else statement, or a condition probably. What if no one is home and the light turns on? Nothing bad will happen, but will get an error message in the logs. Not important, but just something to keep in mind.