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 ;-).
thermostat_over_switch
type thermostatthermostat_over_climate
:
thermostat_over_valve
:over_switch
or over_valve
over_climate
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.
Latest releases
Release 6.5 :
Added a new function allowing the automatic shutdown and restart of a VTherm
over_climate
585Improved management of openings at startup. Allows to memorize and recalculate the state of an opening when restarting Home Assistant 504
Release 6.0:
Added entities from the Number domain to configure preset temperatures 354
Complete redesign of the configuration menu to remove temperatures and use a menu instead of a configuration tunnel 354
Release 5.4:
- Added temperature step #311,
- addition of regulation thresholds for the
over_valve
to avoid draining the TRV battery too much #338,- added an option allowing the internal temperature of a TRV to be used to force self-regulation #348,
- added a keep-alive function for VTherm
over_switch
#345Others releases
Release 5.3: Added a central boiler control function #234 - more information here: Controlling a central boiler. Added the ability to disable security mode for outdoor thermometer #343
Release 5.2: Added a
central_mode
allowing all VTherms to be controlled centrally #158.Release 5.1: Limitation of the values sent to the valves and the temperature sent to the underlying climate.
Release 5.0: Added a central configuration allowing the sharing of attributes that can be shared #239.
Release 4.3: Added an auto-fan mode for the
over_climate
type allowing ventilation to be activated if the temperature difference is significant #223.Release 4.2: The calculation of the slope of the temperature curve is now done in °/hour and no longer in °/min #242. Correction of automatic detection of openings by adding smoothing of the temperature curve.
Release 4.1: Added an Expert regulation mode in which the user can specify their own auto-regulation parameters instead of using the pre-programmed ones #194.
Release 4.0: Added the support of Versatile Thermostat UI Card. See Versatile Thermostat UI Card. Added a Slow regulation mode for slow latency heating devices #168. Change the way the power is calculated in case of VTherm with multi-underlying equipements #146. Added the support of AC and Heat for VTherm over switch alse #144
Release 3.8: Added a self-regulation function for
over climate
thermostats whose regulation is done by the underlying climate. See Self-regulation and #129. Added the possibility of inverting the command for anover switch
thermostat to address installations with pilot wire and diode #124.Release 3.7: Addition of the Versatile Thermostat type
over valve
to control a TRV valve directly or any other dimmer type equipment for heating. Regulation is then done directly by acting on the opening percentage of the underlying entity: 0 the valve is cut off, 100: the valve is fully opened. See #131. Added a function allowing the bypass of opening detection #138. Added Slovak languageRelease 3.6: Added the
motion_off_delay
parameter to improve motion management #116, #128. Added AC (air conditioning) mode for a VTherm over switch. Preparing the Github project to facilitate contributions #127Release 3.5: Multiple thermostats when using "thermostat over another thermostat" mode #113
Release 3.4: bug fixes and expose preset temperatures for AC mode #103
Release 3.3: add the Air Conditionned mode (AC). This feature allow to use the eventual AC mode of your underlying climate entity. You have to check the "Use AC mode" checkbox in configuration and give preset temperature value for AC mode and AC mode when absent if absence is configured
Release 3.2: add the ability to control multiple switches from the same thermostat. In this mode, the switches are triggered with a delay to minimize the power required at one time (we minimize the recovery periods). See Configuration
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.
Many thanks to @salabur, @pvince83, @bergoglio, @EPicLURcher, @ecolorado66, @Kriss1670, @maia, @f.maymil, @moutte69, @Jerome, @Gunnar M, @Greg.o, @John Burgess, @abyssmal, @capinfo26, @Helge, @MattG, @MattG, @Mexx62, @Someone, @Lajull, @giopeco, @fredericselier, @philpagan, @studiogriffanti, @Edwin, @Sebbou, @Gerard R., @John Burgess, @Sylvoliv, @cdenfert, @stephane.l, @jms92100 for the beers. It's very nice and encourages me to continue!
This thermostat can control 3 types of equipment:
thermostat_over_valve
). At 0 the heating is cut off, 100% it is fully opened. This type allows you to control a thermostatic valve (see Shelly valve) which exposes an entity of type number.
allowing you to directly control the opening of the valve. Versatile Thermostat regulates the room temperature by adjusting the opening percentage, using the interior and exterior temperature sensors using the TPI algorithm described below.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 existing 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. An optional self-regulation function allows the Versatile Thermostat to adjust the temperature given as a setpoint to the underlying in order to reach the setpoint.
Installations with pilot wire and activation diode benefit from an option which allows the on/off control of the underlying radiator to be reversed. To do this, use the over switch
type and check the command inversion option.
Some TRV type thermostats are known to be incompatible with the Versatile Thermostat. This is the case for the following valves:
hvac_action
allowing to know if it is heating or not. So return states are not available. Others features, seems to work normally.This component named Versatile thermostat manage the following use cases :
install
.configuration.yaml
).custom_components
directory (folder) there, you need to create it.custom_components
directory (folder) create a new folder called versatile_thermostat
.custom_components/versatile_thermostat/
directory (folder) in this repository.-- VTherm = Versatile Thermostat in the remainder of this document --
Notes
Three ways to configure VTherms are available:
- Each Versatile Thermostat is completely independently configured. Choose this option if you do not want to have any central configuration or management.
- Some aspects are configured centrally. This allows e.g. define the min/max temperature, open window detection, etc. at the level of a single central instance. For each VTherm you configure, you can then choose to use the central configuration or override it with custom settings.
- In addition to this centralized configuration, all VTherms can be controlled by a single entity of type
select
. This function is namedcentral_mode
. This allows you to stop / start / freeze / etc. all VTherms at once. For each VTherm, the user indicates whether he is affected by thiscentral_mode
.
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 choose the type of VTherm you want to create:
Then choose the “Main attributes” menu.
Give the main mandatory attributes:
thermostat_over_switch
to control a radiator controlled by a switch or thermostat_over_climate
to control another thermostat, or thermostat_over_valve
Cf. [above](# why-a-new-thermostat-implementation)over_climate
mode, the cycle is only used to carry out basic controls but does not directly regulate the temperature. It's the underlying climate that does it,Notes
- With the
thermostat_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,- if the cycle is too short, the heater could never reach the target temperature. For the storage radiator for example it will be used unnecessarily.
Depending on your choice of thermostat type, you will need to choose one or more switch
, climate
or number
type entities. Only entities compatible with the type are presented.
How to choose the type The choice of type is important. Even if it is always possible to modify it afterwards via the configuration HMI, it is preferable to ask yourself the following few questions:
- what type of equipment am I going to pilot? In order, here is what to do:
- if you have a thermostatic valve (TRV) that can be controlled in Home Assistant via a
number
type entity (for example a Shelly TRV), choose theover_valve
type. It is the most direct type and which ensures the best regulation,- if you have an electric radiator (with or without pilot wire) and a
switch
type entity allows you to turn it on or off, then theover_switch
type is preferable. Regulation will be done by the Versatile Thermostat according to the temperature measured by your thermometer, where you have placed it,- in all other cases, use the
over_climate
mode. You keep your originalclimate
entity and the Versatile Thermostat "only" controls the on/off and the target temperature of your original thermostat. Regulation is done by your original thermostat in this case. This mode is particularly suitable for all-in-one reversible air conditioning systems whose exposure in Home Assistant is limited to aclimate
type entity.- what type of regulation do I want? If the controlled equipment has its own regulation mechanism (air conditioning, certain TRV valve) and this regulation works well, opt for an ``over_climate``` It is possible to choose an over switch thermostat which controls air conditioning by checking the "AC Mode" box. In this case, only the cooling mode will be visible.
thermostat_over_switch
type thermostatSome heater switches require regular "keep-alive messages" to prevent them from triggering a failsafe switch off. This feature can be enabled through the switch keep-alive interval configuration field.
The algorithm to use is currently limited to TPI is available. See algorithm. If several type entities are configured, the thermostat shifts the activations in order to minimize the number of switches active at a time t. This allows for better power distribution since each radiator will turn on in turn. Example of synchronized triggering:
It is possible to choose an over switch thermostat which controls air conditioning by checking the "AC Mode" box. In this case, only the cooling mode will be visible.
If your equipment is controlled by a pilot wire with a diode, you will certainly need to check the "Invert Check" box. It allows you to set the switch to On when you need to turn the equipment off and to Off when you need to turn it on.
thermostat_over_climate
:It is possible to choose an over climate thermostat which controls reversible air conditioning by checking the “AC Mode” box. In this case, depending on the equipment ordered, you will have access to heating and/or cooling.
Since release 3.8, you have the possibility to activate the self-regulation function. This function allows VersatileThermostat to adapt the temperature setpoint given to the underlying climate so that the room temperature actually reaches the setpoint. To do this, the VersatileThermostat calculates an offset based on the following information:
These three pieces of information are combined to calculate the offset which will be added to the current setpoint and sent to the underlying climate.
The self-regulation function is configured with:
These three parameters make it possible to modulate the regulation and avoid multiplying the regulation sendings. Some equipment such as TRVs and boilers do not like the temperature setpoint to be changed too often.
Implementation tip
- Do not start self-regulation straight away. Watch how the natural regulation of your equipment works. If you notice that the set temperature is not reached or that it is taking too long to be reached, start the regulation,
- First start with a slight self-regulation and keep both parameters at their default values. Wait a few days and check if the situation has improved,
- If this is not sufficient, switch to Medium self-regulation, wait for stabilization,
- If this is still not sufficient, switch to Strong self-regulation,
- If it is still not good, you will have to switch to expert mode to be able to finely adjust the regulation parameters. See below.
Self-regulation consists of forcing the equipment to go further by forcing its set temperature regularly. Its consumption can therefore be increased, as well as its wear.
Sometimes, a device’s internal temperature sensor (like in a TRV or AC) can give inaccurate readings, especially if it’s too close to a heat source. This can cause the device to stop heating too soon. For example:
The Adjust Setpoint for Room vs. TRV Temperature feature fixes this by adding the temperature difference between the room and the device’s internal reading to the target. In this case, VTherm would adjust the target to 25°C (21°C + 4°C difference), forcing the device to continue heating.
This adjustment is specific to each device, making the heating system more accurate and avoiding issues from faulty sensor readings. See
The self-regulation algorithm can be summarized as follows:
This mode introduced in 4.3 makes it possible to force the use of ventilation if the temperature difference is significant. In fact, by activating ventilation, distribution occurs more quickly, which saves time in reaching the target temperature. You can choose which ventilation you want to activate between the following settings: Low, Medium, High, Turbo.
Obviously your underlying equipment must be equipped with ventilation and be controllable for this to work.
If your equipment does not include Turbo mode, Fortemode will be used as a replacement. Once the temperature difference becomes low again, the ventilation will go into a "normal" mode which depends on your equipment, namely (in order):
Silence (mute),
Auto (auto),
Low (low)`. The first value that is possible for your equipment will be chosen.
This function was introduced in 6.5.0. It allows VTherm to stop equipment that does not need to be turned on and to restart it when conditions require it. This function has 3 settings that allow the equipment to be stopped/restarted more or less quickly.
To use it, you must:
Use the auto start and stop feature
function in the 'Features' menu,Auto start and stop
option that is displayed when the function has been activated. You choose the detection level between 'Slow', 'Medium' and 'Fast'. The 'Fast' level will result in more shutdowns/restarts.Once configured, you will now have a new entity of type switch
that allows you to authorize or not the automatic shutdown/restart without touching the configuration. This entity is available on the VTherm device and is called switch.<name>_enable_auto_start_stop
. Check it to authorize the automatic startup and shutdown.
The detection algorithm is described here.
thermostat_over_valve
:
You can choose up to domain entity number
or ìnput_number
which will control the valves.
The algorithm to use is currently limited to TPI is available. See algorithm.
It is possible to choose an over valve thermostat which controls air conditioning by checking the "AC Mode" box. In this case, only the cooling mode will be visible.
Ff you choose a over_switch
or over_valve
thermostat and select the "TPI" menu option, you will get there:
For more informations on the TPI algorithm and tuned please refer to algorithm.
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 :
Boost : device turn all valve full up
If AC mode is used, you will also be able to configure temperatures when the equipment is in cooling mode.
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.
The pre-settings are made (since v6.0) directly from the VTherm entities or from the central configuration if you use the central configuration.
Notes
- 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.
- standard
Away
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.- if you uses the power shedding management, you will see a hidden preset named
power
. The heater preset is set topower
when overpowering conditions are encountered and shedding is active for this heater. See power management.- if you uses the advanced configuration you will see the preset set to
safety
if the temperature could not be retrieved after a certain delay- 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
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:
In sensor mode, you must fill in the following information:
In auto mode, the configuration is as follows:
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):
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
- If you want to use multiple door/window sensors to automate your thermostat, just create a group with the usual behavior (https://www.home-assistant.io/integrations/binary_sensor.group/)
- If you don't have a window/door sensor in your room, just leave the sensor entity id blank,
- 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,
- It is not recommended to use the automatic mode for equipment subject to frequent and normal temperature variations (corridors, open areas, ...)
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 end of motion delay (in seconds) duration defining how long we wait for end of motion confirmation before considering the end of 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.
we have a room with a thermostat set to activity mode, the "movement" mode chosen is comfort (21.5°C), the "no movement" mode chosen is Eco (18.5°C) and the movement delay is 30 sec during detection and 5 minutes at the end of detection.
the room has been empty for a while (no activity detected), the temperature of this room is 18.5°
someone enters the room, activity is detected if movement is present for at least 30 seconds. The temperature then rises to 21.5°
if the movement is present for less than 30 seconds (rapid passage), the temperature remains at 18.5°,
imagine that the temperature has risen to 21.5°, when the person leaves the room, after 5 minutes the temperature is reduced to 18.5°.
if the person returns before 5 minutes, the temperature remains at 21.5°
For this to work, the climate thermostat should be in Activity
preset mode.
Notes
- Be aware that as for the others preset modes,
Activity
will only be proposed if it's correctly configure. In other words, the 4 configuration keys have to be set if you want to see Activity in home assistant Interface
If you choose the Power management
feature, click on 'Validate' on the previous page and you will get there:
This feature allows you to regulate the power consumption of your radiators. Known as shedding, this feature allows you to limit the electrical power consumption of your heater if overpowering conditions are detected. Give a sensor to the current power consumption of your house, a sensor to the max power that should not be exceeded, the power consumption of your heaters linked to the VTherm (in the first step of the configuration) and the algorithm will not start a radiator if the max power will be exceeded after radiator starts.
Note that all power values should have the same units (kW or W for example). This allows you to change the max power along time using a Scheduler or whatever you like.
Notes
- When shedding is encountered, the heater is set to the preset named
power
. This is a hidden preset, you cannot select it manually.- I use this to avoid exceeded the limit of my electrical power contract when an electrical vehicle is charging. This makes a kind of auto-regulation.
- Always keep a margin, because max power can be briefly exceeded while waiting for the next cycle calculation typically or by not regulated equipement.
- If you don't want to use this feature, just leave the entities id empty
- If you control several heaters, the power consumption of your heater setup should be the sum of the power.
If selected on the first page, this feature allows you to dynamically change the temperature of all configured thermostat presets when no one is home or when someone comes home. To do this, you must configure the temperature that will be used for each preset when presence is disabled. When the presence sensor turns off, these temperatures will be used. When it turns back on, the "normal" temperature configured for the preset is used. See preset management. To configure presence, complete this form:
To do this, you must configure:
If AC mode is used, you will also be able to configure temperatures when the equipment is in cooling mode.
ATTENTION: groups of people do not function as a presence sensor. They are not recognized as a presence sensor. You must use a template as described here Using a group of people as a presence sensor.
Notes
- the change in temperature is immediate and is reflected on the front shutter. The calculation will take into account the new target temperature at the next calculation of the cycle,
- you can use the person.xxxx direct sensor or a group of Home Assistant sensors. The presence sensor manages the
on
orhome
states as present and theoff
ornot_home
states as absent.
Those parameters allows to fine tune the thermostat. The advanced configuration form is the following:
The first delay (minimal_activation_delay_sec) in sec in the minimum delay acceptable for turning on the heater. When calculation gives a power on delay below this value, the heater will stays off.
The second delay (security_delay_min) is the maximal delay between two temperature measure before setting the preset to safety
and turning off the thermostat. If the temperature sensor is no more giving temperature measures, the thermostat and heater will turns off after this delay and the preset of the thermostat will be set to safety
. This is useful to avoid overheating is the battery of your temperature sensor is too low.
The third parameter (security_min_on_percent
) is the minimum value of on_percent
below which the safety preset will not be activated. This parameter makes it possible not to put a thermostat in safety, if the controlled radiator does not heat sufficiently.
Setting this parameter to 0.00
will trigger the safety preset regardless of the last heating setpoint, conversely 1.00
will never trigger the safety preset (which amounts to disabling the function).
The fourth parameter (security_default_on_percent
) is the on_percent
value that will be used when the thermostat enters safety
mode. If you put 0
then the thermostat will be cut off when it goes into safety
mode, putting 0.2% for example allows you to keep a little heating (20% in this case), even in mode safety
. It avoids finding your home totally frozen during a thermometer failure.
Note: parameters security_min_on_percent
et security_default_on_percent
are not used by over_climate
VTherm.
Since version 5.3 it is possible to deactivate the safety device following a lack of data from the outdoor thermometer. Indeed, this most of the time having a low impact on regulation (depending on your settings), it is possible that it is absent without endangering the home. To do this, you must add the following lines to your configuration.yaml
:
versatile_thermostat:
...
safety_mode:
check_outdoor_sensor: false
By default, the outdoor thermometer can trigger a trip if it no longer sends a value.
See example tuning for common tuning examples
Notes
- When the temperature sensor comes to life and returns the temperatures, the preset will be restored to its previous value,
- Attention, two temperatures are needed: internal temperature and external temperature and each must give the temperature, otherwise the thermostat will be in "safety" preset,
- A service is available that allows you to set the 3 safety parameters. This can be used to adapt the safety function to your use.
- For natural usage, the
security_default_on_percent
should be less thansecurity_min_on_percent
,- Thermostat of type
thermostat_over_climate
are not concerned by the safety feature.
Since release 5.2, if you have defined a centralized configuration, you have a new entity named select.central_mode
which allows you to control all VTherms with a single action. For a VTherm to be centrally controllable, its configuration attribute named use_central_mode
must be true.
This entity is presented in the form of a list of choices which contains the following choices:
Auto
: the 'normal' mode in which each VTherm behaves as in previous versions,Stooped
: all VTherms are turned off (hvac_off
),Heat only
: all VTherms are put in heating mode when this mode is supported by the VTherm, otherwise it is stopped,Cool only
: all VTherms are put in cooling mode when this mode is supported by the VTherm, otherwise it is stopped,Frost protection
: all VTherms are put in frost protection preset when this preset is supported by the VTherm, otherwise it is stopped.It is therefore possible to control all VTherms (only those explicitly designated) with a single control. Example rendering:
Since release 5.3, you have the possibility of controlling a centralized boiler. From the moment it is possible to start or stop this boiler from Home Assistant, then Versatile Thermostat will be able to control it directly.
The principle put in place is generally as follows:
binary_sensor
and named by default binary_sensor.central_boiler
is added,binary_sensor.central_boiler
listens for changes in state of VTherm equipment marked as controlling the boiler,hvac_action
goes to Heating
) exceeds a configurable threshold, then the binary_sensor.central_boiler
goes to on
and if a activation service has been configured, then this service is called,binary_sensor.central_boiler
goes to off
and if a deactivation service has been configured, then this service is called,number
named by default number.boiler_activation_threshold
, gives the trigger threshold. This threshold is in number of equipment (radiators) which requires heating.sensor
named by default sensor.nb_device_active_for_boiler
, gives the number of devices requiring heating. For example, a VTherm having 4 valves including 3 heating requests will increase this sensor to 3. Only VTherm equipment that is marked to control the central boiler is counted.You therefore always have the information which allows you to control and adjust the activation of the boiler.
All these entities are attached to the central configuration service:
To configure this function, you must have a centralized configuration (see Configuration) and check the 'Add a central boiler' box:
On the following page you can configure the services to be called when switching the boiler on/off:
The services are configured as indicated on the page:
entity_id/service_id[/attribute:value]
(where /attribute:value
is optional),entity_id
is the name of the entity that controls the boiler in the form domain.entity_name
. For example: switch.boiler
for boilers controlled by a switch or climate.boiler
for a boiler controlled by a thermostat or any other entity which allows control of the boiler (there is no limitation). We can also switch inputs (helpers
) like input_boolean
or input_number
.service_id
is the name of the service to call in the form domain.service_name
. For example: switch.turn_on
, switch.turn_off
, climate.set_temperature
, climate.set_hvac_mode
are valid examples.climate.set_hvac_mode
or the target temperature for climate.set_temperature
. This parameter must be configured in the form attribute:value
at the end of the string.Examples (to be adjusted to your case):
climate.chaudiere/climate.set_hvac_mode/hvac_mode:heat
: to turn on the boiler thermostat in heating mode,climate.chaudiere/climate.set_hvac_mode/hvac_mode:off
: to stop the boiler thermostat,switch.pompe_chaudiere/switch.turn_on
: to turn on the switch which powers the boiler pump,switch.pompe_chaudiere/switch.turn_off
: to turn on the switch which powers the boiler pump,To find the service to use, the best is to go to "Development tools / Services", look for the service called, the entity to order and the possible parameter to give. Click on 'Call Service'. If your boiler lights up you have the correct configuration. Then switch to Yaml mode and copy the parameters.
Example:
Under "Development Tools / Service":
In yaml mode:
The service to configure is then the following: climate.empty_thermostast/climate.set_hvac_mode/hvac_mode:heat
(note the removal of the blank in hvac_mode:heat
)
Then do the same for the extinguishing service and you are all set.
Each time the boiler is successfully switched on or off, an event is sent by Versatile Thermostat. It can advantageously be captured by automation, for example to notify a change. The events look like this:
An ignition event:
event_type: versatile_thermostat_central_boiler_event
data:
central_boiler: true
entity_id: binary_sensor.central_boiler
name: Central boiler
state_attributes: null
origin: LOCAL
time_fired: "2024-01-14T11:33:52.342026+00:00"
context:
id: 01HM3VZRJP3WYYWPNSDAFARW1T
parent_id: null
user_id: null
An extinction event:
event_type: versatile_thermostat_central_boiler_event
data:
central_boiler: false
entity_id: binary_sensor.central_boiler
name: Central boiler
state_attributes: null
origin: LOCAL
time_fired: "2024-01-14T11:43:52.342026+00:00"
context:
id: 01HM3VZRJP3WYYWPNSDAFBRW1T
parent_id: null
user_id: null
Notes Controlling a central boiler using software or hardware such as home automation can pose risks to its proper functioning. Before using these functions, make sure that your boiler has safety functions and that they are working. Turning on a boiler if all the taps are closed can generate excess pressure, for example.
Expert Mode settings refer to Settings made in the Home Assistant configuration.yaml
file under the versatile_thermostat
section. You might have to add this section by yourself to the configuration.yaml
file.
These settings are meant to be used only in specific niche cases and with careful considerations.
The following sections describe the available export mode settings in detail with examples on how to configure them. Be aware that these settings require a complete restart of Home Assistant or a reload of Versatile Thermostat integration (Dev tools / Yaml / reloading the configuration / Versatile Thermostat) to take effect.
In Expert mode you can finely adjust the auto-regulation parameters to achieve your objectives and optimize as best as possible. The algorithm calculates the difference between the setpoint and the actual temperature of the room. This discrepancy is called error. The adjustable parameters are as follows:
kp
: the factor applied to the raw error,ki
: the factor applied to the accumulation of errors,k_ext
: the factor applied to the difference between the interior temperature and the exterior temperature,offset_max
: the maximum correction (offset) that the regulation can apply,stabilization_threshold
: a stabilization threshold which, when reached by the error, resets the accumulation of errors to 0,accumulated_error_threshold
: the maximum for error accumulation.For tuning, these observations must be taken into account:
kp * error
will give the offset linked to the raw error. This offset is directly proportional to the error and will be 0 when the target is reached,ki * accumulated_error_threshold
will give the maximum offset linked to the accumulation of the error,k_ext
allows a correction to be applied immediately (without waiting for errors to accumulate) when the outside temperature is very different from the target temperature. If the stabilization is done too high when the temperature differences are significant, it is because this parameter is too high. It should be possible to cancel completely to let the first 2 offsets take placeThe pre-programmed values are as follows:
Slow régulation :
kp: 0.2 # 20% of the current internal regulation offset are caused by the current difference of target temperature and room temperature
ki: 0.8 / 288.0 # 80% of the current internal regulation offset are caused by the average offset of the past 24 hours
k_ext: 1.0 / 25.0 # this will add 1°C to the offset when it's 25°C colder outdoor than indoor
offset_max: 2.0 # limit to a final offset of -2°C to +2°C
stabilization_threshold: 0.0 # this needs to be disabled as otherwise the long term accumulated error will always be reset when the temp briefly crosses from/to below/above the target
accumulated_error_threshold: 2.0 * 288 # this allows up to 2°C long term offset in both directions
Light régulation :
kp: 0.2
ki: 0.05
k_ext: 0.05
offset_max: 1.5
stabilization_threshold: 0.1
accumulated_error_threshold: 10
Medium régulation :
kp: 0.3
ki: 0.05
k_ext: 0.1
offset_max: 2
stabilization_threshold: 0.1
accumulated_error_threshold: 20
Strong régulation :
"""Strong parameters for regulation
A set of parameters which doesn't take into account the external temp
and concentrate to internal temp error + accumulated error.
This should work for cold external conditions which else generates
high external_offset"""
kp: 0.4
ki: 0.08
k_ext: 0.0
offset_max: 5
stabilization_threshold: 0.1
accumulated_error_threshold: 50
To use Expert mode you must declare the values you want to use for each of these parameters in your configuration.yaml
in the following form:
versatile_thermostat:
auto_regulation_expert:
kp: 0.4
ki: 0.08
k_ext: 0.0
offset_max: 5
stabilization_threshold: 0.1
accumulated_error_threshold: 50
and of course, configure the VTherm's self-regulation mode in Expert mode. All VTherms in Expert mode will use these same settings.
For the changes to be taken into account, you must either completely restart Home Assistant or just the Versatile Thermostat integration (Dev tools / Yaml / reloading the configuration / Versatile Thermostat).
The calculated on time percent can be limited to a maximum percentage of the cycle duration. This setting has to be made in expert mode and will be used for all Versatile Thermostats.
versatile_thermostat:
max_on_percent: 0.8
The example above limits the maximum ON time to 80% (0.8) of the cycle length. If the cycle length is for example 600 seconds (10min), the maximum ON time will be limited to 480 seconds (8min). The remaining 120 seconds of the cycle will always remain in the OFF state.
There are three debug attributes of interest regarding this feature:
max_on_percent
# clamping setting as configured in expert modecalculated_on_percent
# calculated on percent without clamping appliedon_percent
# used on percent with clamping applied safety
preset if the radiator was heating more than 50% of the time)safety
, we keep a heating background 20% of the time)These settings should be understood as follows:
If the thermometer no longer sends the temperature for 1 hour and the heating percentage (
on_percent
) was greater than 50%, then this heating percentage is reduced to 10%.
It's up to you to adapt these settings to your case!
What is important is not to take too many risks with these parameters: suppose you are away for a long period, that the batteries of your thermometer reach the end of their life, your radiator will heat up 10% of the time for the whole the duration of the outage.
Versatile Thermostat allows you to be notified when an event of this type occurs. Set up the alerts that go well as soon as you use this thermostat. See (#notifications)
safety
preset if the radiator was heating more than 70% of the time)safety
, we keep a heating background 25% of the time)This is just an example of how I use the preset. It up to you to adapt to your configuration but it can be useful to understand how it works.
Frost
: 10 °C
Eco
: 17 °C
Comfort
: 19 °C
Boost
: 20 °C
When presence if off:
Frost
: 10 °C
Eco
: 16.5 °C
Comfort
: 17 °C
Boost
: 18 °C
Motion detector in my office is set to use Boost
when motion is detected and Eco
if not.
This integration uses a proportional algorithm. A Proportional algorithm is useful to avoid the oscillation around the target temperature. This algorithm is based on a cycle which alternate heating and stop heating. The proportion of heating vs not heating is determined by the difference between the temperature and the target temperature. Bigger the difference is and bigger is the proportion of heating inside the cycle.
This algorithm make the temperature converge and stop oscillating.
The TPI algorithm consist in the calculation at each cycle of a percentage of On state vs Off state for the heater using the target temperature, the current temperature in the room and the current external temperature. This algorithm is therefore only valid for Versatile Thermostats which regulate: over_switch
and over_valve
.
The percentage is calculated with this formula:
on_percent = coef_int * (target temperature - current temperature) + coef_ext * (target temperature - external temperature)
Then make 0 <= on_percent <= 1
Defaults values for coef_int and coef_ext are respectively: 0.6
and 0.01
. Those defaults values are suitable for a standard well isolated room.
To tune those coefficients keep in mind that:
coef_ext
(the on_percent
is too low),coef_ext
(the on_percent
is too high),coef_int
to give more power to the heater,coef_int
to give less power to the heaterIn type over_valve
the on_percent
is reduced to a value between 0 and 100% and is used directly to control the opening of the valve.
See some situations at examples.
With the thermostat are available sensors that allow you to view the alerts and the internal status of the thermostat. They are available in the entities of the device associated with the thermostat:
In order, there are:
over_valve
type)To color the sensors, add these lines and customize them as needed, in your configuration.yaml:
frontend:
themes:
versatile_thermostat_theme:
state-binary_sensor-safety-on-color: "#FF0B0B"
state-binary_sensor-power-on-color: "#FF0B0B"
state-binary_sensor-window-on-color: "rgb(156, 39, 176)"
state-binary_sensor-motion-on-color: "rgb(156, 39, 176)"
state-binary_sensor-presence-on-color: "lightgreen"
state-binary_sensor-running-on-color: "orange"
and choose the versatile_thermostat_theme
theme in the panel configuration. You will get something that will look like this:
This custom implementation offers some specific services to facilitate integration with others Home Assisstant components.
This service allows you to force the presence status independantly of the presence sensor. This can be useful if you want to manage the presence through a service and not through a sensor. For example, you could use your alarm to force the absence when it is switched on.
The code to call this service is the following:
service: versatile_thermostat.set_presence
data:
presence: "off"
target:
entity_id: climate.my_thermostat
This services is useful if you want to dynamically change the preset temperature. Instead of changing preset, some use-case need to change the temperature of the preset. So you can keep the Scheduler unchanged to manage the preset and adjust the temperature of the preset. If the changed preset is currently selectionned, the modification of the target temperature is immediate and will be taken into account at the next calculation cycle.
You can change the one or the both temperature (when present or when absent) of each preset.
Use the following code the set the temperature of the preset:
service: versatile_thermostat.set_preset_temperature
data:
preset: boost
temperature: 17.8
temperature_away: 15
target:
entity_id: climate.my_thermostat
Or to change the preset of the AC mode, add _ac to the preset name like this:
service: versatile_thermostat.set_preset_temperature
data:
preset: boost_ac
temperature: 25
temperature_away: 30
target:
entity_id: climate.my_thermostat
Notes
- after a restart the preset are resetted to the configured temperature. If you want your change to be permanent you should modify the temperature preset into the confguration of the integration.
This service is used to dynamically modify the safety parameters described here Advanced configuration.
If the thermostat is in safety
mode the new settings are applied immediately.
To change the safety settings use the following code:
service : thermostat_polyvalent.set_security
data:
min_on_percent: "0.5"
default_on_percent: "0.1"
delay_min: 60
target:
entity_id : climate.my_thermostat
This service is used to bypass the window check implemented to stop thermostat when an open window is detected.
When set to true
window event won't have any effect on the thermostat, when set back to false
it will make sure to disable the thermostat if window is still open.
To change the bypass setting use the following code:
service : thermostat_polyvalent.set_window_bypass
data:
window_bypass: true
target:
entity_id : climate.my_thermostat
Significant thermostat events are notified via the message bus. The notified events are as follows:
versatile_thermostat_security_event
: a thermostat enters or exits the safety
presetversatile_thermostat_power_event
: a thermostat enters or exits the power
presetversatile_thermostat_temperature_event
: one or both temperature measurements of a thermostat have not been updated for more than security_delay_min
minutesversatile_thermostat_hvac_mode_event
: the thermostat is on or off. This event is also broadcast when the thermostat starts upversatile_thermostat_preset_event
: a new preset is selected on the thermostat. This event is also broadcast when the thermostat starts upversatile_thermostat_central_boiler_event
: an event indicating a change in the state of the central boiler.If you have followed correctly, when a thermostat goes into safety mode, 3 events are triggered:
versatile_thermostat_temperature_event
to indicate that a thermometer has become unresponsive,versatile_thermostat_preset_event
to indicate the switch to safety
preset,versatile_thermostat_hvac_mode_event
to indicate the possible extinction of the thermostatEach event carries the key values of the event (temperatures, current preset, current power, etc.) as well as the states of the thermostat.
You can very easily capture its events in an automation, for example to notify users.
To tune the algorithm you have access to all context seen and calculted by the thermostat through dedicated attributes. You can see (and use) those attributes in the "Development tools / states" HMI of HA. Enter your thermostat and you will see something like this:
Custom attributes are the following:
Attribute | Meaning |
---|---|
hvac_modes |
The list of modes supported by the thermostat |
min_temp |
The minimal temperature |
max_temp |
The maximal temperature |
preset_modes |
The presets visible for this thermostat. Hidden presets are not showed here |
current_temperature |
The current temperature as reported by the sensor |
temperature |
The target temperature |
hvac_action |
The action currently running by the heater. Can be idle, heating |
preset_mode |
The currently selected preset. Can be one of the 'preset_modes' or a hidden preset like power |
[eco/comfort/boost]_temp |
The temperature configured for the preset xxx |
[eco/comfort/boost]_away_temp |
The temperature configured for the preset xxx when presence is off or not_home |
power_temp |
The temperature used when shedding is detected |
on_percent |
The percentage on calculated by the TPI algorithm |
on_time_sec | The On period in sec. Should be on_percent * cycle_min |
|
off_time_sec | The Off period in sec. Should be (1 - on_percent) * cycle_min |
|
cycle_min |
The calculation cycle in minutes |
function |
The algorithm used for cycle calculation |
tpi_coef_int | The coef_int of the TPI algorithm |
|
tpi_coef_ext | The coef_ext of the TPI algorithm |
|
saved_preset_mode |
The last preset used before automatic switch of the preset |
saved_target_temp |
The last temperature used before automatic switching |
window_state |
The last known state of the window sensor. None if window is not configured |
window_bypass_state |
True if the bypass of the window detection is activated |
motion_state |
The last known state of the motion sensor. None if motion is not configured |
overpowering_state |
The last known state of the overpowering sensor. None if power management is not configured |
presence_state |
The last known state of the presence sensor. None if presence management is not configured |
security_delay_min |
The delay before setting the safety mode when temperature sensor are off |
security_min_on_percent |
The minimal on_percent below which safety preset won't be trigger |
security_default_on_percent | The on_percent used when thermostat is in safety |
|
last_temperature_datetime |
The date and time in ISO8866 format of the last internal temperature reception |
last_ext_temperature_datetime |
The date and time in ISO8866 format of the last external temperature reception |
security_state |
The safety state. true or false |
minimal_activation_delay_sec |
The minimal activation delay in seconds |
last_update_datetime |
The date and time in ISO8866 format of this state |
friendly_name |
The name of the thermostat |
supported_features |
A combination of all features supported by this thermostat. See official climate integration documentation for more informations |
valve_open_percent |
The opening percentage of the valve |
regulated_target_temperature |
The self-regulated target temperature calculated |
is_inversed |
True if the command is inversed (pilot wire with diode) |
is_controlled_by_central_mode |
True if the VTherm can be centrally controlled |
last_central_mode |
The last central mode used (None if the VTherm is not centrally controlled) |
is_used_by_central_boiler |
Indicate if the VTherm can control the central boiler |
auto_start_stop_enable |
Indicate if the VTherm is allowed to do auto start and stop |
auto_start_stop_level |
Give the level of auto start/stop |
hvac_off_reason |
Give the reason of stop of the VTherm. This could be Window, Auto-start/stop or Manual |
Convergence of temperature to target configured by preset:
Cycle of on/off calculated by the integration:
Coef_int too high (oscillations around the target)
Algorithm calculation evolution See the code of this component [below]
Fine tuned thermostat Thank's impuR_Shozz ! We can see stability around the target temperature (consigne) and when at target the on_percent (puissance) is near 0.3 which seems a very good value.
Enjoy !
A special card for the Versatile Thermostat has been developed (based on the Better Thermostat). It is available here Versatile Thermostat UI Card and offers a modern vision of all the VTherm statuses:
In order to enjoy the full power of Versatile Thermostat, I invite you to use it with https://github.com/nielsfaber/scheduler-component Indeed, the scheduler component porpose a management of the climate base on the preset modes. This feature has limited interest with the generic thermostat but it becomes highly powerfull with Awesome thermostat :
Starting here, I assume you have installed Awesome Thermostat and Scheduler Component.
In Scheduler, add a schedule :
Choose "climate" group, choose one (or multiple) entity/ies, select "MAKE SCHEME" and click next : (it is possible to choose "SET PRESET", but I prefer to use "MAKE SCHEME")
Set your mode scheme and save :
In this example I set ECO mode during the night and the day when nobody's at home BOOST in the morning and COMFORT in the evening.
I hope this example helps you, don't hesitate to give me your feedbacks !
The custom:simple-thermostat
here is a great integration which allow some customisation which fits well with this thermostat.
You can have something like that very easily
Example configuration:
type: custom:simple-thermostat
entity: climate.thermostat_sam2
layout:
step: row
label:
temperature: T°
state: Etat
hide:
state: false
control:
hvac:
_name: Mode
preset:
_name: Preset
sensors:
- entity: sensor.total_puissance_radiateur_sam2
icon: mdi:lightning-bolt-outline
header:
toggle:
entity: input_boolean.etat_ouverture_porte_sam
name: Porte sam
You can customize this component using the HACS card-mod component to adjust the alert colors. Example for displaying safety and load shedding alerts in red:
card_mod:
style: |
{% if is_state('binary_sensor.thermostat_chambre_security_state', 'on') %}
ha-card .body .sensor-heading ha-icon[icon="mdi:alert-outline"] {
color: red;
}
{% endif %}
{% if is_state('binary_sensor.thermostat_chambre_overpowering_state', 'on') %}
ha-card .body .sensor-heading ha-icon[icon="mdi:flash"] {
color: red;
}
{% endif %}
You can get curve like presented in some results with kind of Plotly configuration only using the custom attributes of the thermostat described here:
Replace values in [[ ]] by yours.
- type: custom:plotly-graph
entities:
- entity: '[[climate]]'
attribute: temperature
yaxis: y1
name: Consigne
- entity: '[[climate]]'
attribute: current_temperature
yaxis: y1
name: T°
- entity: '[[climate]]'
attribute: ema_temp
yaxis: y1
name: Ema
- entity: '[[climate]]'
attribute: on_percent
yaxis: y2
name: Power percent
fill: tozeroy
fillcolor: rgba(200, 10, 10, 0.3)
line:
color: rgba(200, 10, 10, 0.9)
- entity: '[[slope]]'
name: Slope
fill: tozeroy
yaxis: y9
fillcolor: rgba(100, 100, 100, 0.3)
line:
color: rgba(100, 100, 100, 0.9)
hours_to_show: 4
refresh_interval: 10
height: 800
config:
scrollZoom: true
layout:
margin:
r: 50
legend:
x: 0
'y': 1.2
groupclick: togglegroup
title:
side: top right
yaxis:
visible: true
position: 0
yaxis2:
visible: true
position: 0
fixedrange: true
range:
- 0
- 1
yaxis9:
visible: true
fixedrange: false
range:
- -2
- 2
position: 1
xaxis:
rangeselector:
'y': 1.1
x: 0.7
buttons:
- count: 1
step: hour
- count: 12
step: hour
- count: 1
step: day
- count: 7
step: day
Example of graph obtained with Plotly :
This automation uses the excellent App Daemon named NOTIFIER developed by Horizon Domotique that you will find in demonstration here and the code is here. It allows you to notify the users of the accommodation when one of the events affecting safety occurs on one of the Versatile Thermostats.
This is a great example of using the notifications described here notification.
alias: Surveillance Mode Sécurité chauffage
description: Envoi une notification si un thermostat passe en mode sécurité ou power
trigger:
- platform: event
event_type: versatile_thermostat_security_event
id: versatile_thermostat_security_event
- platform: event
event_type: versatile_thermostat_power_event
id: versatile_thermostat_power_event
- platform: event
event_type: versatile_thermostat_temperature_event
id: versatile_thermostat_temperature_event
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: versatile_thermostat_security_event
sequence:
- event: NOTIFIER
event_data:
action: send_to_jmc
title: >-
Radiateur {{ trigger.event.data.name }} - {{
trigger.event.data.type }} Sécurité
message: >-
Le radiateur {{ trigger.event.data.name }} est passé en {{
trigger.event.data.type }} sécurité car le thermomètre ne répond
plus.\n{{ trigger.event.data }}
callback:
- title: Stopper chauffage
event: stopper_chauffage
image_url: /media/local/alerte-securite.jpg
click_url: /lovelace-chauffage/4
icon: mdi:radiator-off
tag: radiateur_security_alerte
persistent: true
- conditions:
- condition: trigger
id: versatile_thermostat_power_event
sequence:
- event: NOTIFIER
event_data:
action: send_to_jmc
title: >-
Radiateur {{ trigger.event.data.name }} - {{
trigger.event.data.type }} Délestage
message: >-
Le radiateur {{ trigger.event.data.name }} est passé en {{
trigger.event.data.type }} délestage car la puissance max est
dépassée.\n{{ trigger.event.data }}
callback:
- title: Stopper chauffage
event: stopper_chauffage
image_url: /media/local/alerte-delestage.jpg
click_url: /lovelace-chauffage/4
icon: mdi:radiator-off
tag: radiateur_power_alerte
persistent: true
- conditions:
- condition: trigger
id: versatile_thermostat_temperature_event
sequence:
- event: NOTIFIER
event_data:
action: send_to_jmc
title: >-
Le thermomètre du radiateur {{ trigger.event.data.name }} ne
répond plus
message: >-
Le thermomètre du radiateur {{ trigger.event.data.name }} ne
répond plus depuis longtemps.\n{{ trigger.event.data }}
image_url: /media/local/thermometre-alerte.jpg
click_url: /lovelace-chauffage/4
icon: mdi:radiator-disabled
tag: radiateur_thermometre_alerte
persistent: true
mode: queued
max: 30
If you want to contribute to this please read the Contribution guidelines