Dictionary lookup throws exception and halts automation latest HA update
The problem
Automations that were working with 2025.2.5 are failing with 2025.3.2 (I skipped 2025.3 and 2025.3.1).
The failure is a dictionary lookup where the key/attribute is not found and the lookup is nested within a larger expression. For example,
{{ heat['attribute'] | float(0) + heat['attribute2'] | float(0) }}
With 2025.3.2 the automation is halted with an error message indicating missing attribute (it is indeed missing but this used continue without error using the default). With 2025.2.5, this would not yield an error, but instead provide the default value.
However, the following works in 2025.3.2 without error despite the attribute being missing.
temp1: "{{ heat['attribute'] }}"
temp2: "{{ heat['attribute2'] }}"
{{ temp1 | float(0) + temp2 | float(0) }}
This odd behavior: why would doing it into a variable work but the same in an expression cause a fault.
I thought this form name['attribute'] was never supposed to error on missing attribute, compared with name.attribute, which is expected to error on missing attribute.
This is also breaking change, meaning my automations have to be rewritten to work with the current version of HA.
And if the intent is to keep this strange change in behavior, you'll have to document the disparity in how it now works, such as the workaround above.
What version of Home Assistant Core has the issue?
core-2025.3.2
What was the last working version of Home Assistant Core?
core-2025.2.5
What type of installation are you running?
Home Assistant OS
Integration causing the issue
No response
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
{{ heat['attribute'] | float(0) + heat['attribute2'] | float(0) }}
#Note that the attribute is indeed missing, but this used to continue on with 2025.2 and prior.
Anything in the logs that might be useful for us?
Additional information
No response
Hey there @petro31, @phracturedblue, @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!
Code owner commands
Code owners of template can trigger bot actions by commenting:
-
@home-assistant closeCloses the issue. -
@home-assistant rename Awesome new titleRenames the issue. -
@home-assistant reopenReopen the issue. -
@home-assistant unassign templateRemoves the current integration label and assignees on the issue, add the integration domain after the command. -
@home-assistant add-label needs-more-informationAdd a label (needs-more-information, problem in dependency, problem in custom component) to the issue. -
@home-assistant remove-label needs-more-informationRemove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.
(message by CodeOwnersMention)
template documentation template source (message by IssueLinks)
You have to provide more information. Please post the entire automation/script/template entity that this is used in so we can identify anything that may have changed.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.