From abd24af0d0ec75883ad6afe1606255b8027a4c77 Mon Sep 17 00:00:00 2001 From: Jop Zitman Date: Tue, 13 Oct 2026 13:08:33 +0200 Subject: [PATCH] Round float values in OpenTherm Gateway MQTT commands Floating-point artifacts such as 56.602000000000004 were sent as CS=56.602000000000004. OTGW-firmware drops queued commands longer than 14 characters, so the boiler never received the control setpoint. --- custom_components/sat/mqtt/opentherm.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/sat/mqtt/opentherm.py b/custom_components/sat/mqtt/opentherm.py index 2aff441f..9e574a94 100644 --- a/custom_components/sat/mqtt/opentherm.py +++ b/custom_components/sat/mqtt/opentherm.py @@ -183,18 +183,18 @@ def get_tracked_entities(self) -> list[str]: ] async def async_set_control_setpoint(self, value: float) -> None: - await self._publish_command(f"CS={value}") + await self._publish_command(f"CS={value:.1f}") await self._publish_command(f"PM=25") await super().async_set_control_setpoint(value) async def async_set_control_hot_water_setpoint(self, value: float) -> None: - await self._publish_command(f"SW={value}") + await self._publish_command(f"SW={value:.1f}") await super().async_set_control_hot_water_setpoint(value) async def async_set_control_thermostat_setpoint(self, value: float) -> None: - await self._publish_command(f"TC={value}") + await self._publish_command(f"TC={value:.1f}") await super().async_set_control_thermostat_setpoint(value) @@ -212,7 +212,7 @@ async def async_set_control_max_relative_modulation(self, value: int) -> None: await super().async_set_control_max_relative_modulation(value) async def async_set_control_max_setpoint(self, value: float) -> None: - await self._publish_command(f"SH={value}") + await self._publish_command(f"SH={value:.1f}") await super().async_set_control_max_setpoint(value)