Small question regarding template

Hi there,
I tested a template in template editor and it returned the correct values:

value_template: > 
{{ states('sensor.hc1_supplytemperaturesetpoint') | int > 35 and states('sensor.hc1_actual_supply_temperature_for_hc') | int > 25 }}
availability: >
          {{ not is_state('sensor.hc1_supplytemperaturesetpoint', 'unavailable') and not is_state('sensor.hc1_actual_supply_temperature_for_hc', 'unavailable') }}

however, I tried to input it into the GUI of a new binary_sensor tempalte and got

“Translation error: MALFORMED_ARGUMENT”

And the template shows Normal whatever condition is met.
what did I do wrong?

Kind regards
Nils

You can’t use the availability template in the state template box in the GUI. It is a completely different option. That the GUI does not support. You have to use yaml. Also:

state: > 
  {{ states('sensor.hc1_supplytemperaturesetpoint') | int > 35 and states('sensor.hc1_actual_supply_temperature_for_hc') | int > 25 }}
availability: >
  {{ has_value('sensor.hc1_supplytemperaturesetpoint') and has_value('sensor.hc1_actual_supply_temperature_for_hc') }}
1 Like

I could put the availibilty into the bool statement to only set ok if the real sensor si available.

Thank you

Yes you could, I just gave an example of that here: Changing template from float(...) to (...) | float(0) - #6 by tom_l

1 Like