Compare commits

..

4 Commits

Author SHA1 Message Date
Jean-Marc Collin
ee3b803db1 Release number 2025-01-05 17:11:30 +00:00
Jean-Marc Collin
22b2b965c1 Issue_766-enhance_power_management (#778)
* First implem + tests (not finished)

* With tests of calculate_shedding ok

* Commit for rebase

* All tests ok for central_feature_power_manager

* All tests not ok

* All tests ok

* integrattion tests - Do startup works

* enhance the overpowering algo if current_power > max_power

* Change shedding calculation delay to 20 sec (vs 60 sec)

* Integration tests ok

* Fix overpowering is set even if other heater have on_percent = 0

* Fix too much shedding in over_climate

* Add logs

* Add temporal filter for calculate_shedding
Add restore overpowering state at startup

* Fix restore overpowering_state

* Removes poweer_entity_id from vtherm non central config

* Release

* Add Sonoff TRVZB in creation.md

* Add comment on Sonoff TRVZB Closing degree

---------

Co-authored-by: Jean-Marc Collin <jean-marc.collin-extern@renault.com>
2025-01-05 18:10:18 +01:00
Jean-Marc Collin
9c8a965dba Update creation.md 2025-01-05 15:32:01 +01:00
zepala
68e05bef31 Change percent_open calculation method (#772)
* Change percent_open calculation method

Modified 'percent_open' calculation method :

  - Before : If < min_opening_degree then =min_opening_degree
  - Now : Each % step is calculated (100 - min_opening_degree)/100

* Code aesthetics

* Code aesthetics

* Updated test_overclimate_valve.py
2025-01-04 08:33:04 +01:00
26 changed files with 156 additions and 3492 deletions

View File

@@ -39,27 +39,28 @@ Un grand merci à tous mes fournisseurs de bières pour leurs dons et leurs enco
La documentation est maintenant découpée en plusieurs pages pour faciliter la lecture et la recherche d'informations : La documentation est maintenant découpée en plusieurs pages pour faciliter la lecture et la recherche d'informations :
1. [présentation](documentation/fr/presentation.md), 1. [présentation](documentation/fr/presentation.md),
2. [choisir un type de VTherm](documentation/fr/creation.md), 2. [Installation](documentation/fr/installation.md),
3. [les attributs de base](documentation/fr/base-attributes.md) 3. [choisir un type de VTherm](documentation/fr/creation.md),
3. [configurer un VTherm sur un `switch`](documentation/fr/over-switch.md) 4. [les attributs de base](documentation/fr/base-attributes.md)
3. [configurer un VTherm sur un `climate`](documentation/fr/over-climate.md) 5. [configurer un VTherm sur un `switch`](documentation/fr/over-switch.md)
3. [configurer un VTherm sur une vanne](documentation/fr/over-valve.md) 6. [configurer un VTherm sur un `climate`](documentation/fr/over-climate.md)
4. [les pré-régages (preset)](documentation/fr/feature-presets.md) 7. [configurer un VTherm sur une vanne](documentation/fr/over-valve.md)
5. [la gestion des ouvertures](documentation/fr/feature-window.md) 8. [les pré-régages (preset)](documentation/fr/feature-presets.md)
6. [la gestion de la présence](documentation/fr/feature-presence.md) 9. [la gestion des ouvertures](documentation/fr/feature-window.md)
7. [la gestion de mouvement](documentation/fr/feature-motion.md) 10. [la gestion de la présence](documentation/fr/feature-presence.md)
8. [la gestion de la puissance](documentation/fr/feature-power.md) 11. [la gestion de mouvement](documentation/fr/feature-motion.md)
9. [l'auto start and stop](documentation/fr/feature-auto-start-stop.md) 12. [la gestion de la puissance](documentation/fr/feature-power.md)
10. [la contrôle centralisé de tous vos VTherms](documentation/fr/feature-central-mode.md) 13. [l'auto start and stop](documentation/fr/feature-auto-start-stop.md)
11. [la commande du chauffage central](documentation/fr/feature-central-boiler.md) 14. [la contrôle centralisé de tous vos VTherms](documentation/fr/feature-central-mode.md)
12. [aspects avancés, mode sécurité](documentation/fr/feature-advanced.md) 15. [la commande du chauffage central](documentation/fr/feature-central-boiler.md)
12. [l'auto-régulation](documentation/fr/self-regulation.md) 16. [aspects avancés, mode sécurité](documentation/fr/feature-advanced.md)
13. [exemples de réglages](documentation/fr/tuning-examples.md) 17. [l'auto-régulation](documentation/fr/self-regulation.md)
14. [les différents algorithmes](documentation/fr/algorithms.md) 18. [exemples de réglages](documentation/fr/tuning-examples.md)
15. [documentation de référence](documentation/fr/reference.md) 19. [les différents algorithmes](documentation/fr/algorithms.md)
16. [exemple de réglages](documentation/fr/tuning-examples.md) 20. [documentation de référence](documentation/fr/reference.md)
17. [dépannage](documentation/fr/troubleshooting.md) 21. [exemple de réglages](documentation/fr/tuning-examples.md)
18. [notes de version](documentation/fr/releases.md) 22. [dépannage](documentation/fr/troubleshooting.md)
23. [notes de version](documentation/fr/releases.md)
# Quelques résultats # Quelques résultats

View File

@@ -90,11 +90,10 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
CONF_USE_MOTION_FEATURE, False CONF_USE_MOTION_FEATURE, False
) and (self._infos.get(CONF_MOTION_SENSOR) is not None or is_central_config) ) and (self._infos.get(CONF_MOTION_SENSOR) is not None or is_central_config)
self._infos[CONF_USE_POWER_FEATURE] = self._infos.get( self._infos[CONF_USE_POWER_FEATURE] = (
CONF_USE_POWER_CENTRAL_CONFIG, False self._infos.get(CONF_USE_POWER_CENTRAL_CONFIG, False)
) or ( or self._infos.get(CONF_USE_POWER_FEATURE, False)
self._infos.get(CONF_POWER_SENSOR) is not None or (is_central_config and self._infos.get(CONF_POWER_SENSOR) is not None and self._infos.get(CONF_MAX_POWER_SENSOR) is not None)
and self._infos.get(CONF_MAX_POWER_SENSOR) is not None
) )
self._infos[CONF_USE_PRESENCE_FEATURE] = ( self._infos[CONF_USE_PRESENCE_FEATURE] = (
self._infos.get(CONF_USE_PRESENCE_CENTRAL_CONFIG, False) self._infos.get(CONF_USE_PRESENCE_CENTRAL_CONFIG, False)
@@ -184,7 +183,7 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
Data has the keys from STEP_*_DATA_SCHEMA with values provided by the user. Data has the keys from STEP_*_DATA_SCHEMA with values provided by the user.
""" """
# check the heater_entity_id # check the entity_ids
for conf in [ for conf in [
CONF_UNDERLYING_LIST, CONF_UNDERLYING_LIST,
CONF_TEMP_SENSOR, CONF_TEMP_SENSOR,
@@ -330,14 +329,7 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
): ):
return False return False
if ( if infos.get(CONF_USE_POWER_FEATURE, False) is True and infos.get(CONF_USE_POWER_CENTRAL_CONFIG, False) is False and infos.get(CONF_PRESET_POWER, None) is None:
infos.get(CONF_USE_POWER_FEATURE, False) is True
and infos.get(CONF_USE_POWER_CENTRAL_CONFIG, False) is False
and (
infos.get(CONF_POWER_SENSOR, None) is None
or infos.get(CONF_MAX_POWER_SENSOR, None) is None
)
):
return False return False
if ( if (
@@ -815,7 +807,7 @@ class VersatileThermostatBaseConfigFlow(FlowHandler):
"""Handle the specific power flow steps""" """Handle the specific power flow steps"""
_LOGGER.debug("Into ConfigFlow.async_step_spec_power user_input=%s", user_input) _LOGGER.debug("Into ConfigFlow.async_step_spec_power user_input=%s", user_input)
schema = STEP_CENTRAL_POWER_DATA_SCHEMA schema = STEP_NON_CENTRAL_POWER_DATA_SCHEMA
self._infos[COMES_FROM] = "async_step_spec_power" self._infos[COMES_FROM] = "async_step_spec_power"

View File

@@ -14,6 +14,6 @@
"quality_scale": "silver", "quality_scale": "silver",
"requirements": [], "requirements": [],
"ssdp": [], "ssdp": [],
"version": "7.0.0", "version": "7.1.0",
"zeroconf": [] "zeroconf": []
} }

View File

@@ -1086,10 +1086,17 @@ class UnderlyingValveRegulation(UnderlyingValve):
) )
return return
# Send opening_degree # Caclulate percent_open
if 0 < self._percent_open < self._min_opening_degree: if self._percent_open >= 1:
self._percent_open = self._min_opening_degree self._percent_open = round(
self._min_opening_degree
+ (self._percent_open
* (100 - self._min_opening_degree) / 100)
)
else:
self._percent_open = 0
# Send opening_degree
await super().send_percent_open() await super().send_percent_open()
# Send closing_degree if set # Send closing_degree if set

View File

@@ -49,7 +49,7 @@ When your device is controlled by a `climate` entity in Home Assistant and you o
This type also includes advanced self-regulation features to adjust the setpoint sent to the underlying device, helping to achieve the target temperature faster and mitigating poor internal regulation. For example, if the device's internal thermometer is too close to the heating element, it may incorrectly assume the room is warm while the setpoint is far from being achieved in other areas. This type also includes advanced self-regulation features to adjust the setpoint sent to the underlying device, helping to achieve the target temperature faster and mitigating poor internal regulation. For example, if the device's internal thermometer is too close to the heating element, it may incorrectly assume the room is warm while the setpoint is far from being achieved in other areas.
Since version 6.8, this VTherm type can also regulate directly by controlling the valve. Ideal for controllable TRVs, this type is recommended if you have such devices. Since version 6.8, this VTherm type can also regulate directly by controlling the valve. Ideal for controllable TRVs, as Sonoff TRVZB, this type is recommended if you have such devices.
The underlying entities for this VTherm type are exclusively `climate`. The underlying entities for this VTherm type are exclusively `climate`.

View File

@@ -1,46 +1,50 @@
# Power Management - Load Shedding # Power Management - Load Shedding
- [Power Management - Load Shedding](#power-management---load-shedding) - [Power Management - Load Shedding](#power-management---load-shedding)
- [Configure Power Management](#configure-power-management) - [Example Use Case:](#example-use-case)
- [Configuring Power Management](#configuring-power-management)
This feature allows you to regulate the electricity consumption of your heaters. Known as load shedding, this feature enables you to limit the electrical consumption of your heating device if overcapacity conditions are detected. This feature allows you to regulate the electrical consumption of your heaters. Known as load shedding, it lets you limit the electrical consumption of your heating equipment if overconsumption conditions are detected.
You will need a **sensor for the total instantaneous power consumption** of your home, as well as a **sensor for the maximum allowed power**. You will need a **sensor for the total instantaneous power consumption** of your home and a **sensor for the maximum allowed power**.
The behavior of this feature is basic: The behavior of this feature is as follows:
1. when the _VTherm_ is about to turn on a device, 1. When a new measurement of the home's power consumption or the maximum allowed power is received,
2. it compares the last known value of the power consumption sensor with the last value of the maximum allowed power. If there is a remaining margin greater than or equal to the declared power of the _VTherm_'s devices, then the _VTherm_ and its devices will be turned on. Otherwise, they will remain off until the next cycle. 2. If the maximum power is exceeded, the central command will shed the load of all active devices starting with those closest to the setpoint. This continues until enough _VTherms_ are shed,
3. If there is available power reserve and some _VTherms_ are shed, the central command will re-enable as many devices as possible, starting with those furthest from the setpoint (at the time they were shed).
WARNING: This very basic operation **is not a safety function** but more of an optimization feature to manage consumption at the cost of heating performance. Overloads may occur depending on the frequency of updates from your consumption sensors, and the actual power used by your devices. Therefore, you must always maintain a safety margin. **WARNING:** This is **not a safety feature** but an optimization function to manage consumption at the expense of some heating degradation. Overconsumption is still possible depending on the frequency of your consumption sensor updates and the actual power used by your equipment. Always maintain a safety margin.
Typical use case: ### Example Use Case:
1. you have an electricity meter limited to 11 kW, 1. You have an electric meter limited to 11 kW,
2. you occasionally charge an electric vehicle at 5 kW, 2. You occasionally charge an electric vehicle at 5 kW,
3. that leaves 6 kW for everything else, including heating, 3. This leaves 6 kW for everything else, including heating,
4. you have 1 kW of other equipment running, 4. You have 1 kW of other active devices,
5. you have declared a sensor (`input_number`) for the maximum allowed power at 9 kW (= 11 kW - the reserve for other devices - margin) 5. You declare a sensor (`input_number`) for the maximum allowed power at 9 kW (= 11 kW - reserved power for other devices - safety margin).
If the vehicle is charging, the total power consumed is 6 kW (5+1), and a _VTherm_ will only turn on if its declared power is 3 kW max (9 kW - 6 kW). If the vehicle is charging, the total consumed power is 6 kW (5 + 1), and a _VTherm_ will only turn on if its declared power is a maximum of 3 kW (9 kW - 6 kW).
If the vehicle is charging and another _VTherm_ of 2 kW is running, the total power consumed is 8 kW (5+1+2), and a _VTherm_ will only turn on if its declared power is 1 kW max (9 kW - 8 kW). Otherwise, it will wait until the next cycle. If the vehicle is charging and another _VTherm_ of 2 kW is on, the total consumed power is 8 kW (5 + 1 + 2), and a _VTherm_ will only turn on if its declared power is a maximum of 1 kW (9 kW - 8 kW). Otherwise, it will skip its turn (cycle).
If the vehicle is not charging, the total consumed power is 1 kW, and a _VTherm_ will only turn on if its declared power is a maximum of 8 kW (9 kW - 1 kW).
If the vehicle is not charging, the total power consumed is 1 kW, and a _VTherm_ will only turn on if its declared power is 8 kW max (9 kW - 1 kW). ## Configuring Power Management
## Configure Power Management In the centralized configuration, if you have selected the `With power detection` feature, configure it as follows:
If you have chosen the `With power detection` feature, configure it as follows:
![image](images/config-power.png) ![image](images/config-power.png)
1. the entity ID of the **instantaneous power consumption sensor** for your home, 1. The entity ID of the **sensor for total instantaneous power consumption** of your home,
2. the entity ID of the **maximum allowed power sensor**, 2. The entity ID of the **sensor for maximum allowed power**,
3. the temperature to apply if load shedding is activated. 3. The temperature to apply if load shedding is activated.
Note that all power values must have the same units (kW or W, for example). Ensure that all power values use the same units (e.g., kW or W).
Having a **maximum allowed power sensor** allows you to adjust the maximum power over time using a scheduler or automation. Having a **sensor for maximum allowed power** allows you to modify the maximum power dynamically using a scheduler or automation.
Note that due to centralized load-shedding, it is not possible to override the consumption and maximum consumption sensors on individual _VTherms_. This configuration must be done in the centralized settings. See [Centralized Configuration](./creation.md#centralized-configuration).
> ![Tip](images/tips.png) _*Notes*_ > ![Tip](images/tips.png) _*Notes*_
> >
> 1. In case of load shedding, the radiator is set to the preset named `power`. This is a hidden preset, and you cannot select it manually. > 1. During load shedding, the heater is set to the preset named `power`. This is a hidden preset that cannot be manually selected.
> 2. Always keep a margin, as the maximum power may briefly be exceeded while waiting for the next cycle calculation, or due to unregulated equipment. > 2. Always maintain a margin, as the maximum power can briefly be exceeded while waiting for the next cycle's calculation or due to uncontrolled devices.
> 3. If you don't want to use this feature, uncheck it in the 'Functions' menu. > 3. If you do not wish to use this feature, uncheck it in the 'Features' menu.
> 4. If a _VTherm_ controls multiple devices, the **electrical consumption of your heating** must match the sum of the powers. > 4. If a single _VTherm_ controls multiple devices, the **declared heating power consumption** should correspond to the total power of all devices.
> 5. If you are using the Versatile Thermostat UI card (see [here](additions.md#much-better-with-the-versatile-thermostat-ui-card)), load shedding is represented as follows: ![load shedding](images/power-exceeded-icon.png). > 5. If you use the Versatile Thermostat UI card (see [here](additions.md#better-with-the-versatile-thermostat-ui-card)), load shedding is represented as follows: ![load shedding](images/power-exceeded-icon.png).
> 6. There may be a delay of up to 20 seconds between receiving a new value from the power consumption sensor and triggering load shedding for _VTherms_. This delay prevents overloading Home Assistant if your consumption updates are very frequent.

View File

@@ -5,7 +5,7 @@
## Configure Pre-configured Temperatures ## Configure Pre-configured Temperatures
The preset mode allows you to pre-configure the target temperature. Used in conjunction with Scheduler (see [scheduler](additions#the-scheduler-component)), you'll have a powerful and simple way to optimize the temperature relative to the electricity consumption in your home. The managed presets are as follows: The preset mode allows you to pre-configure the target temperature. Used in conjunction with Scheduler (see [scheduler](additions.md#the-scheduler-component)), you'll have a powerful and simple way to optimize the temperature relative to the electricity consumption in your home. The managed presets are as follows:
- **Eco**: the device is in energy-saving mode - **Eco**: the device is in energy-saving mode
- **Comfort**: the device is in comfort mode - **Comfort**: the device is in comfort mode
- **Boost**: the device fully opens all valves - **Boost**: the device fully opens all valves

File diff suppressed because it is too large Load Diff

View File

@@ -2,6 +2,9 @@
![New](images/new-icon.png) ![New](images/new-icon.png)
> * **Release 7.1**:
> - Redesign of the load-shedding function (power management). Load-shedding is now handled centrally (previously, each _VTherm_ was autonomous). This allows for much more efficient management and prioritization of load-shedding on devices that are close to the setpoint. Note that you must have a centralized configuration with power management enabled for this to work. More info [here](./feature-power.md).
> * **Release 6.8**: > * **Release 6.8**:
> - Added a new regulation method for `over_climate` type Versatile Thermostats. This method, called 'Direct Valve Control', allows direct control of a TRV valve and possibly an offset to calibrate the internal thermometer of your TRV. This new method has been tested with Sonoff TRVZB and extended to other TRV types where the valve can be directly controlled via `number` entities. More information [here](over-climate.md#lauto-régulation) and [here](self-regulation.md#auto-régulation-par-contrôle-direct-de-la-vanne). > - Added a new regulation method for `over_climate` type Versatile Thermostats. This method, called 'Direct Valve Control', allows direct control of a TRV valve and possibly an offset to calibrate the internal thermometer of your TRV. This new method has been tested with Sonoff TRVZB and extended to other TRV types where the valve can be directly controlled via `number` entities. More information [here](over-climate.md#lauto-régulation) and [here](self-regulation.md#auto-régulation-par-contrôle-direct-de-la-vanne).

View File

@@ -38,6 +38,8 @@ The opening rate calculation algorithm is based on the _TPI_ algorithm described
If a valve closure rate entity is configured, it will be set to 100 minus the opening rate to force the valve into a particular state. If a valve closure rate entity is configured, it will be set to 100 minus the opening rate to force the valve into a particular state.
Note: for Sonoff TRVZB you should not configure the "closing degree" parameter. This leads to a bug in the TRV and the `hvac_action` is no more working.
### Other self-regulation ### Other self-regulation
In the second case, Versatile Thermostat calculates an offset based on the following information: In the second case, Versatile Thermostat calculates an offset based on the following information:

View File

@@ -50,7 +50,7 @@ Les entités sous-jacentes sont donc des `switchs` ou des `input_boolean`.
Lorsque votre équipement est contrôlé par une entité de type `climate` dans Home Assistant et que vous n'avez que ça à disposition, vous devez utiliser ce type de VTherm. Dans ce cas, le VTherm va simplement commander la température de consigne du `climate` sous-jacent. Lorsque votre équipement est contrôlé par une entité de type `climate` dans Home Assistant et que vous n'avez que ça à disposition, vous devez utiliser ce type de VTherm. Dans ce cas, le VTherm va simplement commander la température de consigne du `climate` sous-jacent.
Ce type est aussi équipé de fonction d' auto-régulations avancées permettant de moduler la consigne donnée aux sous-jacent pour atteindre plus vite la consigne et de s'affranchir de la régulation interne de ces équipements qui est parfois mauvaise. C'est le cas, si le thermomètre interne de l'équipement est trop proche du corps de chauffe. L'équipement peut croire qu'il fait chaud alors qu'au bout de la pièce, la consigne n'est pas du tout atteinte. Ce type est aussi équipé de fonction d' auto-régulations avancées permettant de moduler la consigne donnée aux sous-jacent pour atteindre plus vite la consigne et de s'affranchir de la régulation interne de ces équipements qui est parfois mauvaise. C'est le cas, si le thermomètre interne de l'équipement est trop proche du corps de chauffe. L'équipement peut croire qu'il fait chaud alors qu'au bout de la pièce, la consigne n'est pas du tout atteinte.
Depuis la version 6.8, ce type de VTherm permet aussi de réguler avec une action directe sur la vanne. Idéal pour les _TRV_ pour lesquels la vanne est commandable, ce type est recommandé si vous êtes équipés. Depuis la version 6.8, ce type de VTherm permet aussi de réguler avec une action directe sur la vanne. Idéal pour les _TRV_ pour lesquels la vanne est commandable, comme les Sonoff TRVZB, ce type est recommandé si vous êtes équipés.
Les entités sous-jacentes de ce type de VTherm sont donc des `climate` exclusivement. Les entités sous-jacentes de ce type de VTherm sont donc des `climate` exclusivement.

View File

@@ -6,11 +6,12 @@
Cette fonction vous permet de réguler la consommation électrique de vos radiateurs. Connue sous le nom de délestage, cette fonction vous permet de limiter la consommation électrique de votre appareil de chauffage si des conditions de surpuissance sont détectées. Cette fonction vous permet de réguler la consommation électrique de vos radiateurs. Connue sous le nom de délestage, cette fonction vous permet de limiter la consommation électrique de votre appareil de chauffage si des conditions de surpuissance sont détectées.
Vous aurez besoin d'un **capteur de la puissance totale instantanée consommée** de votre logement ainsi que d'un **capteur donnant la puissance maximale autorisée**. Vous aurez besoin d'un **capteur de la puissance totale instantanée consommée** de votre logement ainsi que d'un **capteur donnant la puissance maximale autorisée**.
Le comportement de cette fonction est basique : Le comportement de cette fonction est le suivant :
1. lorsque le _VTherm_ va allumer un équipement, 1. lorsqu'une nouvelle mesure de la puissance consommée du logement ou de la puissance maximale autorisée est reçue,
2. il compare la dernière valeur connue du capteur de puissance consommée avec la dernière valeur de la puissance maximale autorisée. Si il reste une marge supérieure égale à la puissance déclarée des équipements du _VTherm_ alors le VTherm et ses équipements seront allumés. Sinon ils resteront éteints jusqu'au prochain cycle. 2. si la puissance max est dépassée, la commande centrale va mettre en délestage tous les équipements actifs en commençant par ceux qui sont le plus près de la consigne. Il fait ça jusqu'à ce que suffisament de _VTherm_ soient délestés,
3. si une réserve de puissance est disponible et que des _VTherms_ sont délestés, alors la commande centrale va délester autant d'équipements que possible en commençant par les plus loin de la consigne (au moment où il a été mis en délestage),
ATTENTION: ce fonctionnement très basique **n'est pas une fonction de sécurité** mais plus une fonction permettant une optimisation de la consommation au prix d'une dégradation du chauffage. Des dépassements sont possibles selon la fréquence de remontée de vos capteurs de consommation, la puissance réellement utilisée par votre équipements. Vous devez donc toujours garder une marge de sécurité. ATTENTION: ce fonctionnement **n'est pas une fonction de sécurité** mais plus une fonction permettant une optimisation de la consommation au prix d'une dégradation du chauffage. Des dépassements sont possibles selon la fréquence de remontée de vos capteurs de consommation, la puissance réellement utilisée par votre équipements. Vous devez donc toujours garder une marge de sécurité.
Cas d'usage type: Cas d'usage type:
1. vous avez un compteur électrique limité à 11 kW, 1. vous avez un compteur électrique limité à 11 kW,
@@ -26,7 +27,7 @@ Si le vehicle n'est pas en charge, la puissance totale consommé est de 1 kW, un
## Configurer la gestion de la puissance ## Configurer la gestion de la puissance
Si vous avez choisi la fonctionnalité `Avec détection de la puissance`, vous la configurez de la façon suivante : Dans la configuration centralisée, si vous avez choisi la fonctionnalité `Avec détection de la puissance`, vous la configurez de la façon suivante :
![image](images/config-power.png) ![image](images/config-power.png)
@@ -37,10 +38,13 @@ Si vous avez choisi la fonctionnalité `Avec détection de la puissance`, vous l
Notez que toutes les valeurs de puissance doivent avoir les mêmes unités (kW ou W par exemple). Notez que toutes les valeurs de puissance doivent avoir les mêmes unités (kW ou W par exemple).
Le fait d'avoir un **capteur de puissance maximale autorisée**, vous permet de modifier la puissance maximale au fil du temps à l'aide d'un planificateur ou d'une automatisation. Le fait d'avoir un **capteur de puissance maximale autorisée**, vous permet de modifier la puissance maximale au fil du temps à l'aide d'un planificateur ou d'une automatisation.
A noter, dû à la centralisation du délestage, il n'est pas possible de sur-charger les capteurs de consommation et de consommation maximale sur les _VTherms_. Cette configuration se fait forcément dans la configuration centralisée. Cf. [Configuration centralisée](./creation.md#configuration-centralisée)
> ![Astuce](images/tips.png) _*Notes*_ > ![Astuce](images/tips.png) _*Notes*_
> >
> 1. En cas de délestage, le radiateur est réglé sur le préréglage nommé `power`. Il s'agit d'un préréglage caché, vous ne pouvez pas le sélectionner manuellement. > 1. En cas de délestage, le radiateur est réglé sur le préréglage nommé `power`. Il s'agit d'un préréglage caché, vous ne pouvez pas le sélectionner manuellement.
> 2. Gardez toujours une marge, car la puissance max peut être brièvement dépassée en attendant le calcul du prochain cycle typiquement ou par des équipements non régulés. > 2. Gardez toujours une marge, car la puissance max peut être brièvement dépassée en attendant le calcul du prochain cycle typiquement ou par des équipements non régulés.
> 3. Si vous ne souhaitez pas utiliser cette fonctionnalité, décochez la dans le menu 'Fonctions'. > 3. Si vous ne souhaitez pas utiliser cette fonctionnalité, décochez la dans le menu 'Fonctions'.
> 4. Si une _VTherm_ controlez plusieurs équipements, la **consommation électrique de votre chauffage** renseigné doit correspondre à la somme des puissances. > 4. Si une _VTherm_ controlez plusieurs équipements, la **consommation électrique de votre chauffage** renseigné doit correspondre à la somme des puissances.
> 5. Si vous utilisez la carte Verstatile Thermostat UI (cf. [ici](additions.md#bien-mieux-avec-le-versatile-thermostat-ui-card)), le délestage est représenté comme suit : ![délestage](images/power-exceeded-icon.png). > 5. Si vous utilisez la carte Verstatile Thermostat UI (cf. [ici](additions.md#bien-mieux-avec-le-versatile-thermostat-ui-card)), le délestage est représenté comme suit : ![délestage](images/power-exceeded-icon.png),
> 6. Un délai pouvant aller jusqu'à 20 sec est possible entre la réception d'une nouvelle valeur du capteur de puissance consommée et la mise en délestage de _VTherm_. Ce délai évite de trop solliciter Home Assistant si vous avez des remontées rapides de votre puissance consommée.

View File

@@ -6,7 +6,7 @@
## Configurer les températures préréglées ## Configurer les températures préréglées
Le mode préréglé (preset) vous permet de préconfigurer la température ciblée. Utilisé en conjonction avec Scheduler (voir [scheduler](additions#composant-scheduler-)) vous aurez un moyen puissant et simple d'optimiser la température par rapport à la consommation électrique de votre maison. Les préréglages gérés sont les suivants : Le mode préréglé (preset) vous permet de préconfigurer la température ciblée. Utilisé en conjonction avec Scheduler (voir [scheduler](additions.md#composant-scheduler-)) vous aurez un moyen puissant et simple d'optimiser la température par rapport à la consommation électrique de votre maison. Les préréglages gérés sont les suivants :
- **Eco** : l'appareil est en mode d'économie d'énergie - **Eco** : l'appareil est en mode d'économie d'énergie
- **Confort** : l'appareil est en mode confort - **Confort** : l'appareil est en mode confort
- **Boost** : l'appareil tourne toutes les vannes à fond - **Boost** : l'appareil tourne toutes les vannes à fond

File diff suppressed because it is too large Load Diff

View File

@@ -18,7 +18,7 @@ Ce composant nommé __Versatile thermostat__ gère les cas d'utilisation suivant
- Configuration via l'interface graphique d'intégration standard (à l'aide du flux Config Entry), - Configuration via l'interface graphique d'intégration standard (à l'aide du flux Config Entry),
- Utilisations complètes du **mode préréglages**, - Utilisations complètes du **mode préréglages**,
- Désactiver le mode préréglé lorsque la température est **définie manuellement** sur un thermostat, - Désactiver le mode préréglé lorsque la température est **définie manuellement** sur un thermostat,
- Éteindre/allumer un thermostat ou chager de preset lorsqu'une **porte ou des fenêtres sont ouvertes/fermées** après un certain délai, - Éteindre/allumer un thermostat ou changer de preset lorsqu'une **porte ou des fenêtres sont ouvertes/fermées** après un certain délai,
- Changer de preset lorsqu'une **activité est détectée** ou non dans une pièce pendant un temps défini, - Changer de preset lorsqu'une **activité est détectée** ou non dans une pièce pendant un temps défini,
- Utiliser un algorithme **TPI (Time Proportional Interval)** grâce à l'algorithme [[Argonaute](https://forum.hacf.fr/u/argonaute/summary)] , - Utiliser un algorithme **TPI (Time Proportional Interval)** grâce à l'algorithme [[Argonaute](https://forum.hacf.fr/u/argonaute/summary)] ,
- Ajouter une **gestion de délestage** ou une régulation pour ne pas dépasser une puissance totale définie. Lorsque la puissance maximale est dépassée, un préréglage caché de « puissance » est défini sur l'entité climatique. Lorsque la puissance passe en dessous du maximum, le préréglage précédent est restauré. - Ajouter une **gestion de délestage** ou une régulation pour ne pas dépasser une puissance totale définie. Lorsque la puissance maximale est dépassée, un préréglage caché de « puissance » est défini sur l'entité climatique. Lorsque la puissance passe en dessous du maximum, le préréglage précédent est restauré.

View File

@@ -2,6 +2,9 @@
![Nouveau](images/new-icon.png) ![Nouveau](images/new-icon.png)
> * **Release 7.1**:
> - Refonte de la fonction de délestage (gestion de la puissance). Le délestage est maintenant géré de façon centralisé (auparavent chaque _VTherm_ était autonome). Cela permet une gestion bien plus efficace et de prioriser le délestage sur les équipements qui sont proches de la consigne. Attention, vous devez impérativement avoir une configuration centralisée avec gestion de la puissance pour que cela fonctionne. Plus d'infos [ici](./feature-power.md)
> * **Release 6.8**: > * **Release 6.8**:
> - Ajout d'une nouvelle méthode de régulation pour les Versatile Thermostat de type `over_climate`. Cette méthode nommée 'Contrôle direct de la vanne' permet de contrôler directement la vanne d'un TRV et éventuellement un décalage pour calibrer le thermomètre interne de votre TRV. Cette nouvelle méthode a été testée avec des Sonoff TRVZB et généralisée pour d'autre type de TRV pour lesquels la vanne est directement commandable via des entités de type `number`. Plus d'informations [ici](over-climate.md#lauto-régulation) et [ici](self-regulation.md#auto-régulation-par-contrôle-direct-de-la-vanne). > - Ajout d'une nouvelle méthode de régulation pour les Versatile Thermostat de type `over_climate`. Cette méthode nommée 'Contrôle direct de la vanne' permet de contrôler directement la vanne d'un TRV et éventuellement un décalage pour calibrer le thermomètre interne de votre TRV. Cette nouvelle méthode a été testée avec des Sonoff TRVZB et généralisée pour d'autre type de TRV pour lesquels la vanne est directement commandable via des entités de type `number`. Plus d'informations [ici](over-climate.md#lauto-régulation) et [ici](self-regulation.md#auto-régulation-par-contrôle-direct-de-la-vanne).

View File

@@ -39,6 +39,8 @@ L'algorithme de calcul du taux d'ouverture est basé sur le _TPI_ qui est décri
Si une entité de type taux de fermeture de la vanne est configurée, il sera positionné avec la valeur 100 - taux d'ouverture pour forcer la vanne dans un état. Si une entité de type taux de fermeture de la vanne est configurée, il sera positionné avec la valeur 100 - taux d'ouverture pour forcer la vanne dans un état.
Note: pour les Sonoff TRVZB, vous ne devez pas configurer les "closing degree". Cela rend inopérant le `hvac_action` qui est utilisé par _VTherm_ et qui indique que l'équipement est en chauffe.
### autres auto-régulation ### autres auto-régulation
Dans ce deuxième cas, le Versatile Thermostat calcule un décalage basé sur les informations suivantes : Dans ce deuxième cas, le Versatile Thermostat calcule un décalage basé sur les informations suivantes :

View File

@@ -59,8 +59,6 @@ from .const import ( # pylint: disable=unused-import
MOCK_TH_OVER_CLIMATE_TYPE_AC_CONFIG, MOCK_TH_OVER_CLIMATE_TYPE_AC_CONFIG,
MOCK_TH_OVER_CLIMATE_TYPE_NOT_REGULATED_CONFIG, MOCK_TH_OVER_CLIMATE_TYPE_NOT_REGULATED_CONFIG,
MOCK_TH_OVER_SWITCH_TPI_CONFIG, MOCK_TH_OVER_SWITCH_TPI_CONFIG,
MOCK_PRESETS_CONFIG,
MOCK_PRESETS_AC_CONFIG,
MOCK_WINDOW_CONFIG, MOCK_WINDOW_CONFIG,
MOCK_MOTION_CONFIG, MOCK_MOTION_CONFIG,
MOCK_POWER_CONFIG, MOCK_POWER_CONFIG,
@@ -89,7 +87,7 @@ FULL_SWITCH_CONFIG = (
| MOCK_TH_OVER_SWITCH_CENTRAL_MAIN_CONFIG | MOCK_TH_OVER_SWITCH_CENTRAL_MAIN_CONFIG
| MOCK_TH_OVER_SWITCH_TYPE_CONFIG | MOCK_TH_OVER_SWITCH_TYPE_CONFIG
| MOCK_TH_OVER_SWITCH_TPI_CONFIG | MOCK_TH_OVER_SWITCH_TPI_CONFIG
| MOCK_PRESETS_CONFIG # | MOCK_PRESETS_CONFIG
| MOCK_FULL_FEATURES | MOCK_FULL_FEATURES
| MOCK_WINDOW_CONFIG | MOCK_WINDOW_CONFIG
| MOCK_MOTION_CONFIG | MOCK_MOTION_CONFIG
@@ -104,7 +102,6 @@ FULL_SWITCH_AC_CONFIG = (
| MOCK_TH_OVER_SWITCH_CENTRAL_MAIN_CONFIG | MOCK_TH_OVER_SWITCH_CENTRAL_MAIN_CONFIG
| MOCK_TH_OVER_SWITCH_AC_TYPE_CONFIG | MOCK_TH_OVER_SWITCH_AC_TYPE_CONFIG
| MOCK_TH_OVER_SWITCH_TPI_CONFIG | MOCK_TH_OVER_SWITCH_TPI_CONFIG
| MOCK_PRESETS_AC_CONFIG
| MOCK_FULL_FEATURES | MOCK_FULL_FEATURES
| MOCK_WINDOW_CONFIG | MOCK_WINDOW_CONFIG
| MOCK_MOTION_CONFIG | MOCK_MOTION_CONFIG
@@ -118,7 +115,7 @@ PARTIAL_CLIMATE_CONFIG = (
| MOCK_TH_OVER_CLIMATE_MAIN_CONFIG | MOCK_TH_OVER_CLIMATE_MAIN_CONFIG
| MOCK_TH_OVER_CLIMATE_CENTRAL_MAIN_CONFIG | MOCK_TH_OVER_CLIMATE_CENTRAL_MAIN_CONFIG
| MOCK_TH_OVER_CLIMATE_TYPE_CONFIG | MOCK_TH_OVER_CLIMATE_TYPE_CONFIG
| MOCK_PRESETS_CONFIG # | MOCK_PRESETS_CONFIG
| MOCK_ADVANCED_CONFIG | MOCK_ADVANCED_CONFIG
) )
@@ -127,7 +124,7 @@ PARTIAL_CLIMATE_CONFIG_USE_DEVICE_TEMP = (
| MOCK_TH_OVER_CLIMATE_MAIN_CONFIG | MOCK_TH_OVER_CLIMATE_MAIN_CONFIG
| MOCK_TH_OVER_CLIMATE_CENTRAL_MAIN_CONFIG | MOCK_TH_OVER_CLIMATE_CENTRAL_MAIN_CONFIG
| MOCK_TH_OVER_CLIMATE_TYPE_USE_DEVICE_TEMP_CONFIG | MOCK_TH_OVER_CLIMATE_TYPE_USE_DEVICE_TEMP_CONFIG
| MOCK_PRESETS_CONFIG # | MOCK_PRESETS_CONFIG
| MOCK_ADVANCED_CONFIG | MOCK_ADVANCED_CONFIG
) )
@@ -136,7 +133,7 @@ PARTIAL_CLIMATE_NOT_REGULATED_CONFIG = (
| MOCK_TH_OVER_CLIMATE_MAIN_CONFIG | MOCK_TH_OVER_CLIMATE_MAIN_CONFIG
| MOCK_TH_OVER_CLIMATE_CENTRAL_MAIN_CONFIG | MOCK_TH_OVER_CLIMATE_CENTRAL_MAIN_CONFIG
| MOCK_TH_OVER_CLIMATE_TYPE_NOT_REGULATED_CONFIG | MOCK_TH_OVER_CLIMATE_TYPE_NOT_REGULATED_CONFIG
| MOCK_PRESETS_CONFIG # | MOCK_PRESETS_CONFIG
| MOCK_ADVANCED_CONFIG | MOCK_ADVANCED_CONFIG
) )
@@ -145,7 +142,7 @@ PARTIAL_CLIMATE_AC_CONFIG = (
| MOCK_TH_OVER_CLIMATE_TYPE_AC_CONFIG | MOCK_TH_OVER_CLIMATE_TYPE_AC_CONFIG
| MOCK_TH_OVER_CLIMATE_MAIN_CONFIG | MOCK_TH_OVER_CLIMATE_MAIN_CONFIG
| MOCK_TH_OVER_CLIMATE_CENTRAL_MAIN_CONFIG | MOCK_TH_OVER_CLIMATE_CENTRAL_MAIN_CONFIG
| MOCK_PRESETS_CONFIG # | MOCK_PRESETS_CONFIG
| MOCK_ADVANCED_CONFIG | MOCK_ADVANCED_CONFIG
) )
@@ -153,7 +150,7 @@ FULL_4SWITCH_CONFIG = (
MOCK_TH_OVER_4SWITCH_USER_CONFIG MOCK_TH_OVER_4SWITCH_USER_CONFIG
| MOCK_TH_OVER_4SWITCH_TYPE_CONFIG | MOCK_TH_OVER_4SWITCH_TYPE_CONFIG
| MOCK_TH_OVER_SWITCH_TPI_CONFIG | MOCK_TH_OVER_SWITCH_TPI_CONFIG
| MOCK_PRESETS_CONFIG # | MOCK_PRESETS_CONFIG
| MOCK_WINDOW_CONFIG | MOCK_WINDOW_CONFIG
| MOCK_MOTION_CONFIG | MOCK_MOTION_CONFIG
| MOCK_POWER_CONFIG | MOCK_POWER_CONFIG

View File

@@ -140,25 +140,6 @@ MOCK_TH_OVER_CLIMATE_TYPE_AC_CONFIG = {
CONF_AUTO_REGULATION_PERIOD_MIN: 1, CONF_AUTO_REGULATION_PERIOD_MIN: 1,
} }
# TODO remove this later
MOCK_PRESETS_CONFIG = {
PRESET_FROST_PROTECTION + PRESET_TEMP_SUFFIX: 7,
PRESET_ECO + PRESET_TEMP_SUFFIX: 16,
PRESET_COMFORT + PRESET_TEMP_SUFFIX: 17,
PRESET_BOOST + PRESET_TEMP_SUFFIX: 18,
}
# TODO remove this later
MOCK_PRESETS_AC_CONFIG = {
PRESET_FROST_PROTECTION + PRESET_TEMP_SUFFIX: 7,
PRESET_ECO + PRESET_TEMP_SUFFIX: 17,
PRESET_COMFORT + PRESET_TEMP_SUFFIX: 19,
PRESET_BOOST + PRESET_TEMP_SUFFIX: 20,
PRESET_ECO + PRESET_AC_SUFFIX + PRESET_TEMP_SUFFIX: 25,
PRESET_COMFORT + PRESET_AC_SUFFIX + PRESET_TEMP_SUFFIX: 23,
PRESET_BOOST + PRESET_AC_SUFFIX + PRESET_TEMP_SUFFIX: 21,
}
MOCK_WINDOW_CONFIG = { MOCK_WINDOW_CONFIG = {
CONF_WINDOW_SENSOR: "binary_sensor.window_sensor", CONF_WINDOW_SENSOR: "binary_sensor.window_sensor",
# Not used normally only for tests to avoid rewrite all tests # Not used normally only for tests to avoid rewrite all tests
@@ -184,12 +165,16 @@ MOCK_MOTION_CONFIG = {
CONF_NO_MOTION_PRESET: PRESET_ECO, CONF_NO_MOTION_PRESET: PRESET_ECO,
} }
MOCK_POWER_CONFIG = { MOCK_CENTRAL_POWER_CONFIG = {
CONF_POWER_SENSOR: "sensor.power_sensor", CONF_POWER_SENSOR: "sensor.power_sensor",
CONF_MAX_POWER_SENSOR: "sensor.power_max_sensor", CONF_MAX_POWER_SENSOR: "sensor.power_max_sensor",
CONF_PRESET_POWER: 10, CONF_PRESET_POWER: 10,
} }
MOCK_POWER_CONFIG = {
CONF_PRESET_POWER: 10,
}
MOCK_PRESENCE_CONFIG = { MOCK_PRESENCE_CONFIG = {
CONF_PRESENCE_SENSOR: "person.presence_sensor", CONF_PRESENCE_SENSOR: "person.presence_sensor",
} }

View File

@@ -481,8 +481,6 @@ async def test_bug_500_3(hass: HomeAssistant, init_vtherm_api) -> None:
CONF_USE_WINDOW_CENTRAL_CONFIG: False, CONF_USE_WINDOW_CENTRAL_CONFIG: False,
CONF_WINDOW_SENSOR: "sensor.theWindowSensor", CONF_WINDOW_SENSOR: "sensor.theWindowSensor",
CONF_USE_POWER_CENTRAL_CONFIG: False, CONF_USE_POWER_CENTRAL_CONFIG: False,
CONF_POWER_SENSOR: "sensor.thePowerSensor",
CONF_MAX_POWER_SENSOR: "sensor.theMaxPowerSensor",
CONF_USE_PRESENCE_CENTRAL_CONFIG: False, CONF_USE_PRESENCE_CENTRAL_CONFIG: False,
CONF_PRESENCE_SENSOR: "sensor.thePresenceSensor", CONF_PRESENCE_SENSOR: "sensor.thePresenceSensor",
CONF_USE_MOTION_FEATURE: True, # motion sensor need to be checked AND a motion sensor set CONF_USE_MOTION_FEATURE: True, # motion sensor need to be checked AND a motion sensor set
@@ -492,7 +490,7 @@ async def test_bug_500_3(hass: HomeAssistant, init_vtherm_api) -> None:
flow = VersatileThermostatBaseConfigFlow(config) flow = VersatileThermostatBaseConfigFlow(config)
assert flow._infos[CONF_USE_WINDOW_FEATURE] is True assert flow._infos[CONF_USE_WINDOW_FEATURE] is True
assert flow._infos[CONF_USE_POWER_FEATURE] is True assert flow._infos[CONF_USE_POWER_FEATURE] is False
assert flow._infos[CONF_USE_PRESENCE_FEATURE] is True assert flow._infos[CONF_USE_PRESENCE_FEATURE] is True
assert flow._infos[CONF_USE_MOTION_FEATURE] is True assert flow._infos[CONF_USE_MOTION_FEATURE] is True

View File

@@ -212,6 +212,13 @@ async def test_underlying_change_follow(
tz = get_tz(hass) # pylint: disable=invalid-name tz = get_tz(hass) # pylint: disable=invalid-name
now: datetime = datetime.now(tz=tz) now: datetime = datetime.now(tz=tz)
temps = {
PRESET_FROST_PROTECTION: 7,
PRESET_ECO: 16,
PRESET_COMFORT: 17,
PRESET_BOOST: 18,
}
entry = MockConfigEntry( entry = MockConfigEntry(
domain=DOMAIN, domain=DOMAIN,
title="TheOverClimateMockName", title="TheOverClimateMockName",
@@ -232,7 +239,7 @@ async def test_underlying_change_follow(
) as mock_find_climate, patch( ) as mock_find_climate, patch(
"custom_components.versatile_thermostat.underlyings.UnderlyingClimate.set_hvac_mode" "custom_components.versatile_thermostat.underlyings.UnderlyingClimate.set_hvac_mode"
) as mock_underlying_set_hvac_mode: ) as mock_underlying_set_hvac_mode:
entity = await create_thermostat(hass, entry, "climate.theoverclimatemockname") entity = await create_thermostat(hass, entry, "climate.theoverclimatemockname", temps)
assert entity assert entity
assert entity.name == "TheOverClimateMockName" assert entity.name == "TheOverClimateMockName"
@@ -354,6 +361,13 @@ async def test_underlying_change_not_follow(
tz = get_tz(hass) # pylint: disable=invalid-name tz = get_tz(hass) # pylint: disable=invalid-name
now: datetime = datetime.now(tz=tz) now: datetime = datetime.now(tz=tz)
temps = {
PRESET_FROST_PROTECTION: 7,
PRESET_ECO: 16,
PRESET_COMFORT: 17,
PRESET_BOOST: 18,
}
entry = MockConfigEntry( entry = MockConfigEntry(
domain=DOMAIN, domain=DOMAIN,
title="TheOverClimateMockName", title="TheOverClimateMockName",
@@ -374,7 +388,7 @@ async def test_underlying_change_not_follow(
) as mock_find_climate, patch( ) as mock_find_climate, patch(
"custom_components.versatile_thermostat.underlyings.UnderlyingClimate.set_hvac_mode" "custom_components.versatile_thermostat.underlyings.UnderlyingClimate.set_hvac_mode"
) as mock_underlying_set_hvac_mode: ) as mock_underlying_set_hvac_mode:
entity = await create_thermostat(hass, entry, "climate.theoverclimatemockname") entity = await create_thermostat(hass, entry, "climate.theoverclimatemockname", temps)
assert entity assert entity
@@ -726,6 +740,13 @@ async def test_ignore_temp_outside_minmax_range(
tz = get_tz(hass) # pylint: disable=invalid-name tz = get_tz(hass) # pylint: disable=invalid-name
now: datetime = datetime.now(tz=tz) now: datetime = datetime.now(tz=tz)
temps = {
PRESET_FROST_PROTECTION: 7,
PRESET_ECO: 16,
PRESET_COMFORT: 17,
PRESET_BOOST: 18,
}
entry = MockConfigEntry( entry = MockConfigEntry(
domain=DOMAIN, domain=DOMAIN,
title="TheOverClimateMockName", title="TheOverClimateMockName",
@@ -746,7 +767,7 @@ async def test_ignore_temp_outside_minmax_range(
) as mock_find_climate, patch( ) as mock_find_climate, patch(
"custom_components.versatile_thermostat.underlyings.UnderlyingClimate.set_hvac_mode" "custom_components.versatile_thermostat.underlyings.UnderlyingClimate.set_hvac_mode"
) as mock_underlying_set_hvac_mode: ) as mock_underlying_set_hvac_mode:
entity = await create_thermostat(hass, entry, "climate.theoverclimatemockname") entity = await create_thermostat(hass, entry, "climate.theoverclimatemockname", temps)
assert entity assert entity

View File

@@ -627,11 +627,11 @@ async def test_over_climate_valve_multi_min_opening_degrees(
assert mock_service_call.call_count == 6 assert mock_service_call.call_count == 6
mock_service_call.assert_has_calls([ mock_service_call.assert_has_calls([
# min is 60 # min is 60
call(domain='number', service='set_value', service_data={'value': 60}, target={'entity_id': 'number.mock_opening_degree1'}), call(domain='number', service='set_value', service_data={'value': 68}, target={'entity_id': 'number.mock_opening_degree1'}),
call(domain='number', service='set_value', service_data={'value': 40}, target={'entity_id': 'number.mock_closing_degree1'}), call(domain='number', service='set_value', service_data={'value': 32}, target={'entity_id': 'number.mock_closing_degree1'}),
call(domain='number', service='set_value', service_data={'value': 3.0}, target={'entity_id': 'number.mock_offset_calibration1'}), call(domain='number', service='set_value', service_data={'value': 3.0}, target={'entity_id': 'number.mock_offset_calibration1'}),
call(domain='number', service='set_value', service_data={'value': 70}, target={'entity_id': 'number.mock_opening_degree2'}), call(domain='number', service='set_value', service_data={'value': 76}, target={'entity_id': 'number.mock_opening_degree2'}),
call(domain='number', service='set_value', service_data={'value': 30}, target={'entity_id': 'number.mock_closing_degree2'}), call(domain='number', service='set_value', service_data={'value': 24}, target={'entity_id': 'number.mock_closing_degree2'}),
call(domain='number', service='set_value', service_data={'value': 12}, target={'entity_id': 'number.mock_offset_calibration2'}) call(domain='number', service='set_value', service_data={'value': 12}, target={'entity_id': 'number.mock_offset_calibration2'})
] ]
) )

View File

@@ -763,8 +763,6 @@ async def test_power_management_energy_over_climate(
CONF_MINIMAL_ACTIVATION_DELAY: 30, CONF_MINIMAL_ACTIVATION_DELAY: 30,
CONF_SAFETY_DELAY_MIN: 5, CONF_SAFETY_DELAY_MIN: 5,
CONF_SAFETY_MIN_ON_PERCENT: 0.3, CONF_SAFETY_MIN_ON_PERCENT: 0.3,
CONF_POWER_SENSOR: "sensor.mock_power_sensor",
CONF_MAX_POWER_SENSOR: "sensor.mock_power_max_sensor",
CONF_DEVICE_POWER: 100, CONF_DEVICE_POWER: 100,
CONF_PRESET_POWER: 12, CONF_PRESET_POWER: 12,
}, },

View File

@@ -224,8 +224,6 @@ async def test_sensors_over_climate(
CONF_MINIMAL_ACTIVATION_DELAY: 30, CONF_MINIMAL_ACTIVATION_DELAY: 30,
CONF_SAFETY_DELAY_MIN: 5, CONF_SAFETY_DELAY_MIN: 5,
CONF_SAFETY_MIN_ON_PERCENT: 0.3, CONF_SAFETY_MIN_ON_PERCENT: 0.3,
CONF_POWER_SENSOR: "sensor.mock_power_sensor",
CONF_MAX_POWER_SENSOR: "sensor.mock_power_max_sensor",
CONF_DEVICE_POWER: 1.5, CONF_DEVICE_POWER: 1.5,
CONF_PRESET_POWER: 12, CONF_PRESET_POWER: 12,
}, },

View File

@@ -26,6 +26,23 @@ async def test_over_switch_ac_full_start(
): # pylint: disable=unused-argument ): # pylint: disable=unused-argument
"""Test the normal full start of a thermostat in thermostat_over_switch type""" """Test the normal full start of a thermostat in thermostat_over_switch type"""
temps = {
PRESET_FROST_PROTECTION: 7,
PRESET_ECO: 17,
PRESET_COMFORT: 19,
PRESET_BOOST: 20,
PRESET_ECO + PRESET_AC_SUFFIX: 25,
PRESET_COMFORT + PRESET_AC_SUFFIX: 23,
PRESET_BOOST + PRESET_AC_SUFFIX: 21,
PRESET_FROST_PROTECTION + PRESET_AWAY_SUFFIX: 7,
PRESET_ECO + PRESET_AWAY_SUFFIX: 16,
PRESET_COMFORT + PRESET_AWAY_SUFFIX: 17,
PRESET_BOOST + PRESET_AWAY_SUFFIX: 18,
PRESET_ECO + PRESET_AC_SUFFIX + PRESET_AWAY_SUFFIX: 27,
PRESET_COMFORT + PRESET_AC_SUFFIX + PRESET_AWAY_SUFFIX: 26,
PRESET_BOOST + PRESET_AC_SUFFIX + PRESET_AWAY_SUFFIX: 25,
}
entry = MockConfigEntry( entry = MockConfigEntry(
domain=DOMAIN, domain=DOMAIN,
title="TheOverSwitchACMockName", title="TheOverSwitchACMockName",
@@ -57,21 +74,7 @@ async def test_over_switch_ac_full_start(
assert isinstance(entity, ThermostatOverSwitch) assert isinstance(entity, ThermostatOverSwitch)
# Initialise the preset temp # Initialise the preset temp
await set_climate_preset_temp( await set_all_climate_preset_temp(hass, entity, temps, "theoverswitchmockname")
entity, PRESET_FROST_PROTECTION + PRESET_AWAY_SUFFIX, 7
)
await set_climate_preset_temp(entity, PRESET_ECO + PRESET_AWAY_SUFFIX, 16)
await set_climate_preset_temp(entity, PRESET_COMFORT + PRESET_AWAY_SUFFIX, 17)
await set_climate_preset_temp(entity, PRESET_BOOST + PRESET_AWAY_SUFFIX, 18)
await set_climate_preset_temp(
entity, PRESET_ECO + PRESET_AC_SUFFIX + PRESET_AWAY_SUFFIX, 27
)
await set_climate_preset_temp(
entity, PRESET_COMFORT + PRESET_AC_SUFFIX + PRESET_AWAY_SUFFIX, 26
)
await set_climate_preset_temp(
entity, PRESET_BOOST + PRESET_AC_SUFFIX + PRESET_AWAY_SUFFIX, 25
)
assert entity.name == "TheOverSwitchMockName" assert entity.name == "TheOverSwitchMockName"
assert entity.is_over_climate is False # pylint: disable=protected-access assert entity.is_over_climate is False # pylint: disable=protected-access

View File

@@ -51,8 +51,6 @@ async def test_over_valve_full_start(
CONF_MOTION_OFF_DELAY: 30, CONF_MOTION_OFF_DELAY: 30,
CONF_MOTION_PRESET: PRESET_COMFORT, CONF_MOTION_PRESET: PRESET_COMFORT,
CONF_NO_MOTION_PRESET: PRESET_ECO, CONF_NO_MOTION_PRESET: PRESET_ECO,
CONF_POWER_SENSOR: "sensor.power_sensor",
CONF_MAX_POWER_SENSOR: "sensor.power_max_sensor",
CONF_PRESENCE_SENSOR: "person.presence_sensor", CONF_PRESENCE_SENSOR: "person.presence_sensor",
PRESET_FROST_PROTECTION + PRESET_AWAY_SUFFIX + PRESET_TEMP_SUFFIX: 7, PRESET_FROST_PROTECTION + PRESET_AWAY_SUFFIX + PRESET_TEMP_SUFFIX: 7,
PRESET_ECO + PRESET_AWAY_SUFFIX + PRESET_TEMP_SUFFIX: 17.1, PRESET_ECO + PRESET_AWAY_SUFFIX + PRESET_TEMP_SUFFIX: 17.1,