Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak 22F1 for Vasco REM/CO2 #136

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
12 changes: 12 additions & 0 deletions src/ramses_tx/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,8 @@ def parser_22e9(payload: str, msg: Message) -> Mapping[str, float | None]:

# fan_speed (switch_mode), HVAC
def parser_22f1(payload: str, msg: Message) -> dict[str, Any]:
# ClimaRad VenturaV1x HRU does not send 22F1 for speed, uses 22F4

try:
assert payload[0:2] in ("00", "63")
assert not payload[4:] or int(payload[2:4], 16) <= int(
Expand Down Expand Up @@ -1544,6 +1546,16 @@ def parser_22f1(payload: str, msg: Message) -> dict[str, Any]:
_22f1_mode_set = ("", "0A")
_22f1_scheme = "nuaire"

elif payload[4:6] == "06":
from .ramses import _22F1_MODE_VASCO as _22F1_FAN_MODE

_22f1_mode_set = (
"",
"00",
"06",
) # "00" seen incidentally on a ClimaRad 4-button remote
_22f1_scheme = "vasco"

else:
from .ramses import _22F1_MODE_ORCON as _22F1_FAN_MODE

Expand Down
14 changes: 13 additions & 1 deletion src/ramses_tx/ramses.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@
Code._22F1: { # fan_mode, HVAC
SZ_NAME: "fan_mode",
RQ: r"^00$",
RP: r"^00[0-9A-F]{4}$",
I_: r"^(00|63)(0[0-9A-F]){1,2}$",
},
Code._22F2: { # unknown_22f2, HVAC, NB: no I
Expand Down Expand Up @@ -1061,7 +1062,7 @@
Code._1470: {RP: {}},
Code._1F09: {I_: {}, RP: {}},
Code._1FC9: {W_: {}},
Code._22F1: {},
Code._22F1: {RP: {}},
Code._22F3: {},
Code._22F4: {I_: {}},
Code._22F7: {I_: {}, RP: {}},
Expand All @@ -1078,6 +1079,7 @@
Code._10E0: {I_: {}, RP: {}},
Code._1298: {I_: {}},
Code._1FC9: {I_: {}},
Code._22F1: {RQ: {}},
Code._2411: {RQ: {}},
Code._2E10: {I_: {}},
Code._3120: {I_: {}},
Expand Down Expand Up @@ -1231,10 +1233,20 @@
"07": "off",
}

_22F1_MODE_VASCO: dict[str, str] = { # for VASCO D60 AND ClimaRad Minibox fanS/remotes
"00": "off",
"01": "away", # 000106 minimum
"02": "low", # 000206
"03": "medium", # 000306
"04": "high", # 000406, aka boost with 22F3
"05": "auto", #
}

_22F1_SCHEMES: dict[str, dict[str, str]] = {
"itho": _22F1_MODE_ITHO,
"nuaire": _22F1_MODE_NUAIRE,
"orcon": _22F1_MODE_ORCON,
"vasco": _22F1_MODE_VASCO,
}

# unclear if true for only Orcon/*all* models
Expand Down
2 changes: 1 addition & 1 deletion src/ramses_tx/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def convert_null_to_dict(node_value: _T | None) -> _T | dict[Never, Never]:
SCH_DEVICE_ID_UFC = vol.Match(DEVICE_ID_REGEX.UFC)

_SCH_TRAITS_DOMAINS = ("heat", "hvac")
_SCH_TRAITS_HVAC_SCHEMES = ("itho", "nuaire", "orcon")
_SCH_TRAITS_HVAC_SCHEMES = ("itho", "nuaire", "orcon", "vasco")


DeviceTraitsT = TypedDict(
Expand Down
13 changes: 9 additions & 4 deletions tests/tests/parsers/code_22f1.log
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@
2021-02-12T17:28:57.122037 071 I 016 --:------ --:------ 39:159057 22F1 003 000304 # {'fan_mode': 'medium', '_scheme': 'itho', '_mode_idx': '03', '_mode_max': '04', "seqx_num": "016"}
2021-02-12T17:29:02.197564 066 I 017 --:------ --:------ 39:159057 22F1 003 000404 # {'fan_mode': 'high', '_scheme': 'itho', '_mode_idx': '04', '_mode_max': '04', "seqx_num": "017"}

# Scheme 06 - seen with Vasco : 000[234]06 (sent as set of 5)
# Scheme 06 - seen with Vasco and ClimaRad fans: 000[234]06 (sent as set of 5)
2024-10-10T18:10:21.527295 073 I --- 29:123150 29:099029 --:------ 22F1 003 000306 #
# 000006 # (faked) not responding
2024-10-10T22:26:28.420378 041 I --- 29:091138 32:022222 --:------ 22F1 003 000106 # {'fan_mode': 'away', '_scheme': 'vasco', '_mode_idx': '01', '_mode_max': '06'}
2024-10-10T22:26:38.421878 041 I --- 29:091138 32:022222 --:------ 22F1 003 000206 # {'fan_mode': 'low', '_scheme': 'vasco', '_mode_idx': '02', '_mode_max': '06'}
2024-10-10T23:31:09.943782 042 I --- 29:091138 32:022222 --:------ 22F1 003 000306 # {'fan_mode': 'medium', '_scheme': 'vasco', '_mode_idx': '03', '_mode_max': '06'}
2024-10-10T23:36:03.885268 042 I --- 29:091138 32:022222 --:------ 22F1 003 000406 # {'fan_mode': 'high', '_scheme': 'vasco', '_mode_idx': '04', '_mode_max': '06'}
2024-10-15T13:09:39.141223 000 I --- 29:123150 29:099029 --:------ 22F1 003 000506 # {'fan_mode': 'auto', '_scheme': 'vasco', '_mode_idx': '05', '_mode_max': '06'}

2024-10-10T22:26:38.421878 041 I --- 29:091138 32:022222 --:------ 22F1 003 000206 #
2024-10-10T23:31:09.943782 042 I --- 29:091138 32:022222 --:------ 22F1 003 000306 #
2024-10-10T23:36:03.885268 042 I --- 29:091138 32:022222 --:------ 22F1 003 000406 #
2024-10-14T19:40:40.840473 056 RQ --- 37:117647 32:022222 --:------ 22F1 001 00 # {}
2024-10-15T12:32:30.550000 082 RP --- 32:022222 18:130140 --:------ 22F1 003 000306 # {'fan_mode': 'medium', '_scheme': 'vasco', '_mode_idx': '03', '_mode_max': '06'}

# Scheme 07 - seen with Orcon : 000[2345]07 (away is aka absent, boost is aka party/boost)
2022-06-22T21:36:43.354510 ... I --- 37:155617 32:155617 --:------ 22F1 003 000007 # {'fan_mode': 'away', '_scheme': 'orcon', '_mode_idx': '00', '_mode_max': '07'}
Expand Down