sagebind / ha-dual-smart-thermostat

The `dual_smart_thermostat` is an enhaced verion of generic thermostat implemented in Home Assistant. It uses several sensors and dedicated switches connected to a heater and air conditioning under the hood.

Home Page:https://github.com/swingerman/ha-dual-thermostat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Home Assistant Dual Smart Thermostat component

The dual_smart_thermostat is an enhanced verion of generic thermostat implemented in Home Assistant.

hacs_badge Release Donate

Features

Heater/Cooler Mode
Heater Only Mode
Two Stage Heating Mode
Cooler Only mode
Floor Temperature Control
Window/Door sensor integration
Presets

Heat/Cool Mdoe

If both heater and cooler entities configured. The thermostat can control heaing and cooling and you sare able to set min/max low and min/max high temperatures. In this mode you can turn the thermostat to heat only, cooler only and back to heat/cool mode.

all features ⤴️

Heater Only Mode

If only the heater entity is set the thermostat works only in heater mode.

all features ⤴️

Two Stage Heating

Thwo stage heating canbe anabled by cadding the required configuration netities: secondary_heater, secondary heater_timeout. If these are set the feature will enable automatically.

How Two Stage Heating Works?

If the timout ends and the heater was on for the whole time the thermostate switches to the secondary heater. In this case the primarey heater (heater) will be turned off. This will be rmemebered for the day it turned on and in the next heating cycle the secondary heater will trun on automatically. On the next day the primary heater will turn on again the second stage will again only turn on after a timeout.

Two Stage Heating Example

openings:
  - sensor.window1
  - sensor.window2
  - entity_id: binary_sensor.window3
    timeout: 00:00:30 # cosnidered to be open if still open after 30 seconds

Cooler Only Mode

If only the cooler entity is set the thermostat works only in cooling mode.

all features ⤴️

Openings

The dual_smart_thermostat can turn off heating or cooling if a window or door is opened and turn heating or cooling back on when the door or window is closed to save energy. The openings configuration variable accepts a list of opening entities and opening objects.

Opening entities and objects

An opening entity is a sensor that can be in two states: on or off. If the state is on the opening is considered open, if the state is off the opening is considered closed. The opening object can conatin a timout property that defines the time in seconds after which the opening is considered open even if the state is still on. This is useful if you would want to ignor windows opened only for a short time.

Openings Configuration

# Example configuration.yaml entry
climate:
  - platform: dual_smart_thermostat
    name: Study
    heater: switch.study_heater
    cooler: switch.study_cooler
    openings:
      - binary_sensor.window1
      - binary_sensor.window2
      - entity_id: binary_sensor.window3
        timeout: 00:00:30
    target_sensor: sensor.study_temperature

all features ⤴️

Floor heating temperature control

Maximum floor temperature

The dual_smart_thermostat can turn off if the floor heating reaches the maximum allowed temperature you define in order to protect the floor from overheating and damage. To enable this protection you need to set two variables:

floor_sensor: sensor.floor_temp
max_floor_temp: 28

Minimum floor temperature

The dual_smart_thermostat can turn on if the floor temperature reaches the minimum required temperature you define in order to protect the floor from freezing or to keep it on a comfortbale temperature.

Floor Temoerature COntrol Configuration

# Example configuration.yaml entry
climate:
  - platform: dual_smart_thermostat
    name: Study
    heater: switch.study_heater
    cooler: switch.study_cooler
    target_sensor: sensor.study_temperature
    floor_sensor: sensor.floor_temp
    max_floor_temp: 28
    min_floor_temp: 5

all features ⤴️

Presets

Currrnetly supported presets are:

To set presets you need to add entries for them in the configuration file like this:

preset_name:
  temperature: 13
  target_temp_low: 12
  target_temp_high: 14

all features ⤴️

Configuration variables

name

(required) (string) Name of thermostat

default: Dual Smart

heater

(required) (string) "entity_id for heater switch, must be a toggle device. Becomes air conditioning switch when ac_mode is set to true"

secondary_heater

(optional, required for two stage heating) (string) "entity_id for secondary heater switch, must be a toggle device.

secondar_heater_timeout

(optional, required for two stage heating) (time, integer) Set a minimum amount of time that the switch specified in the heater option must be in its ON state before secondary heater devices needs to be turned on.

cooler

(optional) (string) "entity_id for cooler switch, must be a toggle device."

target_sensor

(required) (string) "entity_id for a temperature sensor, target_sensor.state must be temperature."

floor_sensor

(optional) (string) "entity_id for the foor temperature sensor, floor_sensor.state must be temperature."

openings

(optional) (list) "list of opening entity_id's and/or opbjects for detecting open widows or doors that will idle the termostat until any of them are open. Note: if min_floor_temp is set and the floor temperature is below the minimum temperature, the thermostat will not idle even if any of the openings are open."

entity_id: <value>The entity id of the opening bstate sensor (string)

timeout: <value> The time after which the opening is considered open even if the state is still on (timedata)

min_temp

(optional) (float)

default: 7

max_temp

(optional) (float)

default: 35

max_floor_temp

(optional) (float)

default: 28

min_floor_temp

(optional) (float)

target_temp

(optional) (float) Set initial target temperature. If this variable is not set, it will retain the target temperature set before restart if available.

target_temp_low

(optional) (float) Set initial target low temperature. If this variable is not set, it will retain the target low temperature set before restart if available.

target_temp_high

(optional) (float) Set initial target high temperature. If this variable is not set, it will retain the target high temperature set before restart if available.

ac_mode

(optional) (boolean) Set the switch specified in the heater option to be treated as a cooling device instead of a heating device. This parameter will be ignored if cooler entity is defined.

default: false

heat_cool_mode

(optional) (boolean) If variable target_temp_low and target_temp_high are not set, this parameter must be set to true to enable the heat_cool mode.

default: false

min_cycle_duration

(optional) (time, integer) Set a minimum amount of time that the switch specified in the heater and/or cooler option must be in its current state prior to being switched either off or on.

cold_tolerance

(optional) (float) Set a minimum amount of difference between the temperature read by the sensor specified in the target_sensor option and the target temperature that must change prior to being switched on. For example, if the target temperature is 25 and the tolerance is 0.5 the heater will start when the sensor equals or goes below 24.5.

default: 0.3

hot_tolerance

(optional) (float) Set a minimum amount of difference between the temperature read by the sensor specified in the target_sensor option and the target temperature that must change prior to being switched off. For example, if the target temperature is 25 and the tolerance is 0.5 the heater will stop when the sensor equals or goes above 25.5.

default: 0.3

keep_alive

(optional) (time, integer) Set a keep-alive interval. If set, the switch specified in the heater and/or cooler option will be triggered every time the interval elapses. Use with heaters and A/C units that shut off if they don't receive a signal from their remote for a while. Use also with switches that might lose state. The keep-alive call is done with the current valid climate integration state (either on or off).

initial_hvac_mode

(optional) (string) Set the initial HVAC mode. Valid values are off, heat, cool or heat_cool. Value has to be double quoted. If this parameter is not set, it is preferable to set a keep_alive value. This is helpful to align any discrepancies between dual_smart_thermostat heater and cooler state.

NOTE! If this is set, the saved state will not be restored after HA retstarts.

away

(optional) (list) Set the temperatures used by preset_mode: away. If this is not specified, the preset mode feature will not be available.

Possible values are:

temperature: <value> The preset temperature to use in heat or cool mode (float)
target_temp_low: <value> The preset low temperature to use in heat_cool mode (float)
target_temp_high: <value> The preset high temperature to use in heat_cool mode (float)

eco

(optional) (list) Set the temperature used by preset_mode: eco. If this is not specified, the preset mode feature will not be available.

Possible values are:

temperature: <value> The preset temperature to use in heat or cool mode (float)
target_temp_low: <value> The preset low temperature to use in heat_cool mode (float)
target_temp_high: <value> The preset high temperature to use in heat_cool mode (float)

home

(optional) (list) Set the temperature used by preset_mode: home. If this is not specified, the preset mode feature will not be available.

Possible values are:

temperature: <value> The preset temperature to use in heat or cool mode (float)
target_temp_low: <value> The preset low temperature to use in heat_cool mode (float)
target_temp_high: <value> The preset high temperature to use in heat_cool mode (float)

comfort

(optional) (list) Set the temperature used by preset_mode: comfort. If this is not specified, the preset mode feature will not be available.

Possible values are:

temperature: <value> The preset temperature to use in heat or cool mode (float)
target_temp_low: <value> The preset low temperature to use in heat_cool mode (float)
target_temp_high: <value> The preset high temperature to use in heat_cool mode (float)

sleep

(optional) (list) Set the temperature used by preset_mode: sleep. If this is not specified, the preset mode feature will not be available.

Possible values are:

temperature: <value> The preset temperature to use in heat or cool mode (float)
target_temp_low: <value> The preset low temperature to use in heat_cool mode (float)
target_temp_high: <value> The preset high temperature to use in heat_cool mode (float)

anti_freeze

(optional) (list) Set the temperature used by preset_mode: Anti Freeze. If this is not specified, the preset mode feature will not be available.

Possible values are:

temperature: <value> The preset temperature to use in heat or cool mode (float)
target_temp_low: <value> The preset low temperature to use in heat_cool mode (float)
target_temp_high: <value> The preset high temperature to use in heat_cool mode (float)

precision

(optional) (float) The desired precision for this device. Can be used to match your actual thermostat's precision. Supported values are 0.1, 0.5 and 1.0.

default: 0.5 for Celsius and 1.0 for Fahrenheit.

target_temp_step

(optional) (float) The desired step size for setting the target temperature. Supported values are 0.1, 0.5 and 1.0.

default: Value used for precision

Installation

Installation is via the Home Assistant Community Store (HACS), which is the best place to get third-party integrations for Home Assistant. Once you have HACS set up, simply search the Integrations section for Dual Smart Thermostat.

Heater Mode Example

climate:
  - platform: dual_smart_thermostat
    name: Study
    heater: switch.study_heater
    target_sensor: sensor.study_temperature
    initial_hvac_mode: "heat"

Two Stage Heateing Mode Example

For two stage heating both the heater and secondary_heater must be defined. The secondary_heater will be turned on only if the heater is on for the amount of time defined in secondar_heater_timeout.

climate:
  - platform: dual_smart_thermostat
    name: Study
    heater: switch.study_heater

    secondary_heater: switch.study_secondary_heater # <-requred
    secondar_heater_timeout: 00:00:30 # <-requred

    target_sensor: sensor.study_temperature
    initial_hvac_mode: "heat"

Cooler Mode Example

climate:
  - platform: dual_smart_thermostat
    name: Study
    heater: switch.study_cooler
    ac_mode: true # <-important
    target_sensor: sensor.study_temperature
    initial_hvac_mode: "cool"

Floor Temperature Caps Example

climate:
  - platform: dual_smart_thermostat
    name: Study
    heater: switch.study_heater
    target_sensor: sensor.study_temperature
    initial_hvac_mode: "heat"
    floor_sensor: sensor.floor_temp # <-required
    max_floor_temp: 28 # <-required
    min_floor_temp: 20 # <-required

DUAL Heat-Cool Mode Example

This mode is used whan you want (and can) control bothe the heater and the cooler. In this mode the target_temp_low and target_temp_high must be set. In this mode you can switch between heating and cooling by setting the hvac_mode to heat or cool or heat_cool.

climate:
  - platform: dual_smart_thermostat
    name: Study
    heater: switch.study_heater # <-required
    cooler: switch.study_cooler # <-required
    target_sensor: sensor.study_temperature
    heat_cool_mode: true # <-required
    initial_hvac_mode: "heat_cool"

OPENINGS Example

climate:
  - platform: dual_smart_thermostat
    name: Study
    heater: switch.study_heater
    cooler: switch.study_cooler
    target_sensor: sensor.study_temperature
    openings: # <-required
      - binary_sensor.window1
      - binary_sensor.window2
      - entity_id: binary_sensor.window3
        timeout: 00:00:30 # <-optional

Tolerances

The dual_smart_thermostat has two tolerance variables: cold_tolerance and hot_tolerance. These variables are used to prevent the heater or cooler from switching on and off too frequently. For example, if the target temperature is 25 and the tolerance is 0.5 the heater will start when the sensor equals or goes below 24.5. The heater will stop when the sensor equals or goes above 25.5. This prevents the heater from switching on and off too frequently when the temperature is close to the target temperature.

If the thermosat is set to heat_cool mode the tolerance will work in the same way for both the heater and the cooler.

climate:
  - platform: dual_smart_thermostat
    name: Study
    heater: switch.study_heater
    cooler: switch.study_cooler
    target_sensor: sensor.study_temperature
    cold_tolerance: 0.3
    hot_tolerance: 0

Full configuration example

climate:
  - platform: dual_smart_thermostat
    name: Study
    heater: switch.study_heater
    cooler: switch.study_cooler
    secondary_heater: switch.study_secondary_heater
    secondar_heater_timeout: 00:00:30
    target_sensor: sensor.study_temperature
    floor_sensor: sensor.floor_temp
    max_floor_temp: 28
    openings:
      - binary_sensor.window1
      - binary_sensor.window2
      - entity_id: binary_sensor.window3
        timeout: 00:00:30
    min_temp: 10
    max_temp: 28
    ac_mode: false
    target_temp: 17
    target_temp_high: 26
    target_temp_low: 23
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
      seconds: 5
    keep_alive:
      minutes: 3
    initial_hvac_mode: "off" # hvac mode will reset to this value after restart
    away: # this preset will be available for all hvac modes
      temperature: 13
      target_temp_low: 12
      target_temp_high: 14
    home: # this preset will be available only for heat or cool hvac mode
      temperature: 21
    precision: 0.1
    target_temp_step: 0.5

Donate

I am happy tp help the Home Assistant community but I do it in my free time at the cost of spending less time with my family. Feel free to motivate me and appreciate my sacrifice by donating:

Donate coffee

About

The `dual_smart_thermostat` is an enhaced verion of generic thermostat implemented in Home Assistant. It uses several sensors and dedicated switches connected to a heater and air conditioning under the hood.

https://github.com/swingerman/ha-dual-thermostat

License:Apache License 2.0


Languages

Language:Python 99.0%Language:Shell 0.8%Language:Dockerfile 0.1%Language:JavaScript 0.0%