Simple on off temperature automation

Hello, I’m new to Home assistant and need some help.
I have a small electric fan/heater connected to a Philips Hue Smart Plug.
This has to be controlled with a Xiaomi temperature sensor.
The Heater shall turn on above 4 degrees and off when it reaches 10 degrees.

maybe you should look at or try this:

I have tried this:

climate:
  - platform: generic_thermostat
    name: Test
    heater: switch.signify_netherlands_b_v_lom001_on_off
    target_sensor: sensor.lumi_lumi_weather_temperature
    min_temp: 4
    max_temp: 6
    ac_mode: false
    target_temp: 5
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
      seconds: 5
    keep_alive:
      minutes: 3
    initial_hvac_mode: "off"
    away_temp: 16
    precision: 0.1

But now the temperature is 7,5 degrees and the Hue smart plug is still on

Can anybody tell me why this is not working?

Are you turning it on when’s it already over 6 degrees

Did u figure this out? strugeling with the same thing now…

I have the following simple automation running which is turning my bathroom heating on and off based on the humidity:

This will turn on the heating based on humidity. (Turn on if above 75% and is below 99%). It is my understanding you should use the above and below attribute in order to make it a one time shot. (its only triggered once when the threshold is crossed)

- alias: 'auto_heating_bad_on'
  mode: "single"
  trigger:
    - platform: numeric_state
      entity_id: sensor.badhumidity
      # At least one of the following required
      above: 75
      below: 99
  condition: []
  action:
    - service: climate.set_temperature
      data:
        temperature: 26
      target:
        entity_id:
          - climate.bad_heizung

This is the code to turn off. This is triggered when the humidity goes below 70% but is above 1%

- alias: 'auto_heating_bad_off'
  mode: "single"
  trigger:
    - platform: numeric_state
      entity_id: sensor.badhumidity
      # At least one of the following required
      above: 1
      below: 70
  condition: []
  action:
    - service: climate.set_temperature
      data:
        temperature: 15
      target:
        entity_id:
          - climate.bad_heizung

I left out some code with conditions - I have some virtual switches telling if it is summer (no heating) or if I’m on holidays.

I recommend you always leave a value gap between turn on and off. This is called a hysteresis. You should do this because different sensor measurements can slightly variate and this would then trigger many on/off events after each other.

Hope this helps. I guess adapting this to temperature levels should be easy.

1 Like