From 885d808e337b0c4abbcf1d39d50525decbdcb309 Mon Sep 17 00:00:00 2001 From: Egbert Broerse Date: Mon, 14 Oct 2024 21:08:55 +0200 Subject: [PATCH 1/6] 22f3 parser + logs --- src/ramses_tx/parsers.py | 21 +++++++++++++++------ src/ramses_tx/ramses.py | 9 ++++++--- tests/tests/parsers/code_22f3.log | 3 +++ 3 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 tests/tests/parsers/code_22f3.log diff --git a/src/ramses_tx/parsers.py b/src/ramses_tx/parsers.py index 571a703c..907752ce 100644 --- a/src/ramses_tx/parsers.py +++ b/src/ramses_tx/parsers.py @@ -1602,10 +1602,14 @@ def parser_22f3(payload: str, msg: Message) -> dict[str, Any]: # .I 019 --:------ --:------ 39:159057 22F3 003 00000A # 10 mins # .I 022 --:------ --:------ 39:159057 22F3 003 000014 # 20 mins # .I 026 --:------ --:------ 39:159057 22F3 003 00001E # 30 mins - # .I --- 29:151550 29:237552 --:------ 22F3 007 00023C-0304-0000 # 60 mins + # .I --- 29:151550 29:237552 --:------ 22F3 007 00023C-0304-0000 # 60 mins (0x3C) # .I --- 29:162374 29:237552 --:------ 22F3 007 00020F-0304-0000 # 15 mins # .I --- 29:162374 29:237552 --:------ 22F3 007 00020F-0304-0000 # 15 mins + # Vasco REM boost command includes cmd 06: + # .I --- 29:123150 29:099029 --:------ 22F3 007 00021E-0406-0000 # 20 mins (0x1E) + # ClimaRad 4-button remote + # .I --- 29:123150 29:099029 --:------ 22F3 007 00020F-0006-0000 ("unknown fan_mode: 00") # NOTE: for boost timer for high try: # assert payload[2:4] in ("00", "02", "12", "x52"), f"byte 1: {flag8(payload[2:4])}" @@ -1619,11 +1623,15 @@ def parser_22f3(payload: str, msg: Message) -> dict[str, Any]: 0x02: "per_vent_speed", # set fan as per current fan mode/speed? }.get(int(payload[2:4], 0x10) & 0x07) # 0b0000-0111 - fallback_speed = { # after timer expiry - 0x08: "fan_off", # # set fan off? - 0x10: "per_request", # # set fan as per payload[6:10], or payload[10:]? - 0x18: "per_vent_speed", # set fan as per current fan mode/speed? - }.get(int(payload[2:4], 0x10) & 0x38) # 0b0011-1000 + if msg.len == 7 and payload[9:10] == "06": # Vasco and ClimaRad REM + fallback_speed = "per_vent_speed" # after timer expiry + # set fan as per current fan mode/speed + else: + fallback_speed = { # after timer expiry + 0x08: "fan_off", # # set fan off? + 0x10: "per_request", # # set fan as per payload[6:10], or payload[10:]? + 0x18: "per_vent_speed", # set fan as per current fan mode/speed? + }.get(int(payload[2:4], 0x10) & 0x38) # 0b0011-1000 units = { 0x00: "minutes", @@ -1632,6 +1640,7 @@ def parser_22f3(payload: str, msg: Message) -> dict[str, Any]: }.get(int(payload[2:4], 0x10) & 0xC0) # 0b1100-0000 duration = int(payload[4:6], 16) * 60 if units == "hours" else int(payload[4:6], 16) + result = {} if msg.len >= 3: result = { diff --git a/src/ramses_tx/ramses.py b/src/ramses_tx/ramses.py index 26fa47ab..6927fbe4 100644 --- a/src/ramses_tx/ramses.py +++ b/src/ramses_tx/ramses.py @@ -416,10 +416,13 @@ }, Code._22F3: { # fan_boost, HVAC SZ_NAME: "fan_boost", - I_: r"^(00|63)[0-9A-F]{4}([0-9A-F]{8})?$", + I_: r"^(00|63)(021E)?[0-9A-F]{4}([0-9A-F]{8})?$", # VASCO D60 HRU: .I + 22F3 007 00 021E 0406 0000 (a timer) }, # minutes only? - Code._22F4: { # unknown_22f4, HVAC, NB: no I - SZ_NAME: "unknown_22f4", + Code._22F4: { # unknown_22f4, HVAC + # .I + 22F4 013 00 40 30 0000 00 00 000000000000 (ClimaRad Ventura - mode Auto) + # .I + 22F4 013 00 00 00 0000 60 C9 000000000000 (ClimaRad Ventura - speed 1) + SZ_NAME: "unknown_22f4", # TODO rename? + I_: r"^00[0-9A-F]{4}(0000)[0-9A-F]{4}(00){6}$", RQ: r"^00$", RP: r"^00[0-9A-F]{24}$", }, diff --git a/tests/tests/parsers/code_22f3.log b/tests/tests/parsers/code_22f3.log new file mode 100644 index 00000000..25c71d92 --- /dev/null +++ b/tests/tests/parsers/code_22f3.log @@ -0,0 +1,3 @@ + +# Vasco remote (VMN-17LMP01): +2024-10-14T20:51:11.263018 049 I --- 29:091138 32:022222 --:------ 22F3 007 00021E04060000 # {'minutes': 30, 'flags': [0, 0, 0, 0, 0, 0, 1, 0], '_new_speed_mode': 'per_vent_speed', '_fallback_speed_mode': None, 'rate': None, '_unknown_5': '0000'} From ae39c13ea0a8721016b906a9635831f68d937da8 Mon Sep 17 00:00:00 2001 From: Egbert Broerse Date: Wed, 16 Oct 2024 23:03:26 +0200 Subject: [PATCH 2/6] rollback 22f4 changes --- src/ramses_tx/ramses.py | 7 ++----- tests/tests/parsers/code_22f3.log | 8 ++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ramses_tx/ramses.py b/src/ramses_tx/ramses.py index 6927fbe4..47807147 100644 --- a/src/ramses_tx/ramses.py +++ b/src/ramses_tx/ramses.py @@ -418,11 +418,8 @@ SZ_NAME: "fan_boost", I_: r"^(00|63)(021E)?[0-9A-F]{4}([0-9A-F]{8})?$", # VASCO D60 HRU: .I + 22F3 007 00 021E 0406 0000 (a timer) }, # minutes only? - Code._22F4: { # unknown_22f4, HVAC - # .I + 22F4 013 00 40 30 0000 00 00 000000000000 (ClimaRad Ventura - mode Auto) - # .I + 22F4 013 00 00 00 0000 60 C9 000000000000 (ClimaRad Ventura - speed 1) - SZ_NAME: "unknown_22f4", # TODO rename? - I_: r"^00[0-9A-F]{4}(0000)[0-9A-F]{4}(00){6}$", + Code._22F4: { # unknown_22f4, HVAC, NB: no I + SZ_NAME: "unknown_22f4", RQ: r"^00$", RP: r"^00[0-9A-F]{24}$", }, diff --git a/tests/tests/parsers/code_22f3.log b/tests/tests/parsers/code_22f3.log index 25c71d92..b0a36f9d 100644 --- a/tests/tests/parsers/code_22f3.log +++ b/tests/tests/parsers/code_22f3.log @@ -1,3 +1,11 @@ # Vasco remote (VMN-17LMP01): 2024-10-14T20:51:11.263018 049 I --- 29:091138 32:022222 --:------ 22F3 007 00021E04060000 # {'minutes': 30, 'flags': [0, 0, 0, 0, 0, 0, 1, 0], '_new_speed_mode': 'per_vent_speed', '_fallback_speed_mode': None, 'rate': None, '_unknown_5': '0000'} +# repeated 5 times total + +# ClimaRad 4-button remote boost +2024-10-14T08:50:34.322538 072 I --- 29:123150 29:099029 --:------ 22F3 007 00021E04060000 # {'minutes': 30, 'flags': [0, 0, 0, 0, 0, 0, 1, 0], '_new_speed_mode': 'per_vent_speed', '_fallback_speed_mode': None, 'rate': None, '_unknown_5': '0000'} # 20 mins +# repeated 2 times total but that could be caused by reception/confirm problem. LED is slow to confirm + +# curious 22f3 packet +# .I --- 29:123150 29:099029 --:------ 22F3 007 00020F00060000 # {} # ("unknown fan_mode: 00") From 97bb127091d3849fcc18c6462ee9df1a0572a184 Mon Sep 17 00:00:00 2001 From: Egbert Broerse Date: Wed, 16 Oct 2024 23:11:42 +0200 Subject: [PATCH 3/6] type fallback_speed in 22f3 --- src/ramses_tx/parsers.py | 7 ++----- tests/tests/parsers/code_22f3.log | 8 ++++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/ramses_tx/parsers.py b/src/ramses_tx/parsers.py index 907752ce..42b7b735 100644 --- a/src/ramses_tx/parsers.py +++ b/src/ramses_tx/parsers.py @@ -1602,14 +1602,10 @@ def parser_22f3(payload: str, msg: Message) -> dict[str, Any]: # .I 019 --:------ --:------ 39:159057 22F3 003 00000A # 10 mins # .I 022 --:------ --:------ 39:159057 22F3 003 000014 # 20 mins # .I 026 --:------ --:------ 39:159057 22F3 003 00001E # 30 mins - # .I --- 29:151550 29:237552 --:------ 22F3 007 00023C-0304-0000 # 60 mins (0x3C) + # .I --- 29:151550 29:237552 --:------ 22F3 007 00023C-0304-0000 # 60 mins # .I --- 29:162374 29:237552 --:------ 22F3 007 00020F-0304-0000 # 15 mins # .I --- 29:162374 29:237552 --:------ 22F3 007 00020F-0304-0000 # 15 mins - # Vasco REM boost command includes cmd 06: - # .I --- 29:123150 29:099029 --:------ 22F3 007 00021E-0406-0000 # 20 mins (0x1E) - # ClimaRad 4-button remote - # .I --- 29:123150 29:099029 --:------ 22F3 007 00020F-0006-0000 ("unknown fan_mode: 00") # NOTE: for boost timer for high try: # assert payload[2:4] in ("00", "02", "12", "x52"), f"byte 1: {flag8(payload[2:4])}" @@ -1623,6 +1619,7 @@ def parser_22f3(payload: str, msg: Message) -> dict[str, Any]: 0x02: "per_vent_speed", # set fan as per current fan mode/speed? }.get(int(payload[2:4], 0x10) & 0x07) # 0b0000-0111 + fallback_speed: str | None if msg.len == 7 and payload[9:10] == "06": # Vasco and ClimaRad REM fallback_speed = "per_vent_speed" # after timer expiry # set fan as per current fan mode/speed diff --git a/tests/tests/parsers/code_22f3.log b/tests/tests/parsers/code_22f3.log index b0a36f9d..0a2b03ff 100644 --- a/tests/tests/parsers/code_22f3.log +++ b/tests/tests/parsers/code_22f3.log @@ -1,11 +1,11 @@ -# Vasco remote (VMN-17LMP01): +# Vasco remote (VMN-17LMP01) boost 2024-10-14T20:51:11.263018 049 I --- 29:091138 32:022222 --:------ 22F3 007 00021E04060000 # {'minutes': 30, 'flags': [0, 0, 0, 0, 0, 0, 1, 0], '_new_speed_mode': 'per_vent_speed', '_fallback_speed_mode': None, 'rate': None, '_unknown_5': '0000'} # repeated 5 times total -# ClimaRad 4-button remote boost -2024-10-14T08:50:34.322538 072 I --- 29:123150 29:099029 --:------ 22F3 007 00021E04060000 # {'minutes': 30, 'flags': [0, 0, 0, 0, 0, 0, 1, 0], '_new_speed_mode': 'per_vent_speed', '_fallback_speed_mode': None, 'rate': None, '_unknown_5': '0000'} # 20 mins +# ClimaRad 4-button remote boost, lasts 20 mins +2024-10-14T08:50:34.322538 072 I --- 29:123150 29:099029 --:------ 22F3 007 00021E04060000 # {'minutes': 30, 'flags': [0, 0, 0, 0, 0, 0, 1, 0], '_new_speed_mode': 'per_vent_speed', '_fallback_speed_mode': None, 'rate': None, '_unknown_5': '0000'} # repeated 2 times total but that could be caused by reception/confirm problem. LED is slow to confirm -# curious 22f3 packet +# curious 22f3 packet: invalid button combi pressed? # .I --- 29:123150 29:099029 --:------ 22F3 007 00020F00060000 # {} # ("unknown fan_mode: 00") From 834689aff72dd9dfddf486cb94a6bb8bac346b64 Mon Sep 17 00:00:00 2001 From: Egbert Broerse Date: Thu, 17 Oct 2024 23:11:55 +0200 Subject: [PATCH 4/6] cleun up log --- tests/tests/parsers/code_22f3.log | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/tests/parsers/code_22f3.log b/tests/tests/parsers/code_22f3.log index 0a2b03ff..10372151 100644 --- a/tests/tests/parsers/code_22f3.log +++ b/tests/tests/parsers/code_22f3.log @@ -1,6 +1,5 @@ - # Vasco remote (VMN-17LMP01) boost -2024-10-14T20:51:11.263018 049 I --- 29:091138 32:022222 --:------ 22F3 007 00021E04060000 # {'minutes': 30, 'flags': [0, 0, 0, 0, 0, 0, 1, 0], '_new_speed_mode': 'per_vent_speed', '_fallback_speed_mode': None, 'rate': None, '_unknown_5': '0000'} +2024-10-14T20:51:11.263018 049 I --- 29:091138 32:022222 --:------ 22F3 007 00021E04060000 # {'minutes': 30, 'flags': [0, 0, 0, 0, 0, 0, 1, 0], '_new_speed_mode': 'per_vent_speed', '_fallback_speed_mode': None, 'rate': None, '_unknown_5': '0000'} # repeated 5 times total # ClimaRad 4-button remote boost, lasts 20 mins @@ -8,4 +7,4 @@ # repeated 2 times total but that could be caused by reception/confirm problem. LED is slow to confirm # curious 22f3 packet: invalid button combi pressed? -# .I --- 29:123150 29:099029 --:------ 22F3 007 00020F00060000 # {} # ("unknown fan_mode: 00") +# .I --- 29:123150 29:099029 --:------ 22F3 007 00020F00060000 # {} # ("unknown fan_mode: 00") From b8ea06b696ff62a237ac464b589edf056418dd34 Mon Sep 17 00:00:00 2001 From: Egbert Broerse Date: Sun, 20 Oct 2024 14:56:59 +0200 Subject: [PATCH 5/6] move packets from code to 22f3 log --- src/ramses_tx/parsers.py | 7 ------- src/ramses_tx/ramses.py | 2 +- tests/tests/parsers/code_22f3.log | 9 ++++++++- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ramses_tx/parsers.py b/src/ramses_tx/parsers.py index fef36b75..e5edab99 100644 --- a/src/ramses_tx/parsers.py +++ b/src/ramses_tx/parsers.py @@ -1592,13 +1592,6 @@ def _parser(seqx: str) -> dict: # fan_boost, HVAC def parser_22f3(payload: str, msg: Message) -> dict[str, Any]: - # .I 019 --:------ --:------ 39:159057 22F3 003 00000A # 10 mins - # .I 022 --:------ --:------ 39:159057 22F3 003 000014 # 20 mins - # .I 026 --:------ --:------ 39:159057 22F3 003 00001E # 30 mins - # .I --- 29:151550 29:237552 --:------ 22F3 007 00023C-0304-0000 # 60 mins - # .I --- 29:162374 29:237552 --:------ 22F3 007 00020F-0304-0000 # 15 mins - # .I --- 29:162374 29:237552 --:------ 22F3 007 00020F-0304-0000 # 15 mins - # NOTE: for boost timer for high try: # assert payload[2:4] in ("00", "02", "12", "x52"), f"byte 1: {flag8(payload[2:4])}" diff --git a/src/ramses_tx/ramses.py b/src/ramses_tx/ramses.py index 3e68c61f..47c72f6d 100644 --- a/src/ramses_tx/ramses.py +++ b/src/ramses_tx/ramses.py @@ -417,7 +417,7 @@ }, Code._22F3: { # fan_boost, HVAC SZ_NAME: "fan_boost", - I_: r"^(00|63)(021E)?[0-9A-F]{4}([0-9A-F]{8})?$", # VASCO D60 HRU: .I + 22F3 007 00 021E 0406 0000 (a timer) + I_: r"^(00|63)(021E)?[0-9A-F]{4}([0-9A-F]{8})?$", }, # minutes only? Code._22F4: { # unknown_22f4, HVAC SZ_NAME: "unknown_22f4", diff --git a/tests/tests/parsers/code_22f3.log b/tests/tests/parsers/code_22f3.log index 10372151..3cb20d12 100644 --- a/tests/tests/parsers/code_22f3.log +++ b/tests/tests/parsers/code_22f3.log @@ -1,3 +1,10 @@ +2024-01-01T01:00:00.000000 ... I 019 --:------ --:------ 39:159057 22F3 003 00000A # 10 mins +2024-01-01T01:00:00.000000 ... I 022 --:------ --:------ 39:159057 22F3 003 000014 # 20 mins +2024-01-01T01:00:00.000000 ... I 026 --:------ --:------ 39:159057 22F3 003 00001E # 30 mins +2024-01-01T01:00:00.000000 ... I --- 29:151550 29:237552 --:------ 22F3 007 00023C03040000 # 60 mins +2024-01-01T01:00:00.000000 ... I --- 29:162374 29:237552 --:------ 22F3 007 00020F03040000 # 15 mins +2024-01-01T01:00:00.000000 ... I --- 29:162374 29:237552 --:------ 22F3 007 00020F03040000 # 15 mins + # Vasco remote (VMN-17LMP01) boost 2024-10-14T20:51:11.263018 049 I --- 29:091138 32:022222 --:------ 22F3 007 00021E04060000 # {'minutes': 30, 'flags': [0, 0, 0, 0, 0, 0, 1, 0], '_new_speed_mode': 'per_vent_speed', '_fallback_speed_mode': None, 'rate': None, '_unknown_5': '0000'} # repeated 5 times total @@ -7,4 +14,4 @@ # repeated 2 times total but that could be caused by reception/confirm problem. LED is slow to confirm # curious 22f3 packet: invalid button combi pressed? -# .I --- 29:123150 29:099029 --:------ 22F3 007 00020F00060000 # {} # ("unknown fan_mode: 00") +2024-01-01T01:00:00.000000 123 I --- 29:123150 29:099029 --:------ 22F3 007 00020F00060000 # {'minutes': 15, 'flags': [0, 0, 0, 0, 0, 0, 1, 0], '_new_speed_mode': 'per_vent_speed', '_fallback_speed_mode': None, 'rate': None, '_unknown_5': '0000'} From 440915f7b98f1444120a57c8bdd11be886e8c8ea Mon Sep 17 00:00:00 2001 From: Egbert Broerse Date: Sun, 3 Nov 2024 20:47:29 +0100 Subject: [PATCH 6/6] remove assert --- 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 675f94fc..75c2eeae 100644 --- a/src/ramses_tx/parsers.py +++ b/src/ramses_tx/parsers.py @@ -1585,7 +1585,6 @@ def _parser(seqx: str) -> dict: def parser_22f3(payload: str, msg: Message) -> dict[str, Any]: # NOTE: for boost timer for high try: - # assert payload[2:4] in ("00", "02", "12", "x52"), f"byte 1: {flag8(payload[2:4])}" assert msg.len <= 7 or payload[14:] == "0000", f"byte 7: {payload[14:]}" except AssertionError as err: _LOGGER.warning(f"{msg!r} < {_INFORM_DEV_MSG} ({err})")