diff --git a/custom_components/sat/mqtt/ems.py b/custom_components/sat/mqtt/ems.py index 3b74f036..38c4b4a1 100644 --- a/custom_components/sat/mqtt/ems.py +++ b/custom_components/sat/mqtt/ems.py @@ -109,7 +109,9 @@ def get_tracked_entities(self) -> list[str]: return [DATA_BOILER_DATA] async def async_set_control_setpoint(self, value: float) -> None: - await self._publish_command(f'{{"cmd": "selflowtemp", "value": {0 if value == 10 else value}}}') + # Minimum valid setting for Bosch/Junkers boiler seems to be 12°. + # Lower values set the boiler to 12° except 0° which sets the boiler to 5°. + await self._publish_command(f'{{"cmd": "selflowtemp", "value": {max(value, 12)}}}') await super().async_set_control_setpoint(value) @@ -123,12 +125,19 @@ async def async_set_control_thermostat_setpoint(self, value: float) -> None: await super().async_set_control_thermostat_setpoint(value) async def async_set_heater_state(self, state: DeviceState) -> None: - await self._publish_command(f'{{"cmd": "heatingactivated", "value": "{DATA_ON if state == DeviceState.ON else DATA_OFF}"}}') - + # Do not send 'heatingoff' command, as this leads to EMS toggling the boiler between + # pre-set heating and selected flow temperature. Instead, control on/off solely by setting + # a low flow temperature (SAT already does this). + # (see https://github.com/emsesp/EMS-ESP32/discussions/2641#discussioncomment-14611481) + # The alternative command 'heatingactivated` also interferes with EMS, so sending nothing + # here seems to be the correct way to handle it. await super().async_set_heater_state(state) async def async_set_control_max_relative_modulation(self, value: int) -> None: - await self._publish_command(f'{{"cmd": "burnmaxpower", "value": {max(value, 20)}}}') + # Do not set 'burnmaxpower' as this is an EEPROM-stored value and will wear out the EEPROM. + # Use 'selburnpow' instead. + # (see https://github.com/emsesp/EMS-ESP32/discussions/2641#discussioncomment-14611481) + await self._publish_command(f'{{"cmd": "selburnpow", "value": {max(value, 20)}}}') await super().async_set_control_max_relative_modulation(value)