Open adonno opened 4 years ago
additionally, if the temperature is above 25 degrees the fan shouldn't turn on The logic will be on the switch using lambdas, I will use the home-assistants sensor to import the temperature and then uses a local logic
First I import the sensor i need from HA:
sensor:
- platform: homeassistant
name: "bathroomtemp"
entity_id: sensor.temperature_sdb_eltern
id: br_temp`
Then I'll add the logic to the switch on the relay
binary_sensor:
- platform: gpio
pin:
number: GPIO3
inverted: true
name: "${plug_name}_button"
on_press:
then:
- if:
condition:
lambda: 'return id(br_temp).state < 25;'
then:
- switch.turn_on: relay
else:
- switch.turn_off: relay
that didn't work something is off with my lambda
We have a fan heater in our bathroom that has to be turned on manually and turns of automatically as soon as we hit 25 degrees.
This should be enhanced to turn on again as soon as the temperature drops as long as the lights are on