diff --git a/src/ramses_tx/parsers.py b/src/ramses_tx/parsers.py index 780fb873..3ad0ddf3 100644 --- a/src/ramses_tx/parsers.py +++ b/src/ramses_tx/parsers.py @@ -2106,7 +2106,7 @@ def complex_idx(seqx: str, msg: Message) -> dict[str, str]: # fan state (ventilation status), HVAC def parser_31d9(payload: str, msg: Message) -> dict[str, Any]: - # NOTE: I have a suspicion that Itho use 0x00-C8 for %, whilst Nuaire use 0x00-64 + # NOTE: Itho and ClimaRad use 0x00-C8 for %, whilst Nuaire uses 0x00-64 try: assert ( payload[4:6] == "FF" or int(payload[4:6], 16) <= 200 @@ -2116,7 +2116,7 @@ def parser_31d9(payload: str, msg: Message) -> dict[str, Any]: bitmap = int(payload[2:4], 16) - # NOTE: 31D9[4:6] is fan_rate (itho?) *or* fan_mode (orcon?) + # NOTE: 31D9[4:6] is fan_rate (minibox, itho) *or* fan_mode (orcon?) result = { **parse_exhaust_fan_speed(payload[4:6]), # itho SZ_FAN_MODE: payload[4:6], # orcon @@ -2129,6 +2129,18 @@ def parser_31d9(payload: str, msg: Message) -> dict[str, Any]: } if msg.len == 3: # usu: I -->20: (no seq#) + if msg.src.type == "32" and payload[:4] == "0000": # Vasco D60 HRU + # can't access 'vasco' scheme as this PR is separate from _22f1 + from .ramses import _22F1_MODE_ITHO as _33D9_FAN_MODE + + try: + assert ( + payload[4:6] in _33D9_FAN_MODE + ), f"unknown fan_mode: {payload[2:4]}" + except AssertionError as err: + _LOGGER.warning(f"{msg!r} < {_INFORM_DEV_MSG} ({err})") + fan_mode = _33D9_FAN_MODE.get(payload[4:6], f"unknown_{payload[4:6]}") + result[SZ_FAN_MODE] = fan_mode # replace return result try: diff --git a/tests/tests/parsers/code_31d9.log b/tests/tests/parsers/code_31d9.log index ef903873..f25373df 100644 --- a/tests/tests/parsers/code_31d9.log +++ b/tests/tests/parsers/code_31d9.log @@ -31,3 +31,25 @@ # parse_exhaust_fan_speed: 31D9[4:6] == 31DA[38:40] ?Itho 2022-11-03T10:39:55.082128 088 I 075 18:125558 --:------ 18:125558 31D9 017 1520180000000000000000000000000000 # {'hvac_id': '15', 'exhaust_fan_speed': 0.12, 'fan_mode': '18', 'passive': False, 'damper_only': False, 'filter_dirty': True, 'frost_cycle': False, 'has_fault': False, '_flags': [0, 0, 1, 0, 0, 0, 0, 0], '_unknown_3': '00', '_unknown_4': '000000000000000000000000', 'unknown_16': '00', 'seqx_num': '075'} 2022-11-03T10:39:14.071045 088 I --- 18:125558 --:------ 18:125558 31DA 029 15C8400431EFEF060405CC081D056E4800C85818FF0000EFEF35C035C0 # {'hvac_id': '15', 'exhaust_fan_speed': 0.12, 'fan_info': 'auto', '_unknown_fan_info_flags': [0, 1, 0], 'air_quality': 1.0, 'air_quality_basis': 'rel_humidity', 'co2_level': 1073, 'indoor_humidity': None, 'outdoor_humidity': None, 'exhaust_temp': 15.4, 'supply_temp': 14.84, 'indoor_temp': 20.77, 'outdoor_temp': 13.9, 'speed_capabilities': ['low_med_high', 'auto'], 'bypass_position': 1.0, 'supply_fan_speed': None, 'remaining_mins': 0, 'post_heat': None, 'pre_heat': None, 'supply_flow': 137.6, 'exhaust_flow': 137.6} + +# Vasco D60 +2024-10-23T09:22:33.585485 087 I --- 32:022222 --:------ 32:022222 31D9 003 000000 # {'hvac_id': '00', 'exhaust_fan_speed': 0.0, 'fan_mode': 'off', 'passive': False, 'damper_only': False, 'filter_dirty': False, 'frost_cycle': False, 'has_fault': False, '_flags': [0, 0, 0, 0, 0, 0, 0, 0]} +2024-10-15T13:10:35.374111 082 I --- 32:022222 --:------ 32:022222 31D9 003 000004 # {'hvac_id': '00', 'exhaust_fan_speed': 0.02, 'fan_mode': 'high', 'passive': False, 'damper_only': False, 'filter_dirty': False, 'frost_cycle': False, 'has_fault': False, '_flags': [0, 0, 0, 0, 0, 0, 0, 0]} +2024-10-15T13:08:29.420696 081 I --- 32:022222 --:------ 32:022222 31D9 003 000003 # {'hvac_id': '00', 'exhaust_fan_speed': 0.015, 'fan_mode': 'medium', 'passive': False, 'damper_only': False, 'filter_dirty': False, 'frost_cycle': False, 'has_fault': False, '_flags': [0, 0, 0, 0, 0, 0, 0, 0]} +2024-10-15T13:10:56.372344 080 I --- 32:022222 --:------ 32:022222 31D9 003 000005 # {'hvac_id': '00', 'exhaust_fan_speed': 0.025, 'fan_mode': 'unknown_05', 'passive': False, 'damper_only': False, 'filter_dirty': False, 'frost_cycle': False, 'has_fault': False, '_flags': [0, 0, 0, 0, 0, 0, 0, 0]} # can't access 22F1 vasco dict +2024-10-15T13:10:56.372344 080 I --- 32:022222 --:------ 32:022222 31D9 003 000002 # {'hvac_id': '00', 'exhaust_fan_speed': 0.01, 'fan_mode': 'low', 'passive': False, 'damper_only': False, 'filter_dirty': False, 'frost_cycle': False, 'has_fault': False, '_flags': [0, 0, 0, 0, 0, 0, 0, 0]} +2024-10-15T13:10:56.372344 080 I --- 32:022222 --:------ 32:022222 31D9 003 000001 # {'hvac_id': '00', 'exhaust_fan_speed': 0.005, 'fan_mode': 'trickle', 'passive': False, 'damper_only': False, 'filter_dirty': False, 'frost_cycle': False, 'has_fault': False, '_flags': [0, 0, 0, 0, 0, 0, 0, 0]} + +# ClimaRad MiniBox FAN, Note: sends incorrect speed for speed2 (C8 = 100% == speed3 but it speeds up from 2 > 3) +2024-10-23T12:21:40.179175 074 I --- 29:099029 --:------ 29:099029 31D9 003 000000 # {'hvac_id': '00', 'exhaust_fan_speed': 0.0, 'fan_mode': '00', 'passive': False, 'damper_only': False, 'filter_dirty': False, 'frost_cycle': False, 'has_fault': False, '_flags': [0, 0, 0, 0, 0, 0, 0, 0]} # off +2024-10-15T10:10:35.374076 077 I --- 29:099029 --:------ 29:099029 31D9 003 0000C8 # {'hvac_id': '00', 'exhaust_fan_speed': 1.0, 'fan_mode': 'C8', 'passive': False, 'damper_only': False, 'filter_dirty': False, 'frost_cycle': False, 'has_fault': False, '_flags': [0, 0, 0, 0, 0, 0, 0, 0]} # speed 2 = not 100% manuf. error? +2024-10-15T10:10:35.474076 077 I --- 29:099029 --:------ 29:099029 31D9 003 0000C8 # {'hvac_id': '00', 'exhaust_fan_speed': 1.0, 'fan_mode': 'C8', 'passive': False, 'damper_only': False, 'filter_dirty': False, 'frost_cycle': False, 'has_fault': False, '_flags': [0, 0, 0, 0, 0, 0, 0, 0]} # speed 3 = 100% +2024-10-18T19:29:33.175843 091 I --- 29:099029 --:------ 29:099029 31D9 003 000050 # {'hvac_id': '00', 'exhaust_fan_speed': 0.4, 'fan_mode': '50', 'passive': False, 'damper_only': False, 'filter_dirty': False, 'frost_cycle': False, 'has_fault': False, '_flags': [0, 0, 0, 0, 0, 0, 0, 0]} # speed 1 = 40% +2024-10-23T11:39:46.785805 078 I --- 29:099029 --:------ 29:099029 31D9 003 00001E # {'hvac_id': '00', 'exhaust_fan_speed': 0.15, 'fan_mode': '1E', 'passive': False, 'damper_only': False, 'filter_dirty': False, 'frost_cycle': False, 'has_fault': False, '_flags': [0, 0, 0, 0, 0, 0, 0, 0]} # speed lowlow = 15% +2024-10-15T10:10:35.574076 077 I --- 29:099029 --:------ 29:099029 31D9 003 000001 # {'hvac_id': '00', 'exhaust_fan_speed': 0.005, 'fan_mode': '01', 'passive': False, 'damper_only': False, 'filter_dirty': False, 'frost_cycle': False, 'has_fault': False, '_flags': [0, 0, 0, 0, 0, 0, 0, 0]} # minimum (Auto mode base speed) + +# ClimaRad VenturaV1x +2024-10-20T21:23:28.345240 067 I 008 37:153226 --:------ 37:153226 31D9 017 000AFF0020202020202020202020202000 # {'hvac_id': '00', 'exhaust_fan_speed': None, 'fan_mode': 'FF', 'passive': True, 'damper_only': False, 'filter_dirty': False, 'frost_cycle': False, 'has_fault': False, '_flags': [0, 0, 0, 0, 1, 0, 1, 0], '_unknown_3': '00', '_unknown_4': '202020202020202020202020', 'unknown_16': '00', 'seqx_num': '008'} + +# unknown HVAC picked up +2024-10-20T21:11:08.162460 081 I 086 37:125482 --:------ 37:125482 31D9 017 00063C0020202020202020202020202000 # {'hvac_id': '00', 'exhaust_fan_speed': 0.3, 'fan_mode': '3C', 'passive': True, 'damper_only': True, 'filter_dirty': False, 'frost_cycle': False, 'has_fault': False, '_flags': [0, 0, 0, 0, 0, 1, 1, 0], '_unknown_3': '00', '_unknown_4': '202020202020202020202020', 'unknown_16': '00', 'seqx_num': '086'}