I created some template sensors to show the installed version of ESPHome devices on the HA GUI.
As far as I know the current sw version is not directly accessible, so I am obtaining the sw_version attribute from the ESP devices.
This is the current code:
These sensors correctly show the currently installed ESPHome version like so:
2026.1.5 (2026-02-11 08:33:22 +0100)
But to my surprise the values are not automatically updated when a new version of the software is installed. I expected these sensors to update every minute.
Apparently a changed attribute of a device is not seen as a state change?
Why doesn’t this work, and what could be a solution for this?
Should I add a time based trigger?
But unfortunately it still doesn’t auto-update after installing a new sw version.
When I enter the code in the Template editor the result is correct, but the template sensor still keeps showing the old value, also after more then a minute.
Only after going through Settings → Developer tools → YAML → Reload Template entities I get the correct results.
That’s an uptime entity, it also does not change frequently. The state will be a datetime set when the source was rebooted/restarted, the UI makes it look like it updates frequently because the time is “counting up” but it’s purely a UI calculation.
Interesting!
I will try adding the trigger later, but just out of curiosity I now tested it with another entity: the human readable uptime sensor, but apparently this also does no really change state (its an uptime entity as well).
Then I changed it into a WiFi Strength entity , that does change often (with an update interval of 60 sec), but still the same effect: the template sensor is not updated. Is this also as expected?
Looking at the Template editor again, I now see that the Result is shown as:
Result
2026.2.2 (2026-02-26 16:00:06 +0100)
Result type: string
This template does not listen for any events and will not update automatically.