From 36d093409ecd30c9a57fafb29cd35c8a5fded4e4 Mon Sep 17 00:00:00 2001 From: Egbert Broerse Date: Thu, 17 Oct 2024 08:16:09 +0200 Subject: [PATCH 1/5] Tweak 10D0 parser for Vasco HVAC (#140) * 10d0 parser (no new logs) * schema, calculate days_remaining for Ventura * days_remaining comment Co-authored-by: David Bonnes * assume sentinel for remaining Co-authored-by: David Bonnes * Ventura filter counter parsed as % only --------- Co-authored-by: David Bonnes --- src/ramses_tx/parsers.py | 17 ++++++++++------- src/ramses_tx/ramses.py | 3 ++- tests/tests/parsers/code_10d0.log | 6 ++++++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/ramses_tx/parsers.py b/src/ramses_tx/parsers.py index 571a703cd..6f8c15d43 100644 --- a/src/ramses_tx/parsers.py +++ b/src/ramses_tx/parsers.py @@ -984,14 +984,17 @@ def parser_10d0(payload: str, msg: Message) -> dict[str, Any]: result: dict[str, bool | float | None] if msg.verb == W_: - result = {"reset_counter": payload[2:4] == "FF"} - else: - result = {"days_remaining": int(payload[2:4], 16)} + return {"reset_counter": payload[2:4] != "00"} - if msg.len >= 3: - result.update({"days_lifetime": int(payload[4:6], 16)}) - if msg.len >= 4: - result.update({"percent_remaining": hex_to_percent(payload[6:8])}) + result = {} + + if payload[2:4] not in ("FF", "FE"): + result["days_remaining"] = int(payload[2:4], 16) + + if payload[4:6] not in ("FF", "FE"): + result["days_lifetime"] = int(payload[4:6], 16) + + result["percent_remaining"] = hex_to_percent(payload[6:8]) return result diff --git a/src/ramses_tx/ramses.py b/src/ramses_tx/ramses.py index 26fa47ab0..66d18cd43 100644 --- a/src/ramses_tx/ramses.py +++ b/src/ramses_tx/ramses.py @@ -212,7 +212,7 @@ }, Code._10D0: { # filter_change - polling interval should be 1/day SZ_NAME: "filter_change", - I_: r"^00[0-9A-F]{6}(0000)?$", + I_: r"^00[0-9A-F]{6}(0000|FFFF)?$", RQ: r"^00(00)?$", W_: r"^00FF$", }, @@ -1094,6 +1094,7 @@ Code._0001: {RQ: {}}, # from a VMI (only?) Code._042F: {I_: {}}, # from a VMI (only?) Code._1060: {I_: {}}, + Code._10D0: {W_: {}}, # reset filter count from REM Code._10E0: {I_: {}, RQ: {}}, # RQ from a VMI (only?) Code._1470: {RQ: {}}, # from a VMI (only?) Code._1FC9: {I_: {}}, diff --git a/tests/tests/parsers/code_10d0.log b/tests/tests/parsers/code_10d0.log index a7e53534a..73d0c51f4 100644 --- a/tests/tests/parsers/code_10d0.log +++ b/tests/tests/parsers/code_10d0.log @@ -3,6 +3,12 @@ 2022-07-03T22:52:34.571579 045 W --- 37:171871 32:155617 --:------ 10D0 002 00FF # {'reset_counter': True} 2022-07-03T22:52:34.596526 066 I --- 32:155617 37:171871 --:------ 10D0 006 0047B44F0000 # {'days_remaining': 71, 'days_lifetime': 180, 'percent_remaining': 0.395} +2024-10-15 12:33:55.595000 000 RQ --- 18:130140 32:022222 --:------ 10D0 001 00 # {} +2024-10-15 12:33:55.609000 --- RP --- 32:022222 18:130140 --:------ 10D0 006 00A9B6B90000 # {'days_remaining': 169, 'days_lifetime': 182, 'percent_remaining': 0.925} + +2024-10-15T12:33:13.714200 000 RQ --- 18:130140 37:153226 --:------ 10D0 001 00 # {} +2024-10-15T12:33:13.731547 060 RP --- 37:153226 18:130140 --:------ 10D0 006 00FEFE79FFFF # {'percent_remaining': 0.605} + 2022-07-03T23:14:23.854089 000 RQ --- 37:155617 32:155617 --:------ 10D0 002 0000 # {} 2022-07-03T23:14:23.876088 084 RP --- 32:155617 37:155617 --:------ 10D0 006 00B4B4C80000 # {'days_remaining': 180, 'days_lifetime': 180, 'percent_remaining': 1.000} From eb0b436e557146cdbaab82b6e40b0099b478c678 Mon Sep 17 00:00:00 2001 From: Egbert Broerse Date: Thu, 17 Oct 2024 08:37:25 +0200 Subject: [PATCH 2/5] HRU 3150 report (#141) --- tests/tests/parsers/code_3150.log | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/tests/parsers/code_3150.log b/tests/tests/parsers/code_3150.log index 304ffa36f..25af440d1 100644 --- a/tests/tests/parsers/code_3150.log +++ b/tests/tests/parsers/code_3150.log @@ -24,3 +24,6 @@ 2021-11-28T14:54:25.139800 ... I --- 02:123456 --:------ 02:123456 3150 002 00A2 # {"has_array": True, "has_idx": True , "has_payload": True , "is_fragment": False} 2021-05-23T04:43:12.702136 ... I --- 02:123456 --:------ 01:555555 3150 002 002C # {"has_array": False, "has_idx": '00' , "has_payload": True , "is_fragment": False} 2021-01-29T20:51:48.968664 075 I --- 02:000921 --:------ 01:191718 3150 002 06C4 # {"has_array": False, "has_idx": '06' , "has_payload": True , "is_fragment": False} + +# VenturaV1x (VMD-07RPS13, no heater, only HRU) +2024-10-14T20:59:09.716874 060 I --- 37:153226 --:------ 37:153226 3150 006 00F201F202F2 # [{'zone_idx': '00', 'heat_demand_fault': 'unavailable'}, {'zone_idx': '01', 'heat_demand_fault': 'unavailable'}, {'zone_idx': '02', 'heat_demand_fault': 'unavailable'}] From 94bb05a996b35041dfadc09cf4af97d30097f118 Mon Sep 17 00:00:00 2001 From: David Bonnes Date: Thu, 17 Oct 2024 07:55:57 +0100 Subject: [PATCH 3/5] tweak 042F --- src/ramses_tx/parsers.py | 9 ------- tests/tests/parsers/code_042f_wip.log | 39 +++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 tests/tests/parsers/code_042f_wip.log diff --git a/src/ramses_tx/parsers.py b/src/ramses_tx/parsers.py index 6f8c15d43..3a3f45c1c 100644 --- a/src/ramses_tx/parsers.py +++ b/src/ramses_tx/parsers.py @@ -812,15 +812,6 @@ def parser_0418(payload: str, msg: Message) -> PayDictT._0418 | PayDictT._0418_N # unknown_042f, from STA, VMS def parser_042f(payload: str, msg: Message) -> dict[str, Any]: - # .I --- 34:064023 --:------ 34:064023 042F 008 00-0000-0023-0023-F5 - # .I --- 34:064023 --:------ 34:064023 042F 008 00-0000-0024-0024-F5 - # .I --- 34:064023 --:------ 34:064023 042F 008 00-0000-0025-0025-F5 - # .I --- 34:064023 --:------ 34:064023 042F 008 00-0000-0026-0026-F5 - # .I --- 34:092243 --:------ 34:092243 042F 008 00-0001-0021-0022-01 - # .I --- 34:011469 --:------ 34:011469 042F 008 00-0001-0003-0004-BC - - # .I --- 32:168090 --:------ 32:168090 042F 009 00-0000100F00105050 - # .I --- 32:166025 --:------ 32:166025 042F 009 00-050E0B0C00111470 return { "counter_1": f"0x{payload[2:6]}", diff --git a/tests/tests/parsers/code_042f_wip.log b/tests/tests/parsers/code_042f_wip.log new file mode 100644 index 000000000..002e90e8f --- /dev/null +++ b/tests/tests/parsers/code_042f_wip.log @@ -0,0 +1,39 @@ +### Heat +2024-01-01T12:00:00.000000 --- I --- 34:064023 --:------ 34:064023 042F 008 00000000230023F5 +2024-01-01T12:00:00.000000 --- I --- 34:064023 --:------ 34:064023 042F 008 00000000240024F5 +2024-01-01T12:00:00.000000 --- I --- 34:064023 --:------ 34:064023 042F 008 00000000250025F5 +2024-01-01T12:00:00.000000 --- I --- 34:064023 --:------ 34:064023 042F 008 00000000260026F5 +2024-01-01T12:00:00.000000 --- I --- 34:092243 --:------ 34:092243 042F 008 0000010021002201 +2024-01-01T12:00:00.000000 --- I --- 34:011469 --:------ 34:011469 042F 008 00000100030004BC + +2024-01-01T12:00:00.000000 --- I --- 32:168090 --:------ 32:168090 042F 009 000000100F00105050 +2024-01-01T12:00:00.000000 --- I --- 32:166025 --:------ 32:166025 042F 009 00050E0B0C00111470 + + + +### HVAC, see: https://github.com/zxdavb/ramses_rf/pull/135 + +# disconnect all - 10 sec on touch bottom right: +2024-10-09T11:50:24.287879 065 RQ --- 37:117647 32:022222 --:------ 22F1 001 00 +2024-10-09T11:50:25.304920 063 RQ --- 37:117647 32:022222 --:------ 22F1 001 00 +2024-10-09T11:50:26.326969 060 RQ --- 37:117647 32:022222 --:------ 22F1 001 00 +2024-10-09T11:50:37.839476 068 I --- 37:117647 --:------ 37:117647 042F 009 00012521250026C870 +2024-10-09T11:50:40.936596 071 RQ --- 37:117647 32:022222 --:------ 22F1 001 00 +2024-10-09T11:50:41.963654 070 RQ --- 37:117647 32:022222 --:------ 22F1 001 00 +2024-10-09T11:50:54.902520 064 W --- 37:117647 32:022222 --:------ 1FCA 009 0001FF95CB8FFFFFFF +2024-10-09T11:50:55.918057 067 W --- 37:117647 32:022222 --:------ 1FCA 009 0001FF95CB8FFFFFFF +2024-10-09T11:50:57.755704 061 I --- 37:117647 --:------ 37:117647 042F 009 00022521250027F080 +2024-10-09T11:51:49.472184 059 I --- 37:117647 63:262142 --:------ 10E0 038 000001C822060166FEFFFFFFFFFF160C07E0564D532D31374330310000000000000000000000 + +# connect - 3 sec on touch bottom right (D60 off): +2024-10-09T10:33:53.714590 057 I --- 37:117647 32:022222 --:------ 31E0 004 00000000 +2024-10-09T10:34:50.432196 067 I --- 37:117647 --:------ 37:117647 042F 009 00012420240025C870 +2024-10-09T10:34:54.556484 065 RQ --- 37:117647 32:022222 --:------ 22F1 001 00 +2024-10-09T10:34:55.573584 063 RQ --- 37:117647 32:022222 --:------ 22F1 001 00 +2024-10-09T10:35:02.278347 066 I --- 37:117647 63:262142 --:------ 1FC9 030 0031E095CB8F00129895CB8F0022F195CB8F6610E095CB8F001FC995CB8F +2024-10-09T10:35:04.342107 060 I --- 37:117647 63:262142 --:------ 1FC9 030 0031E095CB8F00129895CB8F0022F195CB8F6610E095CB8F001FC995CB8F +2024-10-09T10:35:09.245476 060 RQ --- 37:117647 32:022222 --:------ 22F1 001 00 +2024-10-09T10:35:10.257671 058 RQ --- 37:117647 32:022222 --:------ 22F1 001 00 +2024-10-09T10:35:11.269793 056 RQ --- 37:117647 32:022222 --:------ 22F1 001 00 + + From b5152bc53105ba5993a5f74f9b6a09f1743d57ee Mon Sep 17 00:00:00 2001 From: David Bonnes Date: Thu, 17 Oct 2024 08:00:34 +0100 Subject: [PATCH 4/5] lint --- src/ramses_tx/parsers.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ramses_tx/parsers.py b/src/ramses_tx/parsers.py index 3a3f45c1c..13b8c7a90 100644 --- a/src/ramses_tx/parsers.py +++ b/src/ramses_tx/parsers.py @@ -812,7 +812,6 @@ def parser_0418(payload: str, msg: Message) -> PayDictT._0418 | PayDictT._0418_N # unknown_042f, from STA, VMS def parser_042f(payload: str, msg: Message) -> dict[str, Any]: - return { "counter_1": f"0x{payload[2:6]}", "counter_3": f"0x{payload[6:10]}", From 55cfce6c57713e8d6f75e23db032ac95c51cb501 Mon Sep 17 00:00:00 2001 From: David Bonnes Date: Thu, 17 Oct 2024 08:19:21 +0100 Subject: [PATCH 5/5] tweak 042F --- tests/tests/parsers/{code_042f_wip.log => code_042f.log} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename tests/tests/parsers/{code_042f_wip.log => code_042f.log} (95%) diff --git a/tests/tests/parsers/code_042f_wip.log b/tests/tests/parsers/code_042f.log similarity index 95% rename from tests/tests/parsers/code_042f_wip.log rename to tests/tests/parsers/code_042f.log index 002e90e8f..9df2c10de 100644 --- a/tests/tests/parsers/code_042f_wip.log +++ b/tests/tests/parsers/code_042f.log @@ -20,8 +20,8 @@ 2024-10-09T11:50:37.839476 068 I --- 37:117647 --:------ 37:117647 042F 009 00012521250026C870 2024-10-09T11:50:40.936596 071 RQ --- 37:117647 32:022222 --:------ 22F1 001 00 2024-10-09T11:50:41.963654 070 RQ --- 37:117647 32:022222 --:------ 22F1 001 00 -2024-10-09T11:50:54.902520 064 W --- 37:117647 32:022222 --:------ 1FCA 009 0001FF95CB8FFFFFFF -2024-10-09T11:50:55.918057 067 W --- 37:117647 32:022222 --:------ 1FCA 009 0001FF95CB8FFFFFFF +# 24-10-09T11:50:54.902520 064 W --- 37:117647 32:022222 --:------ 1FCA 009 0001FF95CB8FFFFFFF +# 24-10-09T11:50:55.918057 067 W --- 37:117647 32:022222 --:------ 1FCA 009 0001FF95CB8FFFFFFF 2024-10-09T11:50:57.755704 061 I --- 37:117647 --:------ 37:117647 042F 009 00022521250027F080 2024-10-09T11:51:49.472184 059 I --- 37:117647 63:262142 --:------ 10E0 038 000001C822060166FEFFFFFFFFFF160C07E0564D532D31374330310000000000000000000000