WTF - am I crazy or what's wrong with my templates?

OK… unfortunately, I just run over another issue in my automation, which I don’t really understand.
… but it is not the automation, which does not behave, as I expect - it is a f**** template text… :frowning:

Here’s my message which should be displayed (I’ve translated the text here - in the screenshot, it is still german)

    message: >-
      There are new updates for {{ trigger.from_state.attributes.friendly_name }}
      available.
      <br><br>
      Installed Version: {{ trigger.from_state.attributes.installed_version }}
      <br>
      Available Version: {{ trigger.from_state.attributes.latest_version }}

For far, the templates seem to work - it does get the correct Integration, it does also get the correct “installed version”… but the latest version is not correct:
grafik

Validation?

This is what my dashboard card is showing:
grafik

And here are the attributes of the entity / sensor:

auto_update: false
installed_version: 1.19.9
in_progress: false
latest_version: 1.20.0
release_summary: null

I am also not able to see any typo - or something… ?!
Maybe, you do have an idea what’s wrong here?

Thanks in advance,
Chris

If you use from_state it fetches the version from before your automation was triggered.

ok… thanks :smiley:

I’ve interpreted the “from_state” as “from this state” :rofl:

from_state is a State Object containing information about the entity’s properties prior to the state-change.

to_state is a State Object containing the entity’s properties after the state-change.

For example, if a State Trigger is monitoring a binary_sensor and its state value changes from off to on then trigger.from_state.state is off and trigger.to_state.state is on.

Reference: Templating - State Trigger

1 Like