Compare commits

...

7 Commits

Author SHA1 Message Date
Jean-Marc Collin
d4a719a660 Issue #903 - Modify "follow underlying changes" behavior - Transform 'Auto' hvac_mode to 'Heating' 2025-02-10 17:30:05 +00:00
Jean-Marc Collin
ea0d66f0c6 Vack to HA 2025.1.4. It doesn't work on Github. 2025-02-10 16:53:28 +00:00
adi90x
641801084d Correct window bypass (#899) 2025-02-10 17:44:28 +01:00
adi90x
1576e9c189 Add bypass to the window open check and correct description (#897) 2025-02-10 17:42:06 +01:00
adi90x
313fa26160 Save & Recover Window Bypass state (#898)
* Remove windows_bypass state from unrecorded

* Recover bypass_state
2025-02-10 17:29:53 +01:00
Jean-Marc Collin
832ea78a12 FIX select_option 2025-02-10 08:33:40 +01:00
Jean-Marc Collin
5f167af331 Fix select_option 2025-02-10 08:33:06 +01:00
6 changed files with 32 additions and 23 deletions

View File

@@ -44,7 +44,6 @@ class FeatureWindowManager(BaseFeatureManager):
{
"window_sensor_entity_id",
"is_window_configured",
"is_window_bypass",
"window_delay_sec",
"window_off_delay_sec",
"window_auto_configured",
@@ -130,6 +129,11 @@ class FeatureWindowManager(BaseFeatureManager):
@overrides
async def start_listening(self):
"""Start listening the underlying entity"""
# Try to get last window bypass state
old_state = await self._vtherm.async_get_last_state()
self._is_window_bypass = True if old_state and old_state.attributes and old_state.attributes.get("is_window_bypass") is True else False
if self._is_configured:
self.stop_listening()
if self._window_sensor_entity_id:
@@ -449,22 +453,23 @@ class FeatureWindowManager(BaseFeatureManager):
"""Set the window bypass flag
Return True if state have been changed"""
self._is_window_bypass = window_bypass
if not self._is_window_bypass and self._window_state:
_LOGGER.info(
"%s - Last window state was open & ByPass is now off. Set hvac_mode to '%s'",
self,
HVACMode.OFF,
)
self._vtherm.save_hvac_mode()
await self._vtherm.async_set_hvac_mode(HVACMode.OFF)
return True
if self._is_window_bypass and self._window_state:
_LOGGER.info(
"%s - Last window state was open & ByPass is now on. Set hvac_mode to last available mode",
self,
)
await self._vtherm.restore_hvac_mode(True)
if self._window_state == STATE_ON:
if not self._is_window_bypass:
_LOGGER.info(
"%s - Last window state was open & ByPass is now off. Set hvac_mode to '%s'",
self,
HVACMode.OFF,
)
self._vtherm.save_hvac_mode()
await self._vtherm.async_set_hvac_mode(HVACMode.OFF)
if self._is_window_bypass:
_LOGGER.info(
"%s - Last window state was open & ByPass is now on. Set hvac_mode to last available mode",
self,
)
await self._vtherm.restore_hvac_mode(True)
return True
return False
@@ -504,10 +509,10 @@ class FeatureWindowManager(BaseFeatureManager):
@property
def is_window_detected(self) -> bool:
"""Return true if the presence is configured and presence sensor is OFF"""
"""Return true if the window is configured and open and bypass is not ON"""
return self._is_configured and (
self._window_state == STATE_ON or self._window_auto_state == STATE_ON
)
) and not self._is_window_bypass
@property
def window_sensor_entity_id(self) -> bool:

View File

@@ -625,6 +625,10 @@ class ThermostatOverClimate(BaseThermostat[UnderlyingClimate]):
changes = False
new_hvac_mode = new_state.state
# Issue #903 - patch AUTO mode
if new_hvac_mode == HVACMode.AUTO:
new_hvac_mode = HVACMode.HEAT if not self.ac_mode else HVACMode.COOL
old_state = event.data.get("old_state")
# Issue #829 - refresh underlying command if it comes back to life

View File

@@ -74,7 +74,7 @@ The available commands depend on the type of underlying device:
| Underlying Device Type | Possible On Commands | Possible Off Commands | Applies To |
| --------------------------- | ------------------------------------- | ---------------------------------------------- | ----------------------------- |
| `switch` or `input_boolean` | `turn_on` | `turn_off` | All switches |
| `select` or `input_select` | `select_option/option:comfort` | `set_option/option:frost_protection` | Nodon SIN-4-FP-21 and similar |
| `select` or `input_select` | `select_option/option:comfort` | `select_option/option:frost_protection` | Nodon SIN-4-FP-21 and similar |
| `climate` (hvac_mode) | `set_hvac_mode/hvac_mode:heat` | `set_hvac_mode/hvac_mode:off` | eCosy (via Tuya Local) |
| `climate` (preset) | `set_preset_mode/preset_mode:comfort` | `set_preset_mode/preset_mode:frost_protection` | Heatzy |

View File

@@ -72,7 +72,7 @@ Les commandes possibles dépendent du type de sous-jacents :
| type de sous-jacent | commandes d'allumage possibles | commandes d'extinction possibles | S'applique à |
| --------------------------- | ------------------------------------- | ---------------------------------------------- | ------------------------------ |
| `switch` ou `input_boolean` | `turn_on` | `turn_off` | tous les switchs |
| `select` ou `input_select` | `select_option/option:comfort` | `set_option/option:frost_protection` | Nodon SIN-4-FP-21 et assimilés |
| `select` ou `input_select` | `select_option/option:comfort` | `select_option/option:frost_protection` | Nodon SIN-4-FP-21 et assimilés |
| `climate` (hvac_mode) | `set_hvac_mode/hvac_mode:heat` | `set_hvac_mode/hvac_mode:off` | eCosy (via Tuya Local) |
| `climate` (preset) | `set_preset_mode/preset_mode:comfort` | `set_preset_mode/preset_mode:frost_protection` | Heatzy |
@@ -90,4 +90,4 @@ Si l'erreur suivante se produit :
Cela signifie que une des commandes saisies est invalide. Les règles à respecter sont les suivantes :
1. chaque commande doit avoir le format `commande[/attribut[:valeur]]` (ex: `select_option/option:comfort` ou `turn_on`) sans blanc et sans caractères spéciaux sauf '_',
2. il doit y avoir autant de commandes qu'il y a de sous-jacents déclarés sauf si tous les sous-jacents sont des `switchs` auquel cas il n'est pas nécessaire de paramétrer les commandes,
3. si plusieurs sous-jacents sont configurés, les commandes doivent être dans le même ordre. Le nombre de commandes d'allumage doit être égal au nombre de commandes d'extinction et de sous-jacents (dans l'ordre donc). Il est possible de mettre des sous-jacents de type différent. À partir du moment où un sous-jacent n'est pas un `switch`, il faut paramétrer toutes les commandes de tous les sous-jacents y compris des éventuels switchs.
3. si plusieurs sous-jacents sont configurés, les commandes doivent être dans le même ordre. Le nombre de commandes d'allumage doit être égal au nombre de commandes d'extinction et de sous-jacents (dans l'ordre donc). Il est possible de mettre des sous-jacents de type différent. À partir du moment où un sous-jacent n'est pas un `switch`, il faut paramétrer toutes les commandes de tous les sous-jacents y compris des éventuels switchs.

View File

@@ -1 +1 @@
homeassistant==2025.2.1
homeassistant==2025.1.4

View File

@@ -700,7 +700,7 @@ async def test_add_number_for_over_switch_use_central_presets_and_restore(
assert vtherm.use_central_config_temperature is True
# We should try to restore all 4 temp entities and the VTherm itself
assert mock_restore_state.call_count == 4 + 1
assert mock_restore_state.call_count == 4 + 2
# 1. We search for NumberEntities
for preset_name, value in temps.items():