diff --git a/src/ramses_tx/parsers.py b/src/ramses_tx/parsers.py index 5cef9bd2..26d7bb8d 100644 --- a/src/ramses_tx/parsers.py +++ b/src/ramses_tx/parsers.py @@ -1638,7 +1638,13 @@ def parser_22f3(payload: str, msg: Message) -> dict[str, Any]: # WIP: unknown, HVAC def parser_22f4(payload: str, msg: Message) -> dict[str, Any]: # HACK: for dev/test: 37:153226 is ClimaRad Ventura fan/remote - payload = payload[8:14] if msg.src.id == "37:153226" else payload[:6] + if msg.src.id == "37:153226": + if payload[10:12] == "60": + payload = payload[8:14] + else: + payload = payload[:4] + payload[12:14] + else: + payload = payload[:6] MODE_LOOKUP = { 0x00: "off?", diff --git a/src/ramses_tx/schemas.py b/src/ramses_tx/schemas.py index 0c97a6df..9e9b8de2 100644 --- a/src/ramses_tx/schemas.py +++ b/src/ramses_tx/schemas.py @@ -232,7 +232,7 @@ def convert_null_to_dict(node_value: _T | None) -> _T | dict[Never, Never]: SCH_DEVICE_ID_UFC = vol.Match(DEVICE_ID_REGEX.UFC) _SCH_TRAITS_DOMAINS = ("heat", "hvac") -_SCH_TRAITS_HVAC_SCHEMES = ("itho", "nuaire", "orcon") +_SCH_TRAITS_HVAC_SCHEMES = ("itho", "nuaire", "orcon", "climarad") DeviceTraitsT = TypedDict( diff --git a/tests/tests/parsers/code_22f4.log b/tests/tests/parsers/code_22f4.log index 34f9d73d..657b30e5 100644 --- a/tests/tests/parsers/code_22f4.log +++ b/tests/tests/parsers/code_22f4.log @@ -17,11 +17,11 @@ # ClimaRad Ventura V1x, see _22F4_MODE_CLIMARAD 2024-10-15T13:12:46.635997 000 RQ --- 18:130140 37:153226 --:------ 22F4 001 00 # {} -2024-10-15T13:12:46.657580 061 RP --- 37:153226 18:130140 --:------ 22F4 013 00403000000000000000000000 # {'fan_mode': 'off?', 'fan_rate': 'speed 0'} +2024-10-15T13:12:46.657580 061 RP --- 37:153226 18:130140 --:------ 22F4 013 00403000000000000000000000 # {'fan_mode': 'auto', 'fan_rate': 'speed 0'} # (SAME PAYLOAD) appears that payload may be an array? now/next? input/output? other? 2024-10-15T13:12:46.657580 061 RP --- 37:000001 18:130140 --:------ 22F4 013 00403000000000000000000000 # {'fan_mode': 'auto', 'fan_rate': 'speed 0'} -2024-01-01T01:00:00.000000 ... I --- 37:153226 --:------ 37:153226 22F4 013 00403000000000000000000000 # {'fan_mode': 'off?', 'fan_rate': 'speed 0'} +2024-01-01T01:00:00.000000 ... I --- 37:153226 --:------ 37:153226 22F4 013 00403000000000000000000000 # {'fan_mode': 'auto', 'fan_rate': 'speed 0'} 2024-01-01T01:00:00.000000 ... I --- 37:153226 --:------ 37:153226 22F4 013 000000000060C9000000000000 # {'fan_mode': 'manual', 'fan_rate': 'speed 1'} 2024-01-01T01:00:00.000000 ... I --- 37:153226 --:------ 37:153226 22F4 013 000000000060CA000000000000 # {'fan_mode': 'manual', 'fan_rate': 'speed 2'} 2024-01-01T01:00:00.000000 ... I --- 37:153226 --:------ 37:153226 22F4 013 000000000060CB000000000000 # {'fan_mode': 'manual', 'fan_rate': 'speed 3'}