Two conditions almost identical but one fails

Hi. I triying to make an automation that turns off the chiller when any thermostat is demanding. I set three conditions with three of the thermostat (there are four in total inside an “and” condition)


All the conditions are the same, like this:

condition: template
value_template: >-
  {{(state_attr('climate.termostato_fc_salon', 'current_temperature')|
  int)>(state_attr('climate.termostato_fc_salon', 'temperature')| int)}}
alias: Termostato de salón NO demanda

The fourth one is this:

condition: template
value_template: >-
  {{(state_attr('climate.termostato_fc_dormnin', 'current_temperature')|
  int)>(state_attr('climate.termostato_fc_dormnin', 'temperature')|int)}}
alias: Termostato de dormitorio peq NO demanda

But it fails with this error message:

In ‘template’ condition: ValueError: Template error: int got invalid input ‘None’ when rendering template ‘{{(state_attr(‘climate.termostato_fc_dormnin’, ‘current_temperature’)| int)>(state_attr(‘climate.termostato_fc_dormnin’, ‘temperature’)|int)}}’ but no default was specified

The condition is copy-pasted and changed the thermostat in each one.
I don’t know which default value is that and why the other three conditions works without that value but this last one not.

I tried to change the order of the conditions, but the problem remains even if this fourth condition is changed to the first, second or third position.

Hope someone can help me!
Thanks in advance.

Check the entity in the States tool… one of the attributes is returning “null” or “none”.

2 Likes

That was the problem, thanks!