Multiple conditions in template helper?

Hi

I am still a beginner on the yaml stuff, so I need a bit of help.
In a template helper, I have this:

{% if 'End Of Cycle' in states('sensor.aeg_vaskemaskine_appliancestate') %}
{{ (states('sensor.aeg_vaskemaskine_fcmiscellaneousstate_optisenseresult') | float) / 1000| round(3) }}
{% else %}
{{ 0 | float }}
{% endif %}

Now I have found out, that the if condition actually also need to make sure, that the content of sensor.aeg_vaskemaskine_fcmiscellaneousstate_optisenseresult isn’t 65535 … How is this done ?

Regards
Brian

{% if 'End Of Cycle' in states('sensor.aeg_vaskemaskine_appliancestate')
   and states('sensor.aeg_vaskemaskine_fcmiscellaneousstate_optisenseresult')|int(0) != 65535 %}
  {{ (states('sensor.aeg_vaskemaskine_fcmiscellaneousstate_optisenseresult') | float) / 1000| round(3) }}
{% else %}
  0
{% endif %}
2 Likes