Skip to content

Commit

Permalink
Merge pull request #192 from MiJo112/main
Browse files Browse the repository at this point in the history
Add some Registers
  • Loading branch information
pail23 authored Feb 7, 2024
2 parents 25cb31c + 3b2b027 commit 3ee5278
Show file tree
Hide file tree
Showing 4 changed files with 179 additions and 34 deletions.
17 changes: 17 additions & 0 deletions custom_components/stiebel_eltron_isg/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,20 @@
HIGH_PRESSURE = "high_pressure"
LOW_PRESSURE = "low_pressure"

RETURN_TEMPERATURE_WP1 = "return_temperature_wp1"
FLOW_TEMPERATURE_WP1 = "flow_temperature_wp1"
HOT_GAS_TEMPERATURE_WP1 = "hot_gas_temperature_wp1"
LOW_PRESSURE_WP1 = "low_pressure_wp1"
HIGH_PRESSURE_WP1 = "high_pressure_wp1"
VOLUME_STREAM_WP1 = "volume_stream_wp1"
RETURN_TEMPERATURE_WP2 = "return_temperature_wp2"
FLOW_TEMPERATURE_WP2 = "flow_temperature_wp2"
HOT_GAS_TEMPERATURE_WP2 = "hot_gas_temperature_wp2"
LOW_PRESSURE_WP2 = "low_pressure_wp2"
HIGH_PRESSURE_WP2 = "high_pressure_wp2"
VOLUME_STREAM_WP2 = "volume_stream_wp2"


OPERATION_MODE = "operation_mode"

PRODUCED_HEATING_TODAY = "produced_heating_today"
Expand Down Expand Up @@ -114,9 +128,12 @@
COMFORT_TEMPERATURE_TARGET_HK2 = "comfort_temperature_target_hk2"
ECO_TEMPERATURE_TARGET_HK2 = "eco_temperature_target_hk2"
HEATING_CURVE_RISE_HK2 = "heating_curve_rise_hk2"
DUALMODE_TEMPERATURE_HZG = "dualmode_temperature_hzg"

COMFORT_WATER_TEMPERATURE_TARGET = "comfort_water_temperature_target"
ECO_WATER_TEMPERATURE_TARGET = "eco_water_temperature_target"
DUALMODE_TEMPERATURE_WW = "dualmode_temperature_ww"

AREA_COOLING_TARGET_ROOM_TEMPERATURE = "area_cooling_target_room_temperature"
AREA_COOLING_TARGET_FLOW_TEMPERATURE = "area_cooling_target_flow_temperature"
FAN_COOLING_TARGET_ROOM_TEMPERATURE = "fan_cooling_target_room_temperature"
Expand Down
22 changes: 22 additions & 0 deletions custom_components/stiebel_eltron_isg/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
COMFORT_TEMPERATURE_TARGET_HK2,
ECO_TEMPERATURE_TARGET_HK2,
HEATING_CURVE_RISE_HK2,
DUALMODE_TEMPERATURE_HZG,
COMFORT_WATER_TEMPERATURE_TARGET,
ECO_WATER_TEMPERATURE_TARGET,
DUALMODE_TEMPERATURE_WW,
AREA_COOLING_TARGET_ROOM_TEMPERATURE,
AREA_COOLING_TARGET_FLOW_TEMPERATURE,
FAN_COOLING_TARGET_ROOM_TEMPERATURE,
Expand Down Expand Up @@ -72,6 +74,16 @@
native_max_value=30,
native_step=0.1,
),
NumberEntityDescription(
DUALMODE_TEMPERATURE_HZG,
has_entity_name=True,
name="Dual Mode Temperature HZG",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
icon="mdi:thermometer-off",
native_min_value=-20,
native_max_value=40,
native_step=0.1,
),
NumberEntityDescription(
COMFORT_WATER_TEMPERATURE_TARGET,
has_entity_name=True,
Expand All @@ -92,6 +104,16 @@
native_max_value=60,
native_step=0.1,
),
NumberEntityDescription(
DUALMODE_TEMPERATURE_WW,
has_entity_name=True,
name="Dual Mode Temperature WW",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
icon="mdi:thermometer-off",
native_min_value=-20,
native_max_value=40,
native_step=0.1,
),
NumberEntityDescription(
AREA_COOLING_TARGET_ROOM_TEMPERATURE,
has_entity_name=True,
Expand Down
24 changes: 24 additions & 0 deletions custom_components/stiebel_eltron_isg/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@
HOT_GAS_TEMPERATURE,
HIGH_PRESSURE,
LOW_PRESSURE,
RETURN_TEMPERATURE_WP1,
FLOW_TEMPERATURE_WP1,
HOT_GAS_TEMPERATURE_WP1,
LOW_PRESSURE_WP1,
HIGH_PRESSURE_WP1,
VOLUME_STREAM_WP1,
RETURN_TEMPERATURE_WP2,
FLOW_TEMPERATURE_WP2,
HOT_GAS_TEMPERATURE_WP2,
LOW_PRESSURE_WP2,
HIGH_PRESSURE_WP2,
VOLUME_STREAM_WP2,
HEATER_PRESSURE,
VOLUME_STREAM,
SG_READY_STATE,
Expand Down Expand Up @@ -235,6 +247,18 @@ def create_volume_stream_entity_description(name, key):
create_temperature_entity_description("Hot Gas Temperature", HOT_GAS_TEMPERATURE),
create_pressure_entity_description("High Pressure", HIGH_PRESSURE),
create_pressure_entity_description("Low Pressure", LOW_PRESSURE),
create_temperature_entity_description("Return Temperature WP1", RETURN_TEMPERATURE_WP1),
create_temperature_entity_description("Flow Temperature WP1", FLOW_TEMPERATURE_WP1),
create_temperature_entity_description("Hot Gas Temperature WP1", HOT_GAS_TEMPERATURE_WP1),
create_pressure_entity_description("Low Pressure WP1", LOW_PRESSURE_WP1),
create_pressure_entity_description("High Pressure WP1", HIGH_PRESSURE_WP1),
create_volume_stream_entity_description("Volume Stream WP1", VOLUME_STREAM_WP1),
create_temperature_entity_description("Return Temperature WP2", RETURN_TEMPERATURE_WP2),
create_temperature_entity_description("Flow Temperature WP2", FLOW_TEMPERATURE_WP2),
create_temperature_entity_description("Hot Gas Temperature WP2", HOT_GAS_TEMPERATURE_WP2),
create_pressure_entity_description("Low Pressure WP2", LOW_PRESSURE_WP2),
create_pressure_entity_description("High Pressure WP2", HIGH_PRESSURE_WP2),
create_volume_stream_entity_description("Volume Stream WP2", VOLUME_STREAM_WP2),
SensorEntityDescription(
ACTIVE_ERROR,
name="Active Error",
Expand Down
150 changes: 116 additions & 34 deletions custom_components/stiebel_eltron_isg/wpm_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@
from pymodbus.payload import BinaryPayloadDecoder

from .const import (
ACTUAL_HUMIDITY_HK1,
ACTUAL_HUMIDITY_HK2,
ACTUAL_HUMIDITY_HK3,
ACTUAL_TEMPERATURE,
DEWPOINT_TEMPERATURE_HK1,
DEWPOINT_TEMPERATURE_HK2,
DEWPOINT_TEMPERATURE_HK3,
ACTUAL_TEMPERATURE,
TARGET_TEMPERATURE,
ACTUAL_TEMPERATURE_FEK,
TARGET_TEMPERATURE_FEK,
Expand All @@ -32,26 +26,44 @@
TARGET_TEMPERATURE_HK1,
ACTUAL_TEMPERATURE_HK2,
TARGET_TEMPERATURE_HK2,
FLOW_TEMPERATURE,
FLOW_TEMPERATURE_NHZ,
RETURN_TEMPERATURE,
ACTUAL_TEMPERATURE_BUFFER,
TARGET_TEMPERATURE_BUFFER,
ACTUAL_TEMPERATURE_WATER,
ACTUAL_ROOM_TEMPERATURE_HK1,
TARGET_ROOM_TEMPERATURE_HK1,
ACTUAL_ROOM_TEMPERATURE_HK2,
TARGET_ROOM_TEMPERATURE_HK2,
ACTUAL_ROOM_TEMPERATURE_HK3,
TARGET_ROOM_TEMPERATURE_HK3,
TARGET_TEMPERATURE_WATER,
HEATER_PRESSURE,
VOLUME_STREAM,
ACTUAL_TEMPERATURE_WATER,
TARGET_TEMPERATURE_WATER,
SOURCE_TEMPERATURE,
SOURCE_PRESSURE,
HOT_GAS_TEMPERATURE,
HIGH_PRESSURE,
LOW_PRESSURE,
FLOW_TEMPERATURE,
FLOW_TEMPERATURE_NHZ,
RETURN_TEMPERATURE,
RETURN_TEMPERATURE_WP1,
FLOW_TEMPERATURE_WP1,
HOT_GAS_TEMPERATURE_WP1,
LOW_PRESSURE_WP1,
HIGH_PRESSURE_WP1,
VOLUME_STREAM_WP1,
RETURN_TEMPERATURE_WP2,
FLOW_TEMPERATURE_WP2,
HOT_GAS_TEMPERATURE_WP2,
LOW_PRESSURE_WP2,
HIGH_PRESSURE_WP2,
VOLUME_STREAM_WP2,
ACTUAL_ROOM_TEMPERATURE_HK1,
TARGET_ROOM_TEMPERATURE_HK1,
ACTUAL_HUMIDITY_HK1,
DEWPOINT_TEMPERATURE_HK1,
ACTUAL_ROOM_TEMPERATURE_HK2,
TARGET_ROOM_TEMPERATURE_HK2,
ACTUAL_HUMIDITY_HK2,
DEWPOINT_TEMPERATURE_HK2,
ACTUAL_ROOM_TEMPERATURE_HK3,
TARGET_ROOM_TEMPERATURE_HK3,
ACTUAL_HUMIDITY_HK3,
DEWPOINT_TEMPERATURE_HK3,
PRODUCED_HEATING_TODAY,
PRODUCED_HEATING_TOTAL,
PRODUCED_WATER_HEATING_TODAY,
Expand Down Expand Up @@ -81,8 +93,10 @@
COMFORT_TEMPERATURE_TARGET_HK2,
ECO_TEMPERATURE_TARGET_HK2,
HEATING_CURVE_RISE_HK2,
DUALMODE_TEMPERATURE_HZG,
COMFORT_WATER_TEMPERATURE_TARGET,
ECO_WATER_TEMPERATURE_TARGET,
DUALMODE_TEMPERATURE_WW,
AREA_COOLING_TARGET_ROOM_TEMPERATURE,
AREA_COOLING_TARGET_FLOW_TEMPERATURE,
FAN_COOLING_TARGET_ROOM_TEMPERATURE,
Expand Down Expand Up @@ -199,12 +213,9 @@ def read_modbus_system_values(self) -> dict:
decoder.decode_16bit_int()
)
#513
if self._model_id == 391: #WPM3i
result[FLOW_TEMPERATURE] = get_isg_scaled_value(
result[FLOW_TEMPERATURE] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
else:
decoder.skip_bytes(2)
#514
result[FLOW_TEMPERATURE_NHZ] = get_isg_scaled_value(
decoder.decode_16bit_int()
Expand Down Expand Up @@ -266,16 +277,59 @@ def read_modbus_system_values(self) -> dict:
decoder.decode_16bit_int()
)
#542
decoder.skip_bytes(2)
result[RETURN_TEMPERATURE_WP1] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
#543
if self._model_id != 391: #WPM3i
result[FLOW_TEMPERATURE] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
else:
decoder.skip_bytes(2)
#544-583
decoder.skip_bytes(80)
result[FLOW_TEMPERATURE_WP1] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
#544
result[HOT_GAS_TEMPERATURE_WP1] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
#545
result[LOW_PRESSURE_WP1] = get_isg_scaled_value(
decoder.decode_16bit_int(), 100
)
#546
decoder.skip_bytes(2)
#547
result[HIGH_PRESSURE_WP1] = get_isg_scaled_value(
decoder.decode_16bit_int(), 100
)
#548
result[VOLUME_STREAM_WP1] = get_isg_scaled_value(
decoder.decode_16bit_int(), 10
)
#549
result[RETURN_TEMPERATURE_WP2] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
#550
result[FLOW_TEMPERATURE_WP2] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
#551
result[HOT_GAS_TEMPERATURE_WP2] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
#552
result[LOW_PRESSURE_WP2] = get_isg_scaled_value(
decoder.decode_16bit_int(), 100
)
#553
decoder.skip_bytes(2)
#554
result[HIGH_PRESSURE_WP2] = get_isg_scaled_value(
decoder.decode_16bit_int(), 100
)
#555
result[VOLUME_STREAM_WP2] = get_isg_scaled_value(
decoder.decode_16bit_int(), 10
)
#546-583
decoder.skip_bytes(56)
#584
result[ACTUAL_ROOM_TEMPERATURE_HK1] = get_isg_scaled_value(
decoder.decode_16bit_int()
Expand Down Expand Up @@ -324,7 +378,6 @@ def read_modbus_system_values(self) -> dict:
result[DEWPOINT_TEMPERATURE_HK3] = get_isg_scaled_value(
decoder.decode_16bit_int()
)

result["system_values"] = list(inverter_data.registers)
return result

Expand All @@ -336,44 +389,69 @@ def read_modbus_system_paramter(self) -> dict:
decoder = BinaryPayloadDecoder.fromRegisters(
inverter_data.registers, byteorder=Endian.BIG
)
#1501
result[OPERATION_MODE] = decoder.decode_16bit_uint()
#1502
result[COMFORT_TEMPERATURE_TARGET_HK1] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
#1503
result[ECO_TEMPERATURE_TARGET_HK1] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
#1504
result[HEATING_CURVE_RISE_HK1] = get_isg_scaled_value(
decoder.decode_16bit_int(), 100
)
#1505
result[COMFORT_TEMPERATURE_TARGET_HK2] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
#1506
result[ECO_TEMPERATURE_TARGET_HK2] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
#1507
result[HEATING_CURVE_RISE_HK2] = get_isg_scaled_value(
decoder.decode_16bit_int(), 100
)
decoder.skip_bytes(4)
#1508
decoder.skip_bytes(2)
#1509
result[DUALMODE_TEMPERATURE_HZG] = get_isg_scaled_value(
decoder.decode_16bit_int(),10
)
#1510
result[COMFORT_WATER_TEMPERATURE_TARGET] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
#1511
result[ECO_WATER_TEMPERATURE_TARGET] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
decoder.skip_bytes(4)
#1512
decoder.skip_bytes(2)
#1513
result[DUALMODE_TEMPERATURE_WW] = get_isg_scaled_value(
decoder.decode_16bit_int(),10
)
#1514
result[AREA_COOLING_TARGET_FLOW_TEMPERATURE] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
#1515
decoder.skip_bytes(2)
#1516
result[AREA_COOLING_TARGET_ROOM_TEMPERATURE] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
#1517
result[FAN_COOLING_TARGET_FLOW_TEMPERATURE] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
#1518
decoder.skip_bytes(2)
#1519
result[FAN_COOLING_TARGET_ROOM_TEMPERATURE] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
Expand Down Expand Up @@ -442,10 +520,14 @@ def set_data(self, key, value) -> None:
self.write_register(address=1505, value=int(value * 10), slave=1)
elif key == HEATING_CURVE_RISE_HK2:
self.write_register(address=1506, value=int(value * 100), slave=1)
elif key == DUALMODE_TEMPERATURE_HZG:
self.write_register(address=1508, value=int(value * 10), slave=1)
elif key == COMFORT_WATER_TEMPERATURE_TARGET:
self.write_register(address=1509, value=int(value * 10), slave=1)
elif key == ECO_WATER_TEMPERATURE_TARGET:
self.write_register(address=1510, value=int(value * 10), slave=1)
elif key == DUALMODE_TEMPERATURE_WW:
self.write_register(address=1512, value=int(value * 10), slave=1)
elif key == AREA_COOLING_TARGET_FLOW_TEMPERATURE:
self.write_register(address=1513, value=int(value * 10), slave=1)
elif key == AREA_COOLING_TARGET_ROOM_TEMPERATURE:
Expand Down

0 comments on commit 3ee5278

Please sign in to comment.