Home-AssistantConfig icon indicating copy to clipboard operation
Home-AssistantConfig copied to clipboard

Enhance fan heater in bathroom

Open adonno opened this issue 5 years ago • 3 comments

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

adonno avatar May 09 '20 19:05 adonno

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

adonno avatar Jul 14 '20 21:07 adonno

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

adonno avatar Jul 15 '20 14:07 adonno

that didn't work something is off with my lambda

adonno avatar Jul 18 '20 20:07 adonno