Skip to content

Commit

Permalink
Merge pull request #338 from smarthomejoey/main
Browse files Browse the repository at this point in the history
Added Solar Values for LWZ Units
  • Loading branch information
pail23 authored Dec 24, 2024
2 parents ff99d3f + 89bde26 commit 7501f5d
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 4 deletions.
6 changes: 6 additions & 0 deletions custom_components/stiebel_eltron_isg/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
TARGET_TEMPERATURE_BUFFER = "target_temperature_buffer"
ACTUAL_TEMPERATURE_WATER = "actual_temperature_water"
TARGET_TEMPERATURE_WATER = "target_temperature_water"
SOLAR_COLLECTOR_TEMPERATURE = "solar_collector_temperature"
SOURCE_TEMPERATURE = "source_temperature"
SOURCE_PRESSURE = "source_pressure"
FLOW_TEMPERATURE = "flow_temperature"
Expand Down Expand Up @@ -102,6 +103,11 @@
PREVIOUS_PRODUCED_WATER_HEATING_TOTAL = "previous_produced_water_heating_total"
PRODUCED_WATER_HEATING = "produced_water_heating"

PRODUCED_SOLAR_HEATING_TODAY = "produced_solar_heating_today"
PRODUCED_SOLAR_HEATING_TOTAL = "produced_solar_heating_total"
PRODUCED_SOLAR_WATER_HEATING_TODAY = "produced_solar_water_heating_today"
PRODUCED_SOLAR_WATER_HEATING_TOTAL = "produced_solar_water_heating_total"

CONSUMED_HEATING_TODAY = "consumed_heating_today"
CONSUMED_HEATING_TOTAL = "consumed_heating_total"
PREVIOUS_CONSUMED_HEATING_TOTAL = "previous_consumed_heating_total"
Expand Down
56 changes: 53 additions & 3 deletions custom_components/stiebel_eltron_isg/lwz_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@
PRODUCED_WATER_HEATING,
PRODUCED_WATER_HEATING_TODAY,
PRODUCED_WATER_HEATING_TOTAL,
PRODUCED_SOLAR_HEATING_TODAY,
PRODUCED_SOLAR_HEATING_TOTAL,
PRODUCED_SOLAR_WATER_HEATING_TODAY,
PRODUCED_SOLAR_WATER_HEATING_TOTAL,
PUMP_ON_HK1,
RETURN_TEMPERATURE,
SERVICE,
Expand All @@ -96,6 +100,7 @@
TARGET_TEMPERATURE_HK1,
TARGET_TEMPERATURE_HK2,
TARGET_TEMPERATURE_WATER,
SOLAR_COLLECTOR_TEMPERATURE,
VENTILATION,
VENTILATION_AIR_ACTUAL_FAN_SPEED,
VENTILATION_AIR_TARGET_FLOW_RATE,
Expand Down Expand Up @@ -245,8 +250,12 @@ async def read_modbus_system_values(self) -> dict:
result[DEWPOINT_TEMPERATURE_HK2] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
# skip 27-30
decoder.skip_bytes(8)
# 27
result[SOLAR_COLLECTOR_TEMPERATURE] = get_isg_scaled_value(
decoder.decode_16bit_int()
)
# skip 28-30
decoder.skip_bytes(6)
# 31
compressor_starts_high = decoder.decode_16bit_uint()
decoder.skip_bytes(4)
Expand Down Expand Up @@ -339,17 +348,23 @@ async def read_modbus_energy(self) -> dict:
inverter_data.registers,
byteorder=Endian.BIG,
)
# 3001
produced_heating_today = self.assign_if_increased(
decoder.decode_16bit_uint(),
PRODUCED_HEATING_TODAY,
)
# 3002
produced_heating_total_low = decoder.decode_16bit_uint()
# 3003
produced_heating_total_high = decoder.decode_16bit_uint()
# 3004
produced_water_today = self.assign_if_increased(
decoder.decode_16bit_uint(),
PRODUCED_WATER_HEATING_TODAY,
)
# 3005
produced_water_total_low = decoder.decode_16bit_uint()
# 3006
produced_water_total_high = decoder.decode_16bit_uint()

result[PRODUCED_HEATING_TODAY] = produced_heating_today
Expand All @@ -370,8 +385,43 @@ async def read_modbus_energy(self) -> dict:
+ result[PRODUCED_WATER_HEATING_TODAY],
PRODUCED_WATER_HEATING,
)
# 3007 - 3010
decoder.skip_bytes(8)
# 3011 - 3013
decoder.skip_bytes(6)
# 3014
produced_solar_heating_today = self.assign_if_increased(
decoder.decode_16bit_uint(),
PRODUCED_SOLAR_HEATING_TODAY,
)
result[PRODUCED_SOLAR_HEATING_TODAY] = produced_solar_heating_today

decoder.skip_bytes(30)
# 3015
produced_solar_heating_total_low = decoder.decode_16bit_uint()
# 3016
produced_solar_heating_total_high = decoder.decode_16bit_uint()
result[PRODUCED_SOLAR_HEATING_TOTAL] = (
produced_solar_heating_total_high * 1000 + produced_solar_heating_total_low
)

# 3017
produced_solar_water_heating_today = self.assign_if_increased(
decoder.decode_16bit_uint(),
PRODUCED_SOLAR_WATER_HEATING_TODAY,
)
result[PRODUCED_SOLAR_WATER_HEATING_TODAY] = produced_solar_water_heating_today

# 3018
produced_solar_water_heating_total_low = decoder.decode_16bit_uint()
# 3019
produced_solar_water_heating_total_high = decoder.decode_16bit_uint()
result[PRODUCED_SOLAR_WATER_HEATING_TOTAL] = (
produced_solar_water_heating_total_high * 1000 + produced_solar_water_heating_total_low
)

# 3020 - 3021
decoder.skip_bytes(4)
# 3022
consumed_heating_today = self.assign_if_increased(
decoder.decode_16bit_uint(),
CONSUMED_HEATING_TODAY,
Expand Down
29 changes: 28 additions & 1 deletion custom_components/stiebel_eltron_isg/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
PRODUCED_WATER_HEATING,
PRODUCED_WATER_HEATING_TODAY,
PRODUCED_WATER_HEATING_TOTAL,
PRODUCED_SOLAR_HEATING_TODAY,
PRODUCED_SOLAR_HEATING_TOTAL,
PRODUCED_SOLAR_WATER_HEATING_TODAY,
PRODUCED_SOLAR_WATER_HEATING_TOTAL,
RETURN_TEMPERATURE,
RETURN_TEMPERATURE_WP1,
RETURN_TEMPERATURE_WP2,
Expand All @@ -104,6 +108,7 @@
TARGET_TEMPERATURE_HK2,
TARGET_TEMPERATURE_HK3,
TARGET_TEMPERATURE_WATER,
SOLAR_COLLECTOR_TEMPERATURE,
VENTILATION_AIR_ACTUAL_FAN_SPEED,
VENTILATION_AIR_TARGET_FLOW_RATE,
VOLUME_STREAM,
Expand Down Expand Up @@ -309,6 +314,10 @@ def create_volume_stream_entity_description(name, key):
"Target Temperature Water",
TARGET_TEMPERATURE_WATER,
),
create_temperature_entity_description(
"Solar Collector Temperature",
SOLAR_COLLECTOR_TEMPERATURE,
),
create_temperature_entity_description("Source Temperature", SOURCE_TEMPERATURE),
create_pressure_entity_description("Source Pressure", SOURCE_PRESSURE),
create_temperature_entity_description("Hot Gas Temperature", HOT_GAS_TEMPERATURE),
Expand Down Expand Up @@ -370,7 +379,17 @@ def create_volume_stream_entity_description(name, key):
"Produced Water Heating Total",
PRODUCED_WATER_HEATING_TOTAL,
),
create_energy_entity_description("Produced Water Heating", PRODUCED_WATER_HEATING),
create_energy_entity_description(
"Produced Water Heating",
PRODUCED_WATER_HEATING),
create_energy_entity_description(
"Produced Solar Heating Total",
PRODUCED_SOLAR_HEATING_TOTAL,
),
create_energy_entity_description(
"Produced Solar Water Heating Total",
PRODUCED_SOLAR_WATER_HEATING_TOTAL,
),
create_energy_entity_description(
"Consumed Heating Total",
CONSUMED_HEATING_TOTAL,
Expand Down Expand Up @@ -398,6 +417,14 @@ def create_volume_stream_entity_description(name, key):
"Produced Water Heating Today",
PRODUCED_WATER_HEATING_TODAY,
),
create_daily_energy_entity_description(
"Produced Solar Heating Today",
PRODUCED_SOLAR_HEATING_TODAY,
),
create_daily_energy_entity_description(
"Produced Solar Water Heating Today",
PRODUCED_SOLAR_WATER_HEATING_TODAY,
),
create_daily_energy_entity_description(
"Consumed Heating Today",
CONSUMED_HEATING_TODAY,
Expand Down

0 comments on commit 7501f5d

Please sign in to comment.