From 84c011e7cbeb21932270ef97dfb5f00e5855e1f6 Mon Sep 17 00:00:00 2001 From: David Bonnes Date: Wed, 23 Oct 2024 07:54:19 +0100 Subject: [PATCH] tweak 0002 (wip) --- src/ramses_tx/parsers.py | 15 +++------------ src/ramses_tx/ramses.py | 3 +++ tests/tests/parsers/code_0002.log | 8 ++++++++ 3 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 tests/tests/parsers/code_0002.log diff --git a/src/ramses_tx/parsers.py b/src/ramses_tx/parsers.py index 45b81c8c..647f0f75 100644 --- a/src/ramses_tx/parsers.py +++ b/src/ramses_tx/parsers.py @@ -256,23 +256,14 @@ def parser_0001(payload: str, msg: Message) -> Mapping[str, bool | str | None]: # outdoor_sensor (outdoor_weather / outdoor_temperature) def parser_0002(payload: str, msg: Message) -> dict[str, Any]: - # seen with: 03:125829, 03:196221, 03:196196, 03:052382, 03:201498, 03:201565: - # .I 000 03:201565 --:------ 03:201565 0002 004 03020105 # no zone_idx, domain_id - - # is it CODE_IDX_COMPLEX: - # - 02...... for outside temp? - # - 03...... for other stuff? - - if msg.src.type == DEV_TYPE_MAP.HCW: # payload[2:] == DEV_TYPE_MAP.HCW, DEX - assert payload == "03020105" - return {"_unknown": payload} - - # if payload[6:] == "02": # msg.src.type == DEV_TYPE_MAP.OUT: + if payload[6:] == "02": # or: msg.src.type == DEV_TYPE_MAP.OUT: return { SZ_TEMPERATURE: hex_to_temp(payload[2:6]), "_unknown": payload[6:], } + return {"_payload": payload} + # zone_name def parser_0004(payload: str, msg: Message) -> PayDictT._0004: diff --git a/src/ramses_tx/ramses.py b/src/ramses_tx/ramses.py index ff18f09b..07fdf656 100644 --- a/src/ramses_tx/ramses.py +++ b/src/ramses_tx/ramses.py @@ -40,6 +40,9 @@ W_: r"^(0[0-9A-F]|FC|FF)000005(01|05)$", }, # TODO: there appears to be a dodgy? RQ/RP for UFC Code._0002: { # WIP: outdoor_sensor - CODE_IDX_COMPLEX? + # is it CODE_IDX_COMPLEX: + # - 02...... for outside temp? + # - 03...... for other stuff? SZ_NAME: "outdoor_sensor", I_: r"^0[0-4][0-9A-F]{4}(00|01|02|05)$", # Domoticz sends ^02!! RQ: r"^00$", # NOTE: sent by an RFG100 diff --git a/tests/tests/parsers/code_0002.log b/tests/tests/parsers/code_0002.log new file mode 100644 index 00000000..2124bcd8 --- /dev/null +++ b/tests/tests/parsers/code_0002.log @@ -0,0 +1,8 @@ +# seen with: 03:125829, 03:196221, 03:196196, 03:052382, 03:201498, 03:201565: ?no idx +2024-01-01T00:00:00.000000 067 I 000 03:201565 --:------ 03:201565 0002 004 03020105 # +2021-11-25T19:58:23.426059 061 I 000 03:196221 --:------ 03:196221 0002 004 03020105 + + +# ClimaRad Ventura V1x, only [4:6] 12 and 18 seen +2024-01-01T00:00:00.000000 063 I --- 37:153226 --:------ 37:153226 0002 004 00120005 # +2024-01-01T00:00:00.000000 063 I --- 37:153226 --:------ 37:153226 0002 004 00180005 # \ No newline at end of file