Skip to content
38 changes: 33 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ never released and has been replaced.
- SHI holding `66` (`heat_overall_offset`): the documented range is now
-50..50 (+/-5.0 K) instead of -200..200.
- Document that `LevelMode` values 1 and 2 are identical on firmware V3.92.3.
- Change the scaling factor of 'ID_Waermemenge' parameters from 0.1 to 0.01 [#198]
- Change the scaling factor of the voltage data fields to 0.01 [#198]

### Removed

Expand Down Expand Up @@ -1133,17 +1135,17 @@ from `Unknown` to `TimeOfDay`
- Type of `ID_Einst_SuMk3Tg_zeit_2_13` (index `848`) changed
from `Unknown` to `TimeOfDay`
- Type of `ID_Waermemenge_Seit` (index `852`) changed
from `Unknown` to `Energy`
from `Unknown` to `Energy2`
- Type of `ID_Waermemenge_Hz` (index `854`) changed
from `Unknown` to `Energy`
from `Unknown` to `Energy2`
- Type of `ID_Zaehler_BetrZeitSW` (index `859`) changed
from `Unknown` to `Seconds`
- Type of `ID_Einst_Popt_Nachlauf_akt` (index `864`) changed
from `Unknown` to `Minutes`
- Type of `ID_Waermemenge_BW` (index `878`) changed
from `Unknown` to `Energy`
from `Unknown` to `Energy2`
- Type of `ID_Waermemenge_SW` (index `879`) changed
from `Unknown` to `Energy`
from `Unknown` to `Energy2`
- Type of `ID_Waermemenge_Datum` (index `880`) changed
from `Unknown` to `Timestamp`
- Type of `ID_Einst_SuLuf_akt` (index `895`) changed
Expand Down Expand Up @@ -1279,7 +1281,13 @@ from `Unknown` to `Hours2`
- Type of `ID_Waermemenge_ZWE` (index `1059`) changed
from `Unknown` to `Energy`
- Type of `ID_Waermemenge_Reset` (index `1060`) changed
from `Unknown` to `Energy`
from `Unknown` to `Energy2`
- Type of `HEAT_ENERGY_INPUT` (index `1136`) changed
from `Energy` to `Energy2`
- Type of `DHW_ENERGY_INPUT` (index `1137`) changed
from `Energy` to `Energy2`
- Type of `COOLING_ENERGY_INPUT` (index `1139`) changed
from `Energy` to `Energy2`
- Add `SILENT_MODE` (index `1087`) of type `OnOffMode`
- Add `ID_Einst_SuSilence` (index `1092`) of type `TimerProgram`
- Add `ID_Einst_SilenceTimer_0` (index `1093`) of type `TimeOfDay2`
Expand Down Expand Up @@ -1403,6 +1411,26 @@ from `IPAddress` to `IPv4Address`
from `IPAddress` to `IPv4Address`
- Type of `ID_WEB_Add_StdGateway` (index `94`) changed
from `IPAddress` to `IPv4Address`
- Type of `ID_WEB_AnalogIn` (index `147`) changed
from `Voltage` to `Voltage2`
- Type of `ID_WEB_AnalogOut1` (index `156`) changed
from `Voltage` to `Voltage2`
- Type of `ID_WEB_AnalogOut2` (index `157`) changed
from `Voltage` to `Voltage2`
- Type of `ID_WEB_AnalogOut3` (index `162`) changed
from `Voltage` to `Voltage2`
- Type of `ID_WEB_AnalogOut4` (index `163`) changed
from `Voltage` to `Voltage2`
- Type of `ID_WEB_Out_VZU` (index `164`) changed
from `Voltage` to `Voltage2`
- Type of `ID_WEB_Out_VAB` (index `165`) changed
from `Voltage` to `Voltage2`
- Type of `ID_WEB_AnalogIn2` (index `168`) changed
from `Voltage` to `Voltage2`
- Type of `ID_WEB_AnalogIn3` (index `169`) changed
from `Voltage` to `Voltage2`
- Type of `ID_WEB_SEC_U_Inv` (index `202`) changed
from `Voltage` to `Voltage2`
- Add `ID_WEB_SoftStand_0` (index `81`) of type `Character`
- Add `ID_WEB_SoftStand_1` (index `82`) of type `Character`
- Add `ID_WEB_SoftStand_2` (index `83`) of type `Character`
Expand Down
16 changes: 16 additions & 0 deletions luxtronik/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,14 @@ class Energy(ScalingBase):
scaling_factor = 0.1


class Energy2(ScalingBase):
"""Energy datatype, converts from and to Energy."""

datatype_class = "energy"
datatype_unit = "kWh"
scaling_factor = 0.01


class Voltage(ScalingBase):
"""Voltage datatype, converts from and to Voltage."""

Expand All @@ -596,6 +604,14 @@ class Voltage(ScalingBase):
scaling_factor = 0.1


class Voltage2(ScalingBase):
"""Voltage datatype, converts from and to Voltage."""

datatype_class = "voltage"
datatype_unit = "V"
scaling_factor = 0.01


class Hours(ScalingBase):
"""Hours datatype, converts from and to Hours."""

Expand Down
22 changes: 11 additions & 11 deletions luxtronik/definitions/calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
Unknown,
MajorMinorVersion,
Version,
Voltage,
Voltage2,
)

# Offset which must be added to the calculation indices
Expand Down Expand Up @@ -1538,7 +1538,7 @@
"index": 147,
"count": 1,
"names": ['ID_WEB_AnalogIn'],
"type": Voltage,
"type": Voltage2,
"writeable": False,
"datatype": 'INT32',
"unit": 'V/10',
Expand Down Expand Up @@ -1628,7 +1628,7 @@
"index": 156,
"count": 1,
"names": ['ID_WEB_AnalogOut1'],
"type": Voltage,
"type": Voltage2,
"writeable": False,
"datatype": 'INT32',
"unit": 'V/10',
Expand All @@ -1638,7 +1638,7 @@
"index": 157,
"count": 1,
"names": ['ID_WEB_AnalogOut2'],
"type": Voltage,
"type": Voltage2,
"writeable": False,
"datatype": 'INT32',
"unit": 'V/10',
Expand Down Expand Up @@ -1688,7 +1688,7 @@
"index": 162,
"count": 1,
"names": ['ID_WEB_AnalogOut3'],
"type": Voltage,
"type": Voltage2,
"writeable": False,
"datatype": 'INT32',
"unit": 'V/10',
Expand All @@ -1698,7 +1698,7 @@
"index": 163,
"count": 1,
"names": ['ID_WEB_AnalogOut4'],
"type": Voltage,
"type": Voltage2,
"writeable": False,
"datatype": 'INT32',
"unit": 'V/10',
Expand All @@ -1708,7 +1708,7 @@
"index": 164,
"count": 1,
"names": ['ID_WEB_Out_VZU'],
"type": Voltage,
"type": Voltage2,
"writeable": False,
"datatype": 'INT32',
"unit": 'V/10',
Expand All @@ -1718,7 +1718,7 @@
"index": 165,
"count": 1,
"names": ['ID_WEB_Out_VAB'],
"type": Voltage,
"type": Voltage2,
"writeable": False,
"datatype": 'INT32',
"unit": 'V/10',
Expand Down Expand Up @@ -1748,7 +1748,7 @@
"index": 168,
"count": 1,
"names": ['ID_WEB_AnalogIn2'],
"type": Voltage,
"type": Voltage2,
"writeable": False,
"datatype": 'INT32',
"unit": 'V/10',
Expand All @@ -1758,7 +1758,7 @@
"index": 169,
"count": 1,
"names": ['ID_WEB_AnalogIn3'],
"type": Voltage,
"type": Voltage2,
"writeable": False,
"datatype": 'INT32',
"unit": 'V/10',
Expand Down Expand Up @@ -2088,7 +2088,7 @@
"index": 202,
"count": 1,
"names": ['ID_WEB_SEC_U_Inv'],
"type": Voltage,
"type": Voltage2,
"writeable": False,
"datatype": 'INT32',
"unit": 'V/10',
Expand Down
45 changes: 29 additions & 16 deletions luxtronik/definitions/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
Bool,
Count,
Energy,
Energy2,
Kelvin,
Celsius,
CoolingMode,
Expand Down Expand Up @@ -8571,10 +8572,10 @@
"index": 852,
"count": 1,
"names": ['ID_Waermemenge_Seit'],
"type": Energy,
"type": Energy2,
"writeable": False,
"datatype": 'UINT32',
"unit": 'kWh/10',
"unit": 'kWh/100',
"description": '',
},
{
Expand All @@ -8591,10 +8592,10 @@
"index": 854,
"count": 1,
"names": ['ID_Waermemenge_Hz'],
"type": Energy,
"type": Energy2,
"writeable": False,
"datatype": 'UINT32',
"unit": 'kWh/10',
"unit": 'kWh/100',
"description": '',
},
{
Expand Down Expand Up @@ -8831,20 +8832,20 @@
"index": 878,
"count": 1,
"names": ['ID_Waermemenge_BW'],
"type": Energy,
"type": Energy2,
"writeable": False,
"datatype": 'UINT32',
"unit": 'kWh/10',
"unit": 'kWh/100',
"description": '',
},
{
"index": 879,
"count": 1,
"names": ['ID_Waermemenge_SW'],
"type": Energy,
"type": Energy2,
"writeable": False,
"datatype": 'UINT32',
"unit": 'kWh/10',
"unit": 'kWh/100',
"description": '',
},
{
Expand Down Expand Up @@ -10637,6 +10638,17 @@
"unit": '',
"description": '',
},
{
"index": 1059,
"count": 1,
"names": ['ID_Waermemenge_ZWE'],
"type": Energy2,
"writeable": False,
"datatype": 'UINT32',
"unit": 'kWh/100',
"version": '<3.0',
"description": '',
},
{
"index": 1059,
"count": 1,
Expand All @@ -10645,16 +10657,17 @@
"writeable": False,
"datatype": 'UINT32',
"unit": 'kWh/10',
"version": '>=3.0',
"description": '',
},
{
"index": 1060,
"count": 1,
"names": ['ID_Waermemenge_Reset'],
"type": Energy,
"type": Energy2,
"writeable": False,
"datatype": 'UINT32',
"unit": 'kWh/10',
"unit": 'kWh/100',
"description": '',
},
{
Expand Down Expand Up @@ -11561,10 +11574,10 @@
"index": 1136,
"count": 1,
"names": ['HEAT_ENERGY_INPUT'],
"type": Energy,
"type": Energy2,
"writeable": False,
"datatype": 'UINT32',
"unit": 'kWh/10',
"unit": 'kWh/100',
"description": '',
},
{
Expand All @@ -11577,10 +11590,10 @@
"index": 1137,
"count": 1,
"names": ['DHW_ENERGY_INPUT'],
"type": Energy,
"type": Energy2,
"writeable": False,
"datatype": 'UINT32',
"unit": 'kWh/10',
"unit": 'kWh/100',
"description": '',
},
{
Expand All @@ -11603,10 +11616,10 @@
"index": 1139,
"count": 1,
"names": ['COOLING_ENERGY_INPUT'],
"type": Energy,
"type": Energy2,
"writeable": False,
"datatype": 'UINT32',
"unit": 'kWh/10',
"unit": 'kWh/100',
"description": '',
},
{
Expand Down
24 changes: 18 additions & 6 deletions tests/test_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
Voltage,
)

from tests.types_of_same_kind import TypesOfSameKind

logging.disable(logging.CRITICAL)


Expand Down Expand Up @@ -2284,7 +2286,17 @@ def get_mappings(d):
# new name available -> no error

# we allow type changes if we already use a name, but the type is still unknown
type_change_allowed = old_type_changed or (not old_name.lower().startswith("unknown_") and old_type == Unknown)
type_change_allowed = (
# allowed via parameter
old_type_changed
# allowed from unknown to x
or (
not old_name.lower().startswith("unknown_")
and old_type == Unknown
)
# allowed for similar types
or TypesOfSameKind.match(old_type, def_by_name.field_type)
)
if old_type != def_by_name.field_type:
if type_change_allowed:
r["old_type_changed_info"].append(f"- Type of `{old_name}` (index `{old_idx}`) changed\nfrom `{old_type.__name__}` to `{def_by_name.field_type.__name__}`")
Expand Down Expand Up @@ -2325,7 +2337,7 @@ def test_compatibilities(self):
for caption, item in data.items():
ok = not item["obsolete_found"] and not item["old_not_found"] \
and not item["old_idx_wrong"] and not item["old_type_changed_err"]
do_print = not ok or len(item["old_type_changed_info"]) > 0
do_print = not ok #or len(item["old_type_changed_info"]) > 0

if do_print:
print(f"############################## Incompatibilities - {caption}:")
Expand All @@ -2345,10 +2357,10 @@ def test_compatibilities(self):
print("############################## type change error")
for err in item["old_type_changed_err"]:
print(err)
if item["old_type_changed_info"]:
print("############################## type change info")
for err in item["old_type_changed_info"]:
print(err)
#if item["old_type_changed_info"]:
# print("############################## type change info")
# for err in item["old_type_changed_info"]:
# print(err)
all_ok &= ok
assert all_ok, "Found incompatibilities. Please consider to add them to compatibilities.py"

Expand Down
Loading
Loading