Compare commits

...

6 Commits

Author SHA1 Message Date
Jean-Marc Collin 96076bf7c2 Change the auto-regulation last calculation
Change auto-window detection to 30 sec of delay
2023-11-12 17:44:02 +00:00
Jean-Marc Collin a3f7043f45 Add target_temperature_step management 2023-11-12 11:20:40 +00:00
Jean-Marc Collin 67c01b02ec Add default target temperature step 2023-11-12 10:37:44 +00:00
Jean-Marc Collin ab1c6892df Issue #164 - multiple calls to regulation 2023-11-12 09:20:52 +00:00
Jean-Marc Collin 84c8ac4f59 Beers from @Gunnar M 2023-11-11 17:32:41 +00:00
Jean-Marc Collin faab9648a7 Add Rointe incompatility 2023-11-11 16:41:03 +00:00
5 changed files with 24 additions and 37 deletions
+2 -1
View File
@@ -85,7 +85,7 @@ Ce composant personnalisé pour Home Assistant est une mise à niveau et est une
La puissance de l'appareil doit maintenant être la puissance totale de tous les appareils controlée par le VTherm. Cela permet d'avoir des équipements hétérogènes de puissance différente. Dans le cas de plusieurs appareils contrôlés par un seul VTherm, vous devrez éditer et changer la valeur `device_power`. Vous devez configurer la puissance totale de tous les appareils.
# Merci pour la bière [buymecoffee](https://www.buymeacoffee.com/jmcollin78)
Un grand merci à @salabur, @pvince83, @bergoglio, @EPicLURcher, @ecolorado66, @Kriss1670, @maia, @f.maymil, @moutte69, @Jerome pour les bières. Ca fait très plaisir et ça m'encourage à continuer !
Un grand merci à @salabur, @pvince83, @bergoglio, @EPicLURcher, @ecolorado66, @Kriss1670, @maia, @f.maymil, @moutte69, @Jerome, @Gunnar M pour les bières. Ca fait très plaisir et ça m'encourage à continuer !
# Quand l'utiliser et ne pas l'utiliser
@@ -107,6 +107,7 @@ Certains thermostat de type TRV sont réputés incompatibles avec le Versatile T
1. les vannes POPP de Danfoss avec retour de température. Il est impossible d'éteindre cette vanne et elle s'auto-régule d'elle-même causant des conflits avec le VTherm,
2. les vannes thermstatiques "Homematic radio". Elles ont un cycle de service incompatible avec une commande par le Versatile Thermostat,
3. les thermostats de type Heatzy qui ne supportent pas les commandes de type set_temperature
4. les thermostats de type Rointe ont tendance a se réveiller tout seul. Le reste fonctionne normalement.
# Pourquoi une nouvelle implémentation du thermostat ?
+2 -1
View File
@@ -83,7 +83,7 @@ This custom component for Home Assistant is an upgrade and is a complete rewrite
The power of the device should now be the total power of all controler devices by the VTherm. This allow to have eterogeneous equipment with different power. In case of multi-devices controlled by a single VTherm you will have to edit and change the `device_power` value. Set the total power of all devices.
# Thanks for the beer [buymecoffee](https://www.buymeacoffee.com/jmcollin78)
Many thanks to @salabur, @pvince83, @bergoglio, @EPicLURcher, @ecolorado66, @Kriss1670, @maia, @f.maymil, @moutte69, @Jerome for the beers. It's very nice and encourages me to continue!
Many thanks to @salabur, @pvince83, @bergoglio, @EPicLURcher, @ecolorado66, @Kriss1670, @maia, @f.maymil, @moutte69, @Jerome, @Gunnar M for the beers. It's very nice and encourages me to continue!
# When to use / not use
This thermostat can control 3 types of equipment:
@@ -105,6 +105,7 @@ Some TRV type thermostats are known to be incompatible with the Versatile Thermo
1. Danfoss POPP valves with temperature feedback. It is impossible to turn off this valve and it self-regulates, causing conflicts with the VTherm,
2. “Homematic radio” thermostatic valves. They have a duty cycle incompatible with control by the Versatile Thermostat,
3. Thermostat of type Heatzy which doesn't supports the set_temperature command.
4. Thermostats of type Rointe tends to awake alone even if VTherm turns it off. Others functions works fine.
# Why another thermostat implementation ?
@@ -173,6 +173,7 @@ class BaseThermostat(ClimateEntity, RestoreEntity):
"max_power_sensor_entity_id",
"temperature_unit",
"is_device_active",
"target_temperature_step",
}
)
)
@@ -297,6 +298,8 @@ class BaseThermostat(ClimateEntity, RestoreEntity):
self._ext_temp_sensor_entity_id = entry_infos.get(CONF_EXTERNAL_TEMP_SENSOR)
self._attr_max_temp = entry_infos.get(CONF_TEMP_MAX)
self._attr_min_temp = entry_infos.get(CONF_TEMP_MIN)
# Default value not configurable
self._attr_target_temperature_step = 0.1
self._power_sensor_entity_id = entry_infos.get(CONF_POWER_SENSOR)
self._max_power_sensor_entity_id = entry_infos.get(CONF_MAX_POWER_SENSOR)
self._window_sensor_entity_id = entry_infos.get(CONF_WINDOW_SENSOR)
@@ -904,27 +907,6 @@ class BaseThermostat(ClimateEntity, RestoreEntity):
"""Return the sensor temperature."""
return self._cur_temp
@property
def target_temperature_step(self) -> float | None:
"""Return the supported step of target temperature."""
return None
@property
def target_temperature_high(self) -> float | None:
"""Return the highbound target temperature we try to reach.
Requires ClimateEntityFeature.TARGET_TEMPERATURE_RANGE.
"""
return None
@property
def target_temperature_low(self) -> float | None:
"""Return the lowbound target temperature we try to reach.
Requires ClimateEntityFeature.TARGET_TEMPERATURE_RANGE.
"""
return None
@property
def is_aux_heat(self) -> bool | None:
"""Return true if aux heater.
@@ -2120,6 +2102,7 @@ class BaseThermostat(ClimateEntity, RestoreEntity):
"power_temp": self._power_temp,
# Already in super class - "target_temp": self.target_temperature,
# Already in super class - "current_temp": self._cur_temp,
"target_temperature_step": self.target_temperature_step,
"ext_current_temperature": self._cur_ext_temp,
"ac_mode": self._ac_mode,
"current_power": self._current_power,
@@ -12,7 +12,7 @@ from datetime import datetime
_LOGGER = logging.getLogger(__name__)
# To filter bad values
MIN_DELTA_T_SEC = 10 # two temp mesure should be > 10 sec
MIN_DELTA_T_SEC = 30 # two temp mesure should be > 10 sec
MAX_SLOPE_VALUE = 2 # slope cannot be > 2 or < -2 -> else this is an aberrant point
@@ -115,9 +115,23 @@ class ThermostatOverClimate(BaseThermostat):
force,
)
now: datetime = NowClass.get_now(self._hass)
period = float((now - self._last_regulation_change).total_seconds()) / 60.0
if not force and period < self._auto_regulation_period_min:
_LOGGER.info(
"%s - period (%.1f) min is < %.0f min -> forget the regulation send",
self,
period,
self._auto_regulation_period_min,
)
return
if not self._regulated_target_temp:
self._regulated_target_temp = self.target_temperature
_LOGGER.info("%s - regulation calculation will be done", self)
self._last_regulation_change = now
new_regulated_temp = round_to_nearest(
self._regulation_algo.calculate_regulated_temperature(
self.current_temperature, self._cur_ext_temp
@@ -127,7 +141,7 @@ class ThermostatOverClimate(BaseThermostat):
dtemp = new_regulated_temp - self._regulated_target_temp
if not force and abs(dtemp) < self._auto_regulation_dtemp:
_LOGGER.debug(
_LOGGER.info(
"%s - dtemp (%.1f) is < %.1f -> forget the regulation send",
self,
dtemp,
@@ -135,24 +149,12 @@ class ThermostatOverClimate(BaseThermostat):
)
return
now: datetime = NowClass.get_now(self._hass)
period = float((now - self._last_regulation_change).total_seconds()) / 60.0
if not force and period < self._auto_regulation_period_min:
_LOGGER.debug(
"%s - period (%.1f) is < %.0f -> forget the regulation send",
self,
period,
self._auto_regulation_period_min,
)
return
self._regulated_target_temp = new_regulated_temp
_LOGGER.info(
"%s - Regulated temp have changed to %.1f. Resend it to underlyings",
self,
new_regulated_temp,
)
self._last_regulation_change = now
for under in self._underlyings:
await under.set_temperature(