You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my template sensor, I want to select the icon based on the sensors state. But the icon template only knows the previous state, forcing me to repeat all state logic in the icon template.
What version of Home Assistant Core has the issue?
2021.8.3
What was the last working version of Home Assistant Core?
Hey there @PhracturedBlue, @tetienne, @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (template) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)
Trigger-based entities do not automatically update when states referenced in the templates change. This functionality can be added back by defining a state trigger for each entity that you want to trigger updates.
In your case, you should add a state trigger triggering on sensor.test_icon
There's a new feature in Home Assistant Core 2012.12 which prevents the trigger from firing when an attribute updates: #59713
The problem
In my template sensor, I want to select the icon based on the sensors state. But the icon template only knows the previous state, forcing me to repeat all state logic in the icon template.
What version of Home Assistant Core has the issue?
2021.8.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Template
Link to integration documentation on our website
No response
Example YAML snippet
This is most simplified, obviously. My real use case has a more complex state template.
Anything in the logs that might be useful for us?
No response
Additional information
This might be circumventable with variables being allowed in the template integration, like in scripts.
It can also be circumvented with an additional trigger:
The text was updated successfully, but these errors were encountered: