I dont quite know how to go about this.
I want to logical AND the state of a binary_sensor and the state of a thermostat (ESPHome native, not home assistant) and dont really know how to do it or derive the state of the thermostat controller.
Lambdas? or is there an easier way of finding the state of the thermostat???
It would be a great help if someone could guide me.
binary_sensor:
- platform: template
name: "ds18b20 state"
id: ds18_state
lambda: |-
if (id(temp_probe_error).state > 0) {
return true;
} else {
return false;
}
on_state:
then:
- if:
condition:
binary_sensor.is_off: ds18_state
then:
do this script 1
...
else:
do this script 2
- if:
#######THIS PART## AND'ing the relay and the state of the thermostat control ##########
condition:
and:
- switch.is_off: relay_1
- climate.mode_is_cooling: myclimatecontroller
then:
do this script 3