Create an heating only thermostat

Hello,

I would like to make a thermostat to control a glycol heating (underfloor heating) I try with esphome to use “bang bang thermostat” but when I import it into home assistant I always get a double thermostat (min and max) but in my case its only heating. I would like the thermostat to work alone if the home assistant had just stopped working.

Otherwise we have a way to make a generic thermostat in home but the temperature setpoint can be modified in home but the esp keeps in memory the last setpoint received

I did something temporary with overheating and freeze security but is not perfect

Thanks all for your help

Esphome code:

esphome:
  name: esp_therm_entree
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: "xxxx"
  password: "xxxx"

  # Enable fallback hotspot (captive portal) in case wifi connection fails


captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

web_server:
  port: 80


dallas:
  - pin: 13
    update_interval: 10s

sensor:
  - platform: dallas
    address: 0xFD0516A1B32BFF28
    name: "Température Planché Entrée"
    id: temp_floor_entree
    on_value_range:
        - above: 29
          then:
            - switch.turn_off: Heating_D3
        - below: 9
          then:
            - switch.turn_on: Heating_D3
    
switch:
  - platform: gpio
    name: "Heating"
    id: "Heating_D3"
    pin: 14
    inverted: false

Configuration.yaml

climate:
  - platform: generic_thermostat
    name: Entrée
    heater: switch.heating
    target_sensor: sensor.temperature_planche_entree
    min_temp: 10
    max_temp: 28    
    target_temp: 23
    cold_tolerance: 0.2
    hot_tolerance: 0.2
    precision: 0.5

Thanks for your reply,

but if the home assistant stops working while the relay is on, it will not stop heating. If i understand well

Why would home assistant stop working?

Any reason bug, home server crashes, hard drive fail, unraid fail

Right now, bang-bang is the only fully independent thermostat that works only on the ESP module
You already have it set to prevent it from over-heating. If it loses contact with HA, then your code turns off the relay. This is done in ESPHome and does not require HA.

    on_value_range:
        - above: 29
          then:
            - switch.turn_off: Heating_D3 # THIS WILL WORK EVEN WITHOUT A CONNECTION

I think what you’re doing is the best that can be done for now. I think that there is a request for more complex climate control on ESPHome but not implemented currently.

Was this figured out? I want to add a heater to mine running esphome, which is sonoff basic and dht22.

The problem with the bang bang climate controller is that it creates a component in HA with 2 setpoints. It would have been nice if we had the option with only one setpoint and an internal hysteresis in esphome which was not visible and changeable by the user.

1 Like

I just did a regular thermostat. I put it to a run time of min of 30 minutes. Seems to be what I need.

I need to review how to setup a safe guard in ESP home if HA goes down it doesnt get stuck “ON”

You could check api connect at intervals … If it is off deactivate the relay … Api indicates the connection with the home assistant @scubieman

Hi @maxim31. I’m looking for the same thermostat. Independent on HA, but with option to change tempterature, time, etc from HA. Have you idea how to make it?

This is what I did. If there is no connection home assistant, you can activate and deactivate the heaters without logic. If you are away from home and activate the heaters with home assistant logic, if this suddenly stops working, the heaters turn off.

3 Likes

Looks good. Can you share your config?

Great solution. Is this also based on ESPHome? I am currently trying to build a thermostat with the bang bang component but the two setpoints are really annoying…

Yes, I agree on that one. It is impossible to let people without a technical background adjust the temperature. A solution could be to create a template climate in esphome, but that requires some programming.

This is the first version, soon I will publish the version with logic also offline.

@stigvi

1 Like

Esphome add thermostat components :slight_smile: :grinning: https://esphome.io/components/climate/thermostat.html