From 69267f7c0f1591d63e6bf7b69c68e5ca63cc09ae Mon Sep 17 00:00:00 2001 From: bahmcloud Date: Sun, 15 Feb 2026 22:10:18 +0100 Subject: [PATCH] Fix relative CT start/stop handling --- .idea/PROJECT_STATE.md | 4 ++-- CHANGELOG.md | 3 +++ README.md | 3 ++- custom_components/ha_knx_bridge/bridge.py | 8 ++++---- custom_components/ha_knx_bridge/manifest.json | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.idea/PROJECT_STATE.md b/.idea/PROJECT_STATE.md index 323f64c..b178671 100644 --- a/.idea/PROJECT_STATE.md +++ b/.idea/PROJECT_STATE.md @@ -48,8 +48,8 @@ Completed: - Relative color temperature control wired into light schema, UI order adjusted, and KNX color temperature types aligned. - Color temperature service calls now use mireds for better compatibility. - Relative dimming/color temperature decoding improved for control/stepcode payloads. -- Relative color temperature adjustment now accepts step_code 0 as a single-step and registers control_dimming event types for relative dimming/CT. -- Project version set to 0.0.31 and `CHANGELOG.md` maintained. +- Relative dimming/CT now treat step_code 0 as a start/stop toggle and rely on raw payload parsing. +- Project version set to 0.0.32 and `CHANGELOG.md` maintained. Files created: - `custom_components/ha_knx_bridge/__init__.py` diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b41aae..3af5cdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 0.0.32 - 2026-02-15 +- Treat DPT 3.007 step_code 0 as a start/stop toggle for relative dimming/CT and rely on raw payload parsing. + ## 0.0.31 - 2026-02-15 - Treat DPT 3.007 step_code 0 as a single-step for relative dimming/CT and register control_dimming event types. diff --git a/README.md b/README.md index 4655a53..1aa5a69 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ Notes: - Relative dimming (DPT 3.007) maps KNX step values (control/stepcode) to small `brightness_step_pct` changes in Home Assistant. - For relative dimming, the bridge repeats steps until a KNX stop telegram (0 or 8) is received. - Relative color temperature (DPT 3.007) adjusts Kelvin in the same start/stop pattern. +- Some KNX keypads send `step_code 0` for a start/stop toggle; the bridge treats `step_code 0` as start when idle and stop when already dimming. - Color temperature mode must match the KNX telegram DPT: `relative` for 5.001, `absolute` for 7.600 (2-byte unsigned), `absolute_float` for DPT 9 (2-byte float). The bridge sends HA color temperature using `color_temp` (mireds) for maximum compatibility. ## Notes @@ -112,5 +113,5 @@ Notes: - Advanced DPT mapping options and inversion settings. ## Versioning and Releases -- Current version: 0.0.31 +- Current version: 0.0.32 - `CHANGELOG.md` lists versions with the newest entries at the top. diff --git a/custom_components/ha_knx_bridge/bridge.py b/custom_components/ha_knx_bridge/bridge.py index 10d5eac..2e1f6c5 100644 --- a/custom_components/ha_knx_bridge/bridge.py +++ b/custom_components/ha_knx_bridge/bridge.py @@ -678,13 +678,13 @@ class BridgeManager: ) self._register_knx_light_command( port.relative_color_temperature_address, - "control_dimming", + None, port, "relative_color_temperature", ) self._register_knx_light_command( port.relative_dimming_address, - "control_dimming", + None, port, "relative_dimming", ) @@ -1180,7 +1180,7 @@ class BridgeManager: if port.entity_id in self._light_dimming_tasks: self._stop_light_dimming(port.entity_id) return - self._apply_light_dimming_step( + self._start_light_dimming( port.entity_id, direction, 1 ) return @@ -1208,7 +1208,7 @@ class BridgeManager: if port.entity_id in self._light_ct_tasks: self._stop_light_ct_adjust(port.entity_id) return - self._apply_light_ct_step_once( + self._start_light_ct_adjust( port, direction, 1 ) return diff --git a/custom_components/ha_knx_bridge/manifest.json b/custom_components/ha_knx_bridge/manifest.json index 630e0fc..653e24b 100644 --- a/custom_components/ha_knx_bridge/manifest.json +++ b/custom_components/ha_knx_bridge/manifest.json @@ -1,7 +1,7 @@ { "domain": "ha_knx_bridge", "name": "HA KNX Bridge", - "version": "0.0.31", + "version": "0.0.32", "config_flow": true, "documentation": "https://github.com/bahmcloud/HA-KNX-Bridge", "issue_tracker": "https://github.com/bahmcloud/HA-KNX-Bridge/issues",