PS: @petro sorry if I’m tagging you, but I’m really getting mad about my issue.
Your help would be appreciated, because I don’t really know what to check
Thanks
To me your template seems to be OK. Are you sure that the entity climate.sala and all its attributes do exist at the time you are using it? What happens if you test {{ states.climate.sala }}
@pedolsky@starob and @petro
the issue was related to Saver integration reading some messages regarding the error “maximum recursion depth exceeded” that I found in my log
I was on 1.2.0 of Saver, a custom integration from HACS, and disabling it, the template sensors started working again
Then I found that there was a new version 1.2.1 and upgrading and enabling it, now it’s working again
Yup, in recent version I have added to Saver two custom Jinja functions and in some cases it caused infinite recursion during template environment set-up. The same problem could be also caused by v1.2.2 version of my Custom Templates integration (it should be fixed in v1.2.3).
For future reference, before posting a question in the forum, and always before reporting an Issue in GitHub, disable custom integrations. If the behavior disappears then you know it’s probably due to one of the custom integrations.
In this case, it’s unlikely anyone who has helped you could have guessed that you were using a custom integration that directly affects the behavior of entity states and templating.
no one helped me directly, I was investigating and after several hours I found in the log that a template sensor was in error with the error I posted above.
Then, searching in the community I found this post, not related to state_attr
disabling custom integrations, if someone have a lot of them, and I one of them, could be more expensive in time to get the solution.
I think you misunderstood and maybe you should read again the entire thread
Of course @pedolsky and @starob gave me suggestions on how to solve, but their suggetions were correct if the issue was in some wrong coding made by myself, but this was not the case. And I say thanks to them.
This is a community were everyone try to give and get help.
What I see from all you reply to this thread does not rely to give nor get help.
Their suggestions attempted to determine if the problem was due to the entity referenced by the template or the Template Sensor’s configuration itself. That’s the normal debugging strategy when something like what you reported fails.
Your suggestion that the problem was because your sensor had to be changed from legacy to modern format was corrected by pedolsky.
Neither pedolsky or starob (or me) could have guessed that you were using an obscure custom integration that affects the behavior of entity states and templating. You knew you installed it but no one else did. That’s why it’s important to disable custom integrations first to determine if they might be the cause.
Had you posted this as an Issue in GitHub, you would have received the same advice.