diff --git a/src/ramses_tx/parsers.py b/src/ramses_tx/parsers.py index 5cef9bd2..3f38fd97 100644 --- a/src/ramses_tx/parsers.py +++ b/src/ramses_tx/parsers.py @@ -1947,12 +1947,17 @@ def parser_2e04(payload: str, msg: Message) -> PayDictT._2E04: return result # TODO: double-check the final "00" -# presence_detect, HVAC sensor +# presence_detect, HVAC sensor, or Timed boost for Vasco D60 def parser_2e10(payload: str, msg: Message) -> dict[str, Any]: - assert payload in ("0001", "000100"), _INFORM_DEV_MSG - + presence: str | int + if msg.src.type == "37": # ClimaRad VenturaV1x FAN + assert payload in ("000000", "000100"), _INFORM_DEV_MSG + presence = int(payload[2:4]) + else: + assert payload in ("0001", "000100"), _INFORM_DEV_MSG + presence = payload[2:4] return { - "presence_detected": bool(payload[2:4]), + "presence_detected": bool(presence), "_unknown_4": payload[4:], } diff --git a/tests/tests/parsers/code_2e10_wip.log b/tests/tests/parsers/code_2e10_wip.log index 67a205f4..054b1098 100644 --- a/tests/tests/parsers/code_2e10_wip.log +++ b/tests/tests/parsers/code_2e10_wip.log @@ -8,3 +8,7 @@ 2023-11-04T17:38:34.781338 067 I 024 21:052764 --:------ 21:052764 2E10 002 0001 # {'presence_detected': True, '_unknown_4': '', 'seqx_num': '024'} 2023-11-04T17:38:34.867259 067 I 024 21:052764 --:------ 21:052764 2E10 002 0001 # {'presence_detected': True, '_unknown_4': '', 'seqx_num': '024'} 2023-11-04T17:38:34.942291 068 I 024 21:052764 --:------ 21:052764 2E10 002 0001 # {'presence_detected': True, '_unknown_4': '', 'seqx_num': '024'} + +# ClimaRad VenturaV1x reporting, no option for presence detection, eg. just 1 change in 24 h @ 7PM +2024-10-14T19:59:07.786056 070 I --- 37:153226 --:------ 37:153226 2E10 003 000000 # {'_unknown_4': '00', 'presence_detected': False} +2024-10-10T17:57:21.140055 068 I --- 37:153226 --:------ 37:153226 2E10 003 000100 # {'_unknown_4': '00', 'presence_detected': True}