Skip to content

Commit

Permalink
add input registers for kessel
Browse files Browse the repository at this point in the history
  • Loading branch information
LavermanJJ committed Sep 13, 2022
1 parent 4821646 commit 785bcae
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pysolarfocus"
version = "1.1.3"
version = "1.2.0"
description = "Unofficial, local Solarfocus client"
authors = ["Jeroen Laverman <jjlaverman@web.de>"]
license = "Apache-2.0"
Expand Down
70 changes: 69 additions & 1 deletion pysolarfocus/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Python client lib for Solarfocus"""
__version__ = "1.1.3"
__version__ = "1.2.0"


from .const import (
Expand All @@ -19,6 +19,9 @@
HP_REGMAP_INPUT,
HP_START_ADDR,
INT,
PB_COUNT,
PB_REGMAP_INPUT,
PB_START_DDR,
PV_COUNT,
PV_REGMAP_HOLDING,
PV_REGMAP_INPUT,
Expand Down Expand Up @@ -333,6 +336,63 @@ def pv_grid_import_export(self) -> float:
"""Supply temperature of heating circuit 1"""
return self._photovoltaic_holidng_regs.get("GRID_IN_EXPORT")["value"]

@property
def pb_temperature(self) -> float:
"""Supply temperature of heating circuit 1"""
return self._pelletsboiler_input_regs.get("PELLETSBOILER_TEMPERATURE")["value"]

@property
def pb_temperature(self) -> float:
"""Supply temperature of heating circuit 1"""
return self._pelletsboiler_input_regs.get("PELLETSBOILER_TEMPERATURE")["value"]

@property
def pb_status(self) -> int:
"""Supply temperature of heating circuit 1"""
return self._pelletsboiler_input_regs.get("STATUS")["value"]

@property
def pb_message_number(self) -> int:
"""Supply temperature of heating circuit 1"""
return self._pelletsboiler_input_regs.get("MESSAGE_NUMBER")["value"]

@property
def pb_door_contact(self) -> int:
"""Supply temperature of heating circuit 1"""
return self._pelletsboiler_input_regs.get("DOOR_CONTACT")["value"]

@property
def pb_cleaning(self) -> int:
"""Supply temperature of heating circuit 1"""
return self._pelletsboiler_input_regs.get("CLEANING")["value"]

@property
def pb_ash_container(self) -> int:
"""Supply temperature of heating circuit 1"""
return self._pelletsboiler_input_regs.get("ASH_CONTAINER")["value"]

@property
def pb_outdoor_temperature(self) -> float:
"""Supply temperature of heating circuit 1"""
return self._pelletsboiler_input_regs.get("OUTDOOR_TEMPERATURE")["value"]

@property
def pb_mode(self) -> int:
"""Supply temperature of heating circuit 1"""
return self._pelletsboiler_input_regs.get("MODE_THERMINATOR")["value"]

@property
def pb_octoplus_buffer_temperature_bottom(self) -> float:
"""Supply temperature of heating circuit 1"""
return self._pelletsboiler_input_regs.get("OCTOPLUS_BUFFER_TEMPERATURE_BOTTOM")["value"]

@property
def pb_octoplus_buffer_temperature_top(self) -> float:
"""Supply temperature of heating circuit 1"""
return self._pelletsboiler_input_regs.get("OCTOPLUS_BUFFER_TEMPERATURE_TOP")["value"]



def __init__(self, conn, update_on_read=False):
"""Initialize Solarfocus communication."""
self._conn = conn
Expand All @@ -345,6 +405,7 @@ def __init__(self, conn, update_on_read=False):
self._heatpump_holding_regs = HP_REGMAP_HOLDING
self._photovoltaic_input_regs = PV_REGMAP_INPUT
self._photovoltaic_holidng_regs = PV_REGMAP_HOLDING
self._pelletsboiler_input_regs = PB_REGMAP_INPUT
self._slave = SLAVE_ID
self._update_on_read = update_on_read

Expand Down Expand Up @@ -400,6 +461,13 @@ def update_photovoltaic(self) -> bool:
result_holding = self._update_holding(self._photovoltaic_holidng_regs)
return result_input or result_holding

def update_pelletsboiler(self) -> bool:
"""Read values from Pellets boiler"""
result_input = self._update_input(
PB_START_DDR, PB_COUNT, self._pelletsboiler_input_regs
)
return result_input

def hc1_set_target_supply_temperature(self, temperature) -> bool:
"""Set target supply temperature"""
temp_scaled = int(
Expand Down
15 changes: 15 additions & 0 deletions pysolarfocus/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,21 @@
"GRID_EXPORT": {"addr": 8, "value": 0, "multiplier": 1, "count": 2, "type": INT},
}

PB_START_DDR = 2400
PB_COUNT = 11
PB_REGMAP_INPUT = {
"PELLETSBOILER_TEMPERATURE": {"addr": 0, "value": 0, "multiplier": 0.1, "count": 1, "type": INT},
"STATUS": {"addr": 1, "value": 0, "multiplier": 1, "count": 1, "type": UINT},
"MESSAGE_NUMBER": {"addr": 2, "value": 0, "multiplier": 1, "count": 1, "type": INT},
"DOOR_CONTACT": {"addr": 3, "value": 0, "multiplier": 1, "count": 1, "type": INT},
"CLEANING": {"addr": 4, "value": 0, "multiplier": 1, "count": 1, "type": INT},
"ASH_CONTAINER": {"addr": 5, "value": 0, "multiplier": 1, "count": 1, "type": INT},
"OUTDOOR_TEMPERATURE": {"addr": 6, "value": 0, "multiplier": 1, "count": 0.1, "type": INT},
"MODE_THERMINATOR": {"addr": 7, "value": 0, "multiplier": 1, "count": 1, "type": INT},
"OCTOPLUS_BUFFER_TEMPERATURE_BOTTOM": {"addr": 8, "value": 0, "multiplier": 0.1, "count": 1, "type": INT},
"OCTOPLUS_BUFFER_TEMPERATURE_TOP": {"addr": 9, "value": 0, "multiplier": 0.1, "count": 1, "type": INT},
}


HC_REGMAP_HOLDING = {
"TARGET_SUPPLY_TEMPERATURE": {
Expand Down

0 comments on commit 785bcae

Please sign in to comment.