Automation Trigger not State but Attribute?

I am getting the error from my automation :

“Error executing script. Unexpected error for call_service at pos 1: Error rendering data template: UndefinedError: ‘trigger’ is undefine”

From the documentation I get the understanding that triggering using attribute behaves like triggering using state. Where am I going wrong, when I want the automation triggering when attribute latest_release_tag changes?

From the GUI -YAML editor:

alias: OpenTX  RC Frimware Update MSG
description: OpenTX and Multiprotocol update Message
trigger:
  - platform: state
    entity_id: sensor.github_opentx
    attribute: latest_release_tag
condition: []
action:
  - service: notify.me
    data:
      title: HA - Information
      message: >-
        "{{trigger.from_state.attributes.friendly_name}}:
        {{trigger.from_state.attributes.latest_release_tag}}->{{trigger.to_state.attributes.latest_release_tag}}"
mode: single

I reckon you’ve found an issue / unsupported feature with the trigger state object.

Turns out the issue has been reported in desember 2020.

1 Like