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

add solar component #19

Merged
merged 1 commit into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,29 @@

This integration has been tested with Solarfocus eco<sup>manager-touch</sup> version `21.040`.

### Systems

* Heat pump vamp<sup>air</sup> with eco<sup>_manager-touch_</sup>
* Biomass boiler thermi<sup>nator</sup> II

### Solarfocus Components

| Components | Supported |
|---|---|
| Heating Circuits (_Heizkreis_)| :white_check_mark: |
| Buffers (_Puffer_) | :white_check_mark: |
| Solar (_Solar_)| :x:|
| Boilers (_Boiler_) | :white_check_mark: |
| Heating Circuits (_Heizkreis_) 1-8 | :white_check_mark: |
| Buffers (_Puffer_) 1-4 | :white_check_mark: |
| Solar (_Solar_)| :white_check_mark:|
| Boilers (_Boiler_) 1-4 | :white_check_mark: |
| Heatpump (_Wärmepumpe_) | :white_check_mark: |
| Biomassboiler (_Kessel_) | :white_check_mark: |

_Note: Different components or heating systems could be supported in the future_

## Usage

```python
from pysolarfocus import SolarfocusAPI,Systems

# Create the Solarfocus API client
solarfocus = SolarfocusAPI(ip=[Your-IP],system=Systems.Vampair)
solarfocus = SolarfocusAPI(ip="[Your-IP]",system=Systems.Vampair)
# Connect to the heating system
solarfocus.connect()
# Fetch the values
Expand All @@ -37,12 +40,12 @@ print(solarfocus.heating_circuit[0])
```

### Handling multiple components e.g. heating circuits
_Solarfocus systems allow the use of multiple heating circuits, buffers and boilers. The api can be configured to interact with multiple components._
Solarfocus systems allow the use of multiple heating circuits, buffers and boilers. The api can be configured to interact with multiple components.

```python

# Create the Solarfocus API client with 2 Heating Circuits
solarfocus = SolarfocusAPI(ip=[Your-IP],heating_circuit_count=2,system=Systems.Vampair)
solarfocus = SolarfocusAPI(ip="[Your-IP]",heating_circuit_count=2,system=Systems.Vampair)
# Connect to the heating system
solarfocus.connect()

Expand Down
2 changes: 2 additions & 0 deletions example.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@
print(solarfocus.heatpump)
print("\n")
print(solarfocus.photovoltaic)
print("\n")
print(solarfocus.solar)
8 changes: 7 additions & 1 deletion pysolarfocus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def __init__(self,
self.heatpump = self.__factory.heatpump(system)
self.photovoltaic = self.__factory.photovoltaic(system)
self.pelletsboiler = self.__factory.pelletsboiler(system)
self.solar = self.__factory.solar(system)
self._slave_id = slave_id
self._system = system

Expand All @@ -69,6 +70,7 @@ def update(self):
and self.update_heatpump()
and self.update_photovoltaic()
and self.update_pelletsboiler()
and self.update_solar()
):
return True
return False
Expand Down Expand Up @@ -104,4 +106,8 @@ def update_photovoltaic(self) -> bool:

def update_pelletsboiler(self) -> bool:
"""Read values from Pellets boiler"""
return self.pelletsboiler.update()
return self.pelletsboiler.update()

def update_solar(self) -> bool:
"""Read values from Solar"""
return self.solar.update()
4 changes: 4 additions & 0 deletions pysolarfocus/component_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from .components.buffer import *
from .components.pellets_boiler import *
from .components.photovoltaic import *
from .components.solar import *
from .modbus_wrapper import ModbusConnector
from . import Systems

Expand Down Expand Up @@ -55,3 +56,6 @@ def photovoltaic(self, system:Systems)->Photovoltaic:
def pelletsboiler(self, system:Systems)->PelletsBoiler:
return PelletsBoiler()._initialize(self.__modbus_connector)

def solar(self, system:Systems)->Solar:
return Solar()._initialize(self.__modbus_connector)

20 changes: 20 additions & 0 deletions pysolarfocus/components/solar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from .base.component import Component
from .base.enums import DataTypes
from .base.data_value import DataValue

class Solar(Component):
def __init__(self) -> None:
super().__init__(input_address=2100)
self.collector_temperature_1 = DataValue(address=0,multiplier=0.1)
self.collector_temperature_2 = DataValue(address=1,multiplier=0.1)
self.collector_supply_temperature = DataValue(address=2,multiplier=0.1)
self.collector_return_temperature = DataValue(address=3,multiplier=0.1)
self.flow_heat_meter = DataValue(address=4,multiplier=0.1)
self.curent_power = DataValue(address=5,multiplier=0.1)
self.curent_yield_heat_meter = DataValue(address=6,count=2)
self.today_yield = DataValue(address=8,count=2)
self.buffer_sensor_1 = DataValue(address=10,multiplier=0.1)
self.buffer_sensor_2 = DataValue(address=11,multiplier=0.1)
self.buffer_sensor_3 = DataValue(address=12,multiplier=0.1)
self.state = DataValue(address=13,type=DataTypes.UINT)