Vex
(Marcin Bielecki)
July 4, 2022, 9:03am
1
I would like to turn on the AC when the temperature rises above 25C
After typing the following in Developer Tools , it shows me true
.
{{ states.climate.klima_gabinet.attributes.current_temperature | int > 25 }}
Unfortunately, when I add the following condition in the automation, I get an error message: template value should be a string for dictionary value @ data['value_template']. Got None
condition: template
value_template: "{{ states.climate.klima_gabinet.attributes.current_temperature | int > 25 }}"
what am I doing wrong?
tom_l
July 4, 2022, 9:08am
2
Other than ignoring this recommendation:
Use this format instead:
value_template: "{{ state_attr('climate.klima_gabinet', 'current_temperature') | int(0) > 25 }}"
You did nothing wrong. It is an issue with the template editor.
opened 01:22PM - 08 Apr 22 UTC
### The problem
In order to implement a somewhat more complex template conditio… n, I came across the problem that (at least testing) templates conditions do not work (anymore).
What I did:
Create a simple automation having a template condition:
```
- condition: template
value_template: "{{ 1 > 2 }}"
```
So, this is extremely simplifed. The expression should return False, but instead I get the following error when testing this expression in the condition frontend (under automatisations):
`Error handling message: template value should be a string for dictionary value @ data['value_template']. Got None (invalid_format)`
If I enter the same snippet of code in the templates section un der developer tools, it prints false.
Either there is a problem in the code just adding the template condition in the automatisation frontend or something is completely borked.
### What version of Home Assistant Core has the issue?
2022.4.1
### 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
Automation
### Link to integration documentation on our website
_No response_
### Diagnostics information
_No response_
### Example YAML snippet
```yaml
- condition: template
value_template: "{{ 1 > 2 }}"
```
### Anything in the logs that might be useful for us?
```txt
2022-04-08 14:40:54 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140209354674720] Error handling message: template value should belue_template']. Got None (invalid_format)
```
### Additional information
_No response_