See full readme here: GitHub - jmcollin78/versatile_thermostat: A full featured Thermostat for Home Assistant: presets, window, motion, presence and overpowering management
This thermostat integration aims to drastically simplify your automations around climate management. Because all classical events in climate are natively handled by the thermostat (nobody at home ?, activity detected in a room ?, window open ?, power shedding ?), you don’t have to build over complicated scripts and automations to manage your climates ;-).
This custom component for Home Assistant is an upgrade and is a complete rewrite of the component “Awesome thermostat” (see Github) with addition of features.
News
- Release 3.1: added detection of open windows/doors by temperature drop. This new function makes it possible to automatically stop a radiator when the temperature drops suddenly. See Auto mode
- Major release 3.0: addition of thermostat equipment and associated sensors (binary and non-binary). Much closer to the Home Assistant philosophy, you now have direct access to the energy consumed by the radiator controlled by the thermostat and many other sensors that will be useful in your automations and dashboard.
- release 2.3: addition of the power and energy measurement of the radiator controlled by the thermostat.
- release 2.2: addition of a safety function allowing a radiator not to be left heating forever in the event of a thermometer failure
- major release 2.0: addition of the “over climate” thermostat allowing you to transform any thermostat into a Versatile Thermostat and add all the functions of the latter.
When to use / not use
This thermostat can control 2 types of equipment:
- a heater that only works in on/off mode (named
thermostat_over_switch
). The minimum configuration required to use this type of thermostat is:
has. equipment such as a radiator (aswitch
or equivalent),
b. a temperature probe for the room (or an input_number),
vs. an external temperature sensor (think about weather integration if you don’t have one) - another thermostat that has its own operating modes (named
thermostat_over_climate
). For this type of thermostat, the minimum configuration requires:
has. equipment such as air conditioning which is controlled by its ownclimate
type entity,
b. a temperature probe for the room (or an input_number),
vs. an external temperature sensor (think about weather integration if you don’t have one)
The thermostat_over_climate
type allows you to add all the functionality provided by VersatileThermostat to your existing equipment. The climate VersatileThermostat entity will control your climate entity, turning it off if the windows are open, switching it to Eco mode if no one is present, etc. See here. For this type of thermostat, any heating cycles are controlled by the underlying climate entity and not by the Versatile Thermostat itself.
Why another thermostat implementation ?
This component named Versatile thermostat manage the following use cases :
- Configuration through standard integration GUI (using Config Entry flow),
- Full uses of presets mode,
- Unset the preset mode when the temperature is manually defined on a thermostat,
- Turn off/on a thermostat when a door or windows is opened/closed after a certain delay,
- Change preset when an activity is detected or not in a room for a defined time,
- Use a TPI (Time Proportional Interval) algorithm thank’s to [Argonaute] algorithm ,
- Add power shedding management or regulation to avoid exceeding a defined total power. When max power is exceeded, a hidden ‘power’ preset is set on the climate entity. When power goes below the max, the previous preset is restored.
- Add home presence management. This feature allows you to dynamically change the temperature of preset considering a occupancy sensor of your home.
- Add services to interact with the thermostat from others integration: you can force the presence / un-presence using a service, and you can dynamically change the temperature of the presets and change dynamically the security parameters.
- Add sensors to see the internal states of the thermostat
Configuration
Note: no configuration in configuration.yaml is needed because all configuration is done through the standard GUI when adding the integration.
Click on Add integration button in the integration page
The configuration can be change through the same interface. Simply select the thermostat to change, hit “Configure” and you will be able to change some parameters or configuration.
Then follow the configurations steps as follow:
Minimal configuration update
Give the main mandatory attributes:
- a name (will be the name of the integration and also the name of the climate entity)
- the type of thermostat
thermostat_over_switch
to control a radiator controlled by a switch orthermostat_over_climate
to control another thermostat. Cf. above - a temperature sensor entity identifier which gives the temperature of the room in which the radiator is installed,
- a temperature sensor entity giving the outside temperature. If you don’t have an external sensor, you can use local weather integration
- a cycle duration in minutes. On each cycle, the heater will cycle on and then off for a calculated time to reach the target temperature (see preset below),
- minimum and maximum thermostat temperatures,
- the power of the l’équipement which will activate the power and energy sensors of the device,
- the list of features that will be used for this thermostat. Depending on your choices, the following configuration screens will appear or not.
Notes
1. With thethermostat_over_switch
type, calculation are done at each cycle. So in case of conditions change, you will have to wait for the next cycle to see a change. For this reason, the cycle should not be too long. 5 min is a good value,
2. if the cycle is too short, the heater could never reach the target temperature indeed for heater with accumulation features and it will be unnecessary solicited
Select the driven entity
Depending on your choice on the type of thermostat, you will have to choose a switch type entity or a climate type entity. Only compatible entities are shown.
For a thermostat_over_switch
thermostat:
The algorithm to be used today is limited to TPI is available. See algorithm
For a thermostat_over_climate
thermostat:
Configure the TPI algorithm coefficients
Click on ‘Validate’ on the previous page and you will get there:
For more informations on the TPI algorithm and tuned please refer to algorithm.
Configure the preset temperature
Click on ‘Validate’ on the previous page and you will get there:
The preset mode allows you to pre-configurate targeted temperature. Used in conjonction with Scheduler (see scheduler you will have a powerfull and simple way to optimize the temperature vs electrical consumption of your hous. Preset handled are the following :
- Eco : device is running an energy-saving mode
- Comfort : device is in comfort mode
- Boost : device turn all valve full up
None is always added in the list of modes, as it is a way to not use the presets modes but a manual temperature instead.
Notes
1. Changing manually the target temperature, set the preset to None (no preset). This way you can always set a target temperature even if no preset are available.
2. standardAway
preset is a hidden preset which is not directly selectable. Versatile Thermostat uses the presence management or movement management to set automatically and dynamically the target temperature depending on a presence in the home or an activity in the room. See presence management.
3. if you uses the power shedding management, you will see a hidden preset namedpower
. The heater preset is set topower
when overpowering conditions are encountered and shedding is active for this heater. See power management.
4. if you uses the advanced configuration you will see the preset set tosecurity
if the temperature could not be retrieved after a certain delay
5. ff you don’t want to use the preseet, give 0 as temperature. The preset will then been ignored and will not displayed in the front component
Configure the doors/windows turning on/off the thermostats
You must have chosen the With opening detection
feature on the first page to arrive on this page.
The detection of openings can be done in 2 ways:
- either with a sensor placed on the opening (sensor mode),
- either by detecting a sudden drop in temperature (auto mode)
The sensor mode
In sensor mode, you must fill in the following information:
- an entity ID of a window/door sensor. It should be a binary_sensor or an input_boolean. The state of the entity must be ‘on’ when the window is open or ‘off’ when it is closed
- a delay in seconds before any change. This allows a window to be opened quickly without stopping the heating.
Auto mode
In auto mode, the configuration is as follows:
- a detection threshold in degrees per minute. When the temperature drops below this threshold, the thermostat will turn off. The lower this value, the faster the detection will be (in return for a risk of false positives),
- an end of detection threshold in degrees per minute. When the temperature drop goes above this value, the thermostat will go back to the previous mode (mode and preset),
- maximum detection time. Beyond this time, the thermostat will return to its previous mode and preset even if the temperature continues to drop.
To set the thresholds it is advisable to start with the reference values and adjust the detection thresholds. A few tries gave me the following values (for a desktop):
- detection threshold: 0.05°C/min
- non-detection threshold: 0 °C/min
- maximum duration: 60 min.
A new “slope” sensor has been added for all thermostats. It gives the slope of the temperature curve in °C/min (or °K/min). This slope is smoothed and filtered to avoid aberrant values from the thermometers which would interfere with the measurement.
To properly adjust it is advisable to display on the same historical graph the temperature curve and the slope of the curve (the “slope”):
And that’s all ! your thermostat will turn off when the windows are open and turn back on when closed.
Notes
1. If you want to use multiple door/window sensors to automate your thermostat, just create a group with the usual behavior (Group - Home Assistant)
2. If you don’t have a window/door sensor in your room, just leave the sensor entity id blank,
3. Only one mode is allowed. You cannot configure a thermostat with a sensor and automatic detection. The 2 modes may contradict each other, it is not possible to have the 2 modes at the same time,
4. It is not recommended to use the automatic mode for equipment subject to frequent and normal temperature variations (corridors, open areas, …)
Configure the activity mode or motion detection
If you choose the Motion management
feature, lick on ‘Validate’ on the previous page and you will get there:
We will now see how to configure the new Activity mode.
What we need:
- a motion sensor. The entity id of a motion sensor. Motion sensor states should be ‘on’ (motion detected) or ‘off’ (no motion detected)
- a motion delay (in seconds) duration defining how long we wait for motion confirmation before considering the motion
- a target “motion” preset. We will used the temperature of this preset when an activity is detected.
- a target “no motion” preset. We will used the temperature of this second preset when no activity is detected.
… see more on github readme here: GitHub - jmcollin78/versatile_thermostat: A full featured Thermostat for Home Assistant: presets, window, motion, presence and overpowering management