Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95414

Automation Script error for message {{ trigger.to_state.name }}

$
0
0

@Tomahawk wrote:

Using an automation written in the automation old file it works.The code beeing:

- id: os_updater_available_yaml
  alias: OS Update Available
  initial_state: true
  trigger:
    - platform: state
      entity_id: binary_sensor.updater, 
                 binary_sensor.updater_addons,
                 binary_sensor.updater_hacs,
                 binary_sensor.updater_supervisor
      to: 'on'
  action:
    - wait_template: >-
        {% if "11 :00" < now().strftime("%H:%M") < "21:00" %}
          True
        {% endif %}
    - service: notify.me
      data_template:
        title: 'HA - Information'
        message: >-
          OS {{ trigger.to_state.name }} is available

But using the Automation GUI editor I cant get the automation to work due to this error:

“System OS updater Notification: Error executing script. Error rendering template for call_service at pos 2: UndefinedError: ‘trigger’ is undefined”


What am I doing wrong in the editor?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95414

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>