Add input_boolean from homeassistant

Heres part of my code that works…
I want to add to conditions an and with an input_boolean from homeassistant.

  • platform: template
    name: “Heating Water”
    id: aquecer_deposito
    unit_of_measurement: “ºC”
    icon: “mdi:kettle-alert”
    accuracy_decimals: 1
    lambda: |-
    return (id(temperatura_deposito).state);
    update_interval: 5s
    on_value:
    if:
    condition:
    lambda: ‘return id(temperature_set_deposito).state > id(temperatura_deposito).state;’
    then:
    - switch.turn_on: relay2so

I have tried.

  • platform: template
    name: “Heating Water”
    id: aquecer_deposito
    unit_of_measurement: “ºC”
    icon: “mdi:kettle-alert”
    accuracy_decimals: 1
    lambda: |-
    return (id(temperatura_deposito).state);
    update_interval: 5s
    on_value:
    if:
    condition:
    and:
    lambda: ‘return id(temperature_set_deposito).state > id(temperatura_deposito).state;’
    lambda: ‘return id(input_boolean_heater_on).state == “on”;’

         then:
          - switch.turn_on: relay2so
    

How can I add it?

Please post your code properly. See point 11 here How to help us help you - or How to ask a good question