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 12A0 for ClimaRad HVAC #142

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d68975d
add 12a0 typedDict, move used classes before it
silverailscolo Oct 17, 2024
2b8b4b5
clean-up and Ventura packet logs
silverailscolo Oct 17, 2024
4a70578
fingerprints
silverailscolo Oct 17, 2024
e2f2ae5
Merge branch 'master' of https://github.com/zxdavb/ramses_rf into eb-…
silverailscolo Oct 17, 2024
34960b0
remove notes
silverailscolo Oct 18, 2024
3264a40
split result
silverailscolo Oct 18, 2024
4560b2f
Merge branch 'master' of https://github.com/zxdavb/ramses_rf into eb-…
silverailscolo Oct 18, 2024
e078ef3
Merge remote-tracking branch 'origin/eb-12a0' into eb-12a0
silverailscolo Oct 18, 2024
7f6f537
simplify regex, remove assert
silverailscolo Oct 18, 2024
e979a23
split _12a0 types, tag unknown0
silverailscolo Oct 18, 2024
febbd88
merge master
silverailscolo Oct 20, 2024
ccdcdd1
remove asserts
silverailscolo Oct 20, 2024
8694343
hum parse suggestion
silverailscolo Oct 20, 2024
9280495
hold on to alternative parser while sorting out result
silverailscolo Oct 20, 2024
d2c762e
12A0 dict easy
silverailscolo Oct 20, 2024
6693c91
typed humidity list interior-rh-exterior
silverailscolo Oct 20, 2024
2efcf16
clean up log
silverailscolo Oct 20, 2024
7472381
new V1x packet
silverailscolo Oct 21, 2024
7b25029
Merge branch 'master' of https://github.com/zxdavb/ramses_rf into eb-…
silverailscolo Oct 23, 2024
a4c39ad
Merge branch 'master' of https://github.com/zxdavb/ramses_rf into eb-…
silverailscolo Nov 6, 2024
a954a79
Merge branch 'master' of https://github.com/zxdavb/ramses_rf into eb-…
silverailscolo Nov 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/ramses_tx/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
SZ_OEM_CODE,
SZ_OFFER,
SZ_OPENWINDOW_FUNCTION,
SZ_OUTDOOR_TEMP,
SZ_PAYLOAD,
SZ_PERCENTAGE,
SZ_PHASE,
Expand Down Expand Up @@ -1130,7 +1131,26 @@ def parser_1298(payload: str, msg: Message) -> PayDictT._1298:

# HVAC: indoor_humidity
def parser_12a0(payload: str, msg: Message) -> PayDictT._12A0:
return parse_indoor_humidity(payload[2:])
if len(payload) <= 14:
return parse_indoor_humidity(payload[2:12])

# if len(payload) == 42: # for ClimaRad VenturaV1x
assert payload[8:12] == "7FFF", _INFORM_DEV_MSG
assert payload[12:14] == "00", _INFORM_DEV_MSG # parse_fan_heater or flags?
assert payload[14:16] == "01", _INFORM_DEV_MSG # parse_fan_info?
assert payload[16:18] == "EF", _INFORM_DEV_MSG # parse_bypass_position?
assert payload[18:22] == "7FFF", _INFORM_DEV_MSG
assert payload[22:26] == "7FFF", _INFORM_DEV_MSG
assert payload[26:28] == "00", _INFORM_DEV_MSG
assert payload[40:] == "00", _INFORM_DEV_MSG
silverailscolo marked this conversation as resolved.
Show resolved Hide resolved
silverailscolo marked this conversation as resolved.
Show resolved Hide resolved

return {
**parse_indoor_humidity(payload[2:12]),
"_unknown_0": payload[14:16], # perhaps C/F or bypass state
**parse_co2_level(payload[28:32]),
**parse_supply_temp(payload[32:36]),
SZ_OUTDOOR_TEMP: hex_to_temp(payload[36:40]),
} # type: ignore[return-value]
silverailscolo marked this conversation as resolved.
Show resolved Hide resolved


# window_state (of a device/zone)
Expand Down
3 changes: 2 additions & 1 deletion src/ramses_tx/ramses.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,10 @@
Code._12A0: { # indoor_humidity
# .I --- 32:168090 --:------ 32:168090 12A0 006 0030093504A8
# .I --- 32:132125 --:------ 32:132125 12A0 007 003107B67FFF00 # only dev_id with 007
# .I --- 37:153226 --:------ 37:153226 12A0 021 003108127FFF00 01EF7FFF7FFF0002 420615 03AC 00 # ClimaRad VenturaV1x
# RP --- 20:008749 18:142609 --:------ 12A0 002 00EF
SZ_NAME: "indoor_humidity",
I_: r"^00[0-9A-F]{2}([0-9A-F]{8}(00)?)?$",
I_: r"^00[0-9A-F]{2}([0-9A-F]{8}(00)?)?([0-9A-F]{26}(00))?$",
silverailscolo marked this conversation as resolved.
Show resolved Hide resolved
RP: r"^00[0-9A-F]{2}([0-9A-F]{8}(00)?)?$",
SZ_LIFESPAN: td(hours=1),
},
Expand Down
62 changes: 35 additions & 27 deletions src/ramses_tx/typed_dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,40 @@ class _1100_IDX(TypedDict):
domain_id: str


class IndoorHumidity(TypedDict):
indoor_humidity: _HexToTempT
temperature: NotRequired[float | None]
dewpoint_temp: NotRequired[float | None]


class Co2Level(TypedDict):
co2_level: float | None


class SupplyTemp(TypedDict):
supply_temp: _HexToTempT


class ExhaustTemp(TypedDict):
exhaust_temp: _HexToTempT


class IndoorTemp(TypedDict):
indoor_temp: _HexToTempT


class OutdoorTemp(TypedDict):
outdoor_temp: _HexToTempT


class _12a0_x(IndoorHumidity):
# only add what is not in IndoorHumidity
_unknown_0: str
SZ_CO2_LEVEL: Co2Level
SZ_SUPPLY_TEMP: SupplyTemp
SZ_OUTDOOR_TEMP: OutdoorTemp


class _12b0(TypedDict):
window_open: bool | None

Expand Down Expand Up @@ -287,38 +321,12 @@ class AirQuality(TypedDict):
air_quality_basis: NotRequired[str]


class Co2Level(TypedDict):
co2_level: float | None


class IndoorHumidity(TypedDict):
indoor_humidity: _HexToTempT
temperature: NotRequired[float | None]
dewpoint_temp: NotRequired[float | None]


class OutdoorHumidity(TypedDict):
zxdavb marked this conversation as resolved.
Show resolved Hide resolved
outdoor_humidity: _HexToTempT
temperature: NotRequired[float | None]
dewpoint_temp: NotRequired[float | None]


class ExhaustTemp(TypedDict):
exhaust_temp: _HexToTempT


class SupplyTemp(TypedDict):
supply_temp: _HexToTempT


class IndoorTemp(TypedDict):
indoor_temp: _HexToTempT


class OutdoorTemp(TypedDict):
outdoor_temp: _HexToTempT


class Capabilities(TypedDict):
speed_capabilities: list[str] | None

Expand Down Expand Up @@ -409,7 +417,7 @@ class PayDictT:
_1280: TypeAlias = OutdoorHumidity
_1290: TypeAlias = OutdoorTemp
_1298: TypeAlias = Co2Level
_12A0: TypeAlias = IndoorHumidity
_12A0: TypeAlias = _12a0_x | IndoorHumidity
_12B0: TypeAlias = _12b0
_12C0: TypeAlias = _12c0
_12C8: TypeAlias = AirQuality
Expand Down
2 changes: 2 additions & 0 deletions tests/tests/fingerprints/hvac/29_VMC-07RP01.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ClimaRad MiniBox FAN
2024-10-15T12:41:34.415872 075 I --- 29:099029 --:------ 29:099029 12A0 002 0031 # {'indoor_humidity': 0.49}
1 change: 1 addition & 0 deletions tests/tests/fingerprints/hvac/37_VMD-07RPS13.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2024-10-15T12:33:21.828292 060 I --- 37:153226 --:------ 37:153226 12A0 021 003307DD7FFF0001EF7FFF7FFF00023E056B02A600 # {'indoor_humidity': 0.51, 'temperature': 20.13, 'dewpoint_temp': None, 'units': 'Celsius', 'co2_level': 574, 'supply_temp': 13.87, 'outdoor_temp': 6.78}
silverailscolo marked this conversation as resolved.
Show resolved Hide resolved
12 changes: 12 additions & 0 deletions tests/tests/parsers/code_12a0.log
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@

2021-02-12T20:59:47.225210 066 RP --- 20:008749 18:142609 --:------ 12A0 002 00EF # {'indoor_humidity': None}
2024-10-15T12:41:34.415872 075 I --- 29:099029 --:------ 29:099029 12A0 002 0031 # {'indoor_humidity': 0.49}

2022-03-08T11:24:21.138647 076 I --- 29:146052 --:------ 29:146052 12A0 006 00220685004C # {'indoor_humidity': 0.34, 'temperature': 16.69, 'dewpoint_temp': 0.76}

2022-07-03T10:04:21.953850 061 RP --- 32:155617 18:005904 --:------ 12A0 007 003908A57FFF00 # {'indoor_humidity': 0.57, 'temperature': 22.13, 'dewpoint_temp': None}
2022-08-17T02:29:36.718767 056 I --- 32:155617 --:------ 32:155617 12A0 007 003C096E7FFF00 # {'indoor_humidity': 0.60, 'temperature': 24.14, 'dewpoint_temp': None}

2019-12-16T05:19:20.630177 072 I --- 32:168090 --:------ 32:168090 12A0 006 003C06DE03E3 # {'indoor_humidity': 0.60, 'temperature': 17.58, 'dewpoint_temp': 9.95}

# ClimaRad VenturaV1x
2024-10-15T12:33:21.828292 060 I --- 37:153226 --:------ 37:153226 12A0 021 003307DD7FFF0001EF7FFF7FFF00023E056B02A600 # {'indoor_humidity': 0.51, 'temperature': 20.13, 'dewpoint_temp': None, '_unknown_0': '01', 'co2_level': 574, 'supply_temp': 13.87, 'outdoor_temp': 6.78}
2024-10-15T12:38:22.145126 060 I --- 37:153226 --:------ 37:153226 12A0 021 003207D27FFF0001EF7FFF7FFF00023F057B02D200 # {'indoor_humidity': 0.5, 'temperature': 20.02, 'dewpoint_temp': None, '_unknown_0': '01', 'co2_level': 575, 'supply_temp': 14.03, 'outdoor_temp': 7.22}
2024-10-15T12:48:22.825444 060 I --- 37:153226 --:------ 37:153226 12A0 021 003107E47FFF0001EF7FFF7FFF00023E05A802D900 # {'indoor_humidity': 0.49, 'temperature': 20.2, 'dewpoint_temp': None, '_unknown_0': '01', 'co2_level': 574, 'supply_temp': 14.48, 'outdoor_temp': 7.29}
2024-10-15T13:25:35.121534 062 I --- 37:153226 --:------ 37:153226 12A0 021 0034080C7FFF0001EF7FFF7FFF00023B05C002AF00 # {'indoor_humidity': 0.52, 'temperature': 20.6, 'dewpoint_temp': None, '_unknown_0': '01', 'co2_level': 571, 'supply_temp': 14.72, 'outdoor_temp': 6.87}
2024-10-15T15:59:04.943042 061 I --- 37:153226 --:------ 37:153226 12A0 021 0033088F7FFF0001EF7FFF7FFF000237065C02D900 # {'indoor_humidity': 0.51, 'temperature': 21.91, 'dewpoint_temp': None, '_unknown_0': '01', 'co2_level': 567, 'supply_temp': 16.28, 'outdoor_temp': 7.29}
2024-10-15T23:50:36.119335 074 I --- 37:153226 --:------ 37:153226 12A0 021 002B08137FFF0001EF7FFF7FFF00023D05A102CE00 # {'indoor_humidity': 0.43, 'temperature': 20.67, 'dewpoint_temp': None, '_unknown_0': '01', 'co2_level': 573, 'supply_temp': 14.41, 'outdoor_temp': 7.18}
2024-10-18T13:40:19.208645 067 I --- 37:153226 --:------ 37:153226 12A0 021 0042081D7FFF0001EF7FFF7FFF00024D079205FF00 # {'indoor_humidity': 0.66, 'temperature': 20.77, 'dewpoint_temp': None, '_unknown_0': '01', 'co2_level': 589, 'supply_temp': 19.38, 'outdoor_temp': 15.35}
2024-10-18T15:45:27.762626 067 I --- 37:153226 --:------ 37:153226 12A0 021 004408327FFF0001EF7FFF7FFF00024707EF05DE00 # {'indoor_humidity': 0.68, 'temperature': 20.98, 'dewpoint_temp': None, '_unknown_0': '01', 'co2_level': 583, 'supply_temp': 20.31, 'outdoor_temp': 15.02}
2024-10-18T15:50:28.112562 067 I --- 37:153226 --:------ 37:153226 12A0 021 004408377FFF0001EF7FFF7FFF00024707F705E000 # {'indoor_humidity': 0.68, 'temperature': 21.03, 'dewpoint_temp': None, '_unknown_0': '01', 'co2_level': 583, 'supply_temp': 20.39, 'outdoor_temp': 15.04}