{% set consigne_HC_Courant = ( ( states('input_number.ev_threhold_house_max_power')|float - states('sensor.enedis_power')|float ) / 300 ) | int + states('number.lidl_uswb11a1_allowed_current')|int(0) %} {% if consigne_HC_Courant > 16 %} 16 {% elif consigne_HC_Courant < 6 %} 6 {% else %} {{ consigne_HC_Courant }} {% endif %}