Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/zxdavb/ramses_rf into eb-…
Browse files Browse the repository at this point in the history
…22F1
  • Loading branch information
silverailscolo committed Oct 18, 2024
2 parents 0dc17c8 + 79b2ee7 commit 1a2e3cf
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 38 deletions.
31 changes: 11 additions & 20 deletions src/ramses_tx/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,16 +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]}",
"counter_3": f"0x{payload[6:10]}",
Expand Down Expand Up @@ -984,14 +974,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

Expand Down Expand Up @@ -2472,9 +2465,7 @@ def complex_idx(payload: str, msg: Message) -> dict: # has complex idx


# actuator_state
def parser_3ef0(
payload: str, msg: Message
) -> PayDictT._3EF0_3 | PayDictT._3EF0_6 | PayDictT._3EF0_9 | PayDictT._JASPER:
def parser_3ef0(payload: str, msg: Message) -> PayDictT._3EF0 | PayDictT._JASPER:
result: dict[str, Any]

if msg.src.type == DEV_TYPE_MAP.JIM: # Honeywell Jasper
Expand Down
4 changes: 3 additions & 1 deletion src/ramses_tx/ramses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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$",
},
Expand Down Expand Up @@ -273,6 +273,7 @@
Code._1298: { # co2_level
SZ_NAME: "co2_level",
I_: r"^00[0-9A-F]{4}$",
RQ: r"^00$",
},
Code._12A0: { # indoor_humidity
# .I --- 32:168090 --:------ 32:168090 12A0 006 0030093504A8
Expand Down Expand Up @@ -1096,6 +1097,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_: {}},
Expand Down
21 changes: 4 additions & 17 deletions src/ramses_tx/typed_dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,12 @@ class _3b00(TypedDict):
actuator_sync: bool | None


class _3ef0_3(TypedDict):
class _3ef0_3(TypedDict): # payload of 3 bytes
modulation_level: float | None
_flags_2: str


class _3ef0_6(TypedDict):
modulation_level: float | None
_flags_2: str
class _3ef0_6(_3ef0_3): # payload of 6 bytes
_flags_3: list[int]
ch_active: bool
dhw_active: bool
Expand All @@ -229,16 +227,7 @@ class _3ef0_6(TypedDict):
_unknown_5: str


class _3ef0_9(TypedDict):
modulation_level: float | None
_flags_2: str
_flags_3: list[int]
ch_active: bool
dhw_active: bool
cool_active: bool
flame_on: bool
_unknown_4: str
_unknown_5: str
class _3ef0_9(_3ef0_6): # payload of 9 bytes
_flags_6: list[int]
ch_enabled: bool
ch_setpoint: int
Expand Down Expand Up @@ -442,9 +431,7 @@ class PayDictT:
_3200: TypeAlias = _Temperature
_3210: TypeAlias = _Temperature
_3B00: TypeAlias = _3b00
_3EF0_3: TypeAlias = _3ef0_3
_3EF0_6: TypeAlias = _3ef0_6
_3EF0_9: TypeAlias = _3ef0_9
_3EF0: TypeAlias = _3ef0_3 | _3ef0_6 | _3ef0_9
_3EF1: TypeAlias = _3ef1

_JASPER: TypeAlias = _JASPER
Expand Down
37 changes: 37 additions & 0 deletions tests/tests/parsers/code_042f.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
### 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
# 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 # {'oem_code': '66', 'manufacturer_sub_id': 'C8', 'product_id': '22', 'date_1': '2016-12-22', 'date_2': '0000-00-00', 'description': 'VMS-17C01'}
2024-10-09T10:33:53.714590 ... I --- 37:117647 32:022222 --:------ 31E0 004 00000000 # {'flags': '00', 'vent_demand': 0.0, '_unknown_3': '00'}

# connect - 3 sec on touch bottom right (D60 off):
2024-10-09T10:33:53.714590 057 I --- 37:117647 32:022222 --:------ 31E0 004 00000000 # {'flags': '00', 'vent_demand': 0.0, '_unknown_3': '00'}
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 # {'phase': 'offer', 'bindings': [['00', '31E0', '37:117647'], ['00', '1298', '37:117647'], ['00', '22F1', '37:117647'], ['66', '10E0', '37:117647'], ['00', '1FC9', '37:117647']]}
2024-10-09T10:35:04.342107 060 I --- 37:117647 63:262142 --:------ 1FC9 030 0031E095CB8F00129895CB8F0022F195CB8F6610E095CB8F001FC995CB8F # {'phase': 'offer', 'bindings': [['00', '31E0', '37:117647'], ['00', '1298', '37:117647'], ['00', '22F1', '37:117647'], ['66', '10E0', '37:117647'], ['00', '1FC9', '37:117647']]}
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
6 changes: 6 additions & 0 deletions tests/tests/parsers/code_10d0.log
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
7 changes: 7 additions & 0 deletions tests/tests/parsers/code_1298.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# a Vasco CO2 remote sending a measurement:
2024-10-14T20:14:21.028276 064 I --- 37:117647 --:------ 37:117647 1298 003 000322 # {'co2_level': 802}
2024-10-10T22:59:41.307778 074 I --- 37:117647 --:------ 37:117647 1298 003 0001FF # {'co2_level': 511}

# # Vasco HRU will RP to a contrived RQ
2024-10-15T12:33:59.384000 --- RQ --- 18:130140 37:117647 --:------ 1298 001 00 # {}
2024-10-15T12:33:59.943010 --- RP --- 37:117647 18:130140 --:------ 1298 003 000280 # {'co2_level': 640}
3 changes: 3 additions & 0 deletions tests/tests/parsers/code_3150.log
Original file line number Diff line number Diff line change
Expand Up @@ -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'}]

0 comments on commit 1a2e3cf

Please sign in to comment.