PySaxPower 2.0.0__tar.gz → 2.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pysaxpower-2.0.0 → pysaxpower-2.0.2}/PKG-INFO +11 -11
- {pysaxpower-2.0.0 → pysaxpower-2.0.2}/PySaxPower.egg-info/PKG-INFO +11 -11
- {pysaxpower-2.0.0 → pysaxpower-2.0.2}/README.md +11 -11
- {pysaxpower-2.0.0 → pysaxpower-2.0.2}/pyproject.toml +2 -2
- pysaxpower-2.0.2/pysaxpower/sunspec/scalefactors.py +55 -0
- pysaxpower-2.0.0/pysaxpower/sunspec/scalefactors.py +0 -86
- {pysaxpower-2.0.0 → pysaxpower-2.0.2}/LICENSE +0 -0
- {pysaxpower-2.0.0 → pysaxpower-2.0.2}/PySaxPower.egg-info/SOURCES.txt +0 -0
- {pysaxpower-2.0.0 → pysaxpower-2.0.2}/PySaxPower.egg-info/dependency_links.txt +0 -0
- {pysaxpower-2.0.0 → pysaxpower-2.0.2}/PySaxPower.egg-info/requires.txt +0 -0
- {pysaxpower-2.0.0 → pysaxpower-2.0.2}/PySaxPower.egg-info/top_level.txt +0 -0
- {pysaxpower-2.0.0 → pysaxpower-2.0.2}/pysaxpower/__init__.py +0 -0
- {pysaxpower-2.0.0 → pysaxpower-2.0.2}/pysaxpower/basic_protocol/__init__.py +0 -0
- {pysaxpower-2.0.0 → pysaxpower-2.0.2}/pysaxpower/basic_protocol/basic_register.py +0 -0
- {pysaxpower-2.0.0 → pysaxpower-2.0.2}/pysaxpower/basic_protocol/power_home_plus_basic.py +0 -0
- {pysaxpower-2.0.0 → pysaxpower-2.0.2}/pysaxpower/sunspec/__init__.py +0 -0
- {pysaxpower-2.0.0 → pysaxpower-2.0.2}/pysaxpower/sunspec/power_home_plus_sunspec.py +0 -0
- {pysaxpower-2.0.0 → pysaxpower-2.0.2}/pysaxpower/sunspec/register.py +0 -0
- {pysaxpower-2.0.0 → pysaxpower-2.0.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PySaxPower
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.2
|
|
4
4
|
Summary: Python package to read and write data from/to SAX Power Home Plus batteries.
|
|
5
5
|
Author: Hannes
|
|
6
6
|
License-Expression: MIT
|
|
@@ -19,17 +19,15 @@ Dynamic: license-file
|
|
|
19
19
|
|
|
20
20
|
## Overview
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
With **PySaxPower**, you can read Modbus registers from **SAX Power Home Plus** batteries. The package is divided into two protocol implementations: **SunSpec** and **Basic**. The **Basic** protocol supports read-only operations.
|
|
22
|
+
With **PySaxPower**, you can read Modbus registers from **SAX Power Home Plus** batteries.
|
|
23
|
+
The package is divided into two protocol implementations: **SunSpec** and **Basic**.
|
|
24
|
+
The **Basic** protocol supports read-only operations.
|
|
25
|
+
View the [manual](https://sax-power.net/download/Handbuch_SAX_Home_Plus_7,7_EN.pdf) for more informations.
|
|
27
26
|
|
|
28
27
|
> **Note:**
|
|
29
|
-
> Due to a firmware
|
|
30
|
-
> To use this
|
|
31
|
-
|
|
32
|
-
---
|
|
28
|
+
> Due to a firmware error in SAX devices, only the SunSpec protocol supports writing to registers.
|
|
29
|
+
> To use this function, please ensure that at least firmware versions `Master V61` and `Gateway V54`, are installed on your battery. If this is not the case, you will need to update your firmware.
|
|
30
|
+
> You have to contact the customer support for this.
|
|
33
31
|
|
|
34
32
|
---
|
|
35
33
|
|
|
@@ -38,7 +36,7 @@ With **PySaxPower**, you can read Modbus registers from **SAX Power Home Plus**
|
|
|
38
36
|
|
|
39
37
|
| **Device** | **Documentation** |
|
|
40
38
|
| --------------------------------- |----------------------------------------------------------------------------------|
|
|
41
|
-
| Power Home Plus 5.8 kWh / 7.7 kWh | [Product page](https://sax-power.net/
|
|
39
|
+
| Power Home Plus 5.8 kWh / 7.7 kWh | [Product page](https://sax-power.net/en/products/sax-power-home-plus-7-7-kwh/) |
|
|
42
40
|
|
|
43
41
|
|
|
44
42
|
---
|
|
@@ -89,6 +87,8 @@ write_values = {
|
|
|
89
87
|
device.write_registers(write_values)
|
|
90
88
|
```
|
|
91
89
|
|
|
90
|
+
---
|
|
91
|
+
|
|
92
92
|
### Basic
|
|
93
93
|
```python
|
|
94
94
|
from pysaxpower import PowerHomePlusBasic
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PySaxPower
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.2
|
|
4
4
|
Summary: Python package to read and write data from/to SAX Power Home Plus batteries.
|
|
5
5
|
Author: Hannes
|
|
6
6
|
License-Expression: MIT
|
|
@@ -19,17 +19,15 @@ Dynamic: license-file
|
|
|
19
19
|
|
|
20
20
|
## Overview
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
With **PySaxPower**, you can read Modbus registers from **SAX Power Home Plus** batteries. The package is divided into two protocol implementations: **SunSpec** and **Basic**. The **Basic** protocol supports read-only operations.
|
|
22
|
+
With **PySaxPower**, you can read Modbus registers from **SAX Power Home Plus** batteries.
|
|
23
|
+
The package is divided into two protocol implementations: **SunSpec** and **Basic**.
|
|
24
|
+
The **Basic** protocol supports read-only operations.
|
|
25
|
+
View the [manual](https://sax-power.net/download/Handbuch_SAX_Home_Plus_7,7_EN.pdf) for more informations.
|
|
27
26
|
|
|
28
27
|
> **Note:**
|
|
29
|
-
> Due to a firmware
|
|
30
|
-
> To use this
|
|
31
|
-
|
|
32
|
-
---
|
|
28
|
+
> Due to a firmware error in SAX devices, only the SunSpec protocol supports writing to registers.
|
|
29
|
+
> To use this function, please ensure that at least firmware versions `Master V61` and `Gateway V54`, are installed on your battery. If this is not the case, you will need to update your firmware.
|
|
30
|
+
> You have to contact the customer support for this.
|
|
33
31
|
|
|
34
32
|
---
|
|
35
33
|
|
|
@@ -38,7 +36,7 @@ With **PySaxPower**, you can read Modbus registers from **SAX Power Home Plus**
|
|
|
38
36
|
|
|
39
37
|
| **Device** | **Documentation** |
|
|
40
38
|
| --------------------------------- |----------------------------------------------------------------------------------|
|
|
41
|
-
| Power Home Plus 5.8 kWh / 7.7 kWh | [Product page](https://sax-power.net/
|
|
39
|
+
| Power Home Plus 5.8 kWh / 7.7 kWh | [Product page](https://sax-power.net/en/products/sax-power-home-plus-7-7-kwh/) |
|
|
42
40
|
|
|
43
41
|
|
|
44
42
|
---
|
|
@@ -89,6 +87,8 @@ write_values = {
|
|
|
89
87
|
device.write_registers(write_values)
|
|
90
88
|
```
|
|
91
89
|
|
|
90
|
+
---
|
|
91
|
+
|
|
92
92
|
### Basic
|
|
93
93
|
```python
|
|
94
94
|
from pysaxpower import PowerHomePlusBasic
|
|
@@ -6,17 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
With **PySaxPower**, you can read Modbus registers from **SAX Power Home Plus** batteries. The package is divided into two protocol implementations: **SunSpec** and **Basic**. The **Basic** protocol supports read-only operations.
|
|
9
|
+
With **PySaxPower**, you can read Modbus registers from **SAX Power Home Plus** batteries.
|
|
10
|
+
The package is divided into two protocol implementations: **SunSpec** and **Basic**.
|
|
11
|
+
The **Basic** protocol supports read-only operations.
|
|
12
|
+
View the [manual](https://sax-power.net/download/Handbuch_SAX_Home_Plus_7,7_EN.pdf) for more informations.
|
|
14
13
|
|
|
15
14
|
> **Note:**
|
|
16
|
-
> Due to a firmware
|
|
17
|
-
> To use this
|
|
18
|
-
|
|
19
|
-
---
|
|
15
|
+
> Due to a firmware error in SAX devices, only the SunSpec protocol supports writing to registers.
|
|
16
|
+
> To use this function, please ensure that at least firmware versions `Master V61` and `Gateway V54`, are installed on your battery. If this is not the case, you will need to update your firmware.
|
|
17
|
+
> You have to contact the customer support for this.
|
|
20
18
|
|
|
21
19
|
---
|
|
22
20
|
|
|
@@ -25,7 +23,7 @@ With **PySaxPower**, you can read Modbus registers from **SAX Power Home Plus**
|
|
|
25
23
|
|
|
26
24
|
| **Device** | **Documentation** |
|
|
27
25
|
| --------------------------------- |----------------------------------------------------------------------------------|
|
|
28
|
-
| Power Home Plus 5.8 kWh / 7.7 kWh | [Product page](https://sax-power.net/
|
|
26
|
+
| Power Home Plus 5.8 kWh / 7.7 kWh | [Product page](https://sax-power.net/en/products/sax-power-home-plus-7-7-kwh/) |
|
|
29
27
|
|
|
30
28
|
|
|
31
29
|
---
|
|
@@ -76,6 +74,8 @@ write_values = {
|
|
|
76
74
|
device.write_registers(write_values)
|
|
77
75
|
```
|
|
78
76
|
|
|
77
|
+
---
|
|
78
|
+
|
|
79
79
|
### Basic
|
|
80
80
|
```python
|
|
81
81
|
from pysaxpower import PowerHomePlusBasic
|
|
@@ -96,4 +96,4 @@ values = device.get_values(read_values)
|
|
|
96
96
|
print(values)
|
|
97
97
|
|
|
98
98
|
device.close()
|
|
99
|
-
```
|
|
99
|
+
```
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "PySaxPower"
|
|
7
|
-
version = "2.0.
|
|
7
|
+
version = "2.0.2"
|
|
8
8
|
description = "Python package to read and write data from/to SAX Power Home Plus batteries."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.7"
|
|
@@ -17,4 +17,4 @@ dependencies = [
|
|
|
17
17
|
]
|
|
18
18
|
|
|
19
19
|
[project.urls]
|
|
20
|
-
Homepage = "https://github.com/Hans-4/pysaxpower"
|
|
20
|
+
Homepage = "https://github.com/Hans-4/pysaxpower"
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
from pysaxpower.sunspec.register import SunSpecRegister
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class SunSpecScaleFactors(object):
|
|
5
|
+
|
|
6
|
+
def __init__(self):
|
|
7
|
+
self.register = SunSpecRegister()
|
|
8
|
+
|
|
9
|
+
def search_scale_factor(self, address: int) -> int | None:
|
|
10
|
+
r = self.register
|
|
11
|
+
|
|
12
|
+
if 40017 <= address <= 40020:
|
|
13
|
+
return r.AC_Current_Scalefactor
|
|
14
|
+
elif 40022 <= address <= 40027:
|
|
15
|
+
return r.Voltage_Scalefactor
|
|
16
|
+
elif address == 40029:
|
|
17
|
+
return r.ActivePower_Scalefactor
|
|
18
|
+
elif address == 40031:
|
|
19
|
+
return r.Frequency_Scalefactor
|
|
20
|
+
elif address == 40033:
|
|
21
|
+
return r.ApparentPower_Scalefactor
|
|
22
|
+
elif address == 40035:
|
|
23
|
+
return r.ReactivePower_Scalefactor
|
|
24
|
+
elif address == 40037:
|
|
25
|
+
return r.PowerFactor_Scalefactor
|
|
26
|
+
elif address == 40041:
|
|
27
|
+
return r.Temperature_Scalefactor
|
|
28
|
+
elif address == 40045:
|
|
29
|
+
return r.PV_Power_Scalefactor
|
|
30
|
+
elif address == 40049:
|
|
31
|
+
return r.PowerTargetScalefactor
|
|
32
|
+
elif 40056 <= address <= 40059:
|
|
33
|
+
return r.AC_Current_Scalefactor_Grid
|
|
34
|
+
elif 40061 <= address <= 40068:
|
|
35
|
+
return r.Voltage_Scalefactor_Grid
|
|
36
|
+
elif address == 40070:
|
|
37
|
+
return r.Frequency_Scalefactor_Grid
|
|
38
|
+
elif 40072 <= address <= 40075:
|
|
39
|
+
return r.ActiveGridPower_Scalefactor
|
|
40
|
+
elif 40077 <= address <= 40080:
|
|
41
|
+
return r.ApparentPower_Scalefactor_Grid
|
|
42
|
+
elif 40082 <= address <= 40085:
|
|
43
|
+
return r.ReactivePower_Scalefactor_Grid
|
|
44
|
+
elif 40087 <= address <= 40090:
|
|
45
|
+
return r.PowerFactor_Scalefactor_Grid
|
|
46
|
+
elif address == 40097:
|
|
47
|
+
return r.Capacity_Scalefactor
|
|
48
|
+
elif 40098 <= address <= 40099:
|
|
49
|
+
return r.ChargeDischargePower_Scalefactor
|
|
50
|
+
elif 40100 <= address <= 40102:
|
|
51
|
+
return r.SoC_Scalefactor
|
|
52
|
+
elif address == 40109:
|
|
53
|
+
return r.CellVoltage_Scalefactor
|
|
54
|
+
else:
|
|
55
|
+
return None
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
from pysaxpower.sunspec.register import SunSpecRegister
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class SunSpecScaleFactors(object):
|
|
5
|
-
"""Ordnet einer Registeradresse die Adresse des zugehoerigen sunsf-Registers zu.
|
|
6
|
-
|
|
7
|
-
Rueckgabe ist die ADRESSE des Scalefaktor-Registers, nicht dessen Wert.
|
|
8
|
-
None bedeutet: fuer dieses Register existiert laut Dokumentation kein
|
|
9
|
-
Scalefaktor (Well-Known-Werte, Enums, Timeouts, sunsf-Register selbst).
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
def __init__(self):
|
|
13
|
-
self.register = SunSpecRegister()
|
|
14
|
-
|
|
15
|
-
def search_scale_factor(self, address: int) -> int | None:
|
|
16
|
-
r = self.register
|
|
17
|
-
|
|
18
|
-
# ------------------------------------------------------------------
|
|
19
|
-
# Modell 103 - Speicherelektronik (40015 - 40046)
|
|
20
|
-
# ------------------------------------------------------------------
|
|
21
|
-
if 40017 <= address <= 40020: # AC Strom Speicher Summe/A/B/C
|
|
22
|
-
return r.AC_Current_Scalefactor # 40021, SF = -2
|
|
23
|
-
elif 40022 <= address <= 40027: # Spannung Speicher L-L und A/B/C
|
|
24
|
-
return r.Voltage_Scalefactor # 40028, SF = -1
|
|
25
|
-
elif address == 40029: # Wirkleistung Speicher Summe
|
|
26
|
-
return r.ActivePower_Scalefactor # 40030, SF = 0
|
|
27
|
-
elif address == 40031: # Netzfrequenz (Speicher)
|
|
28
|
-
return r.Frequency_Scalefactor # 40032, SF = -2
|
|
29
|
-
elif address == 40033: # Scheinleistung Speicher Summe
|
|
30
|
-
return r.ApparentPower_Scalefactor # 40034, SF = 0
|
|
31
|
-
elif address == 40035: # Blindleistung Speicher Summe
|
|
32
|
-
return r.ReactivePower_Scalefactor # 40036, SF = 0
|
|
33
|
-
elif address == 40037: # Leistungsfaktor Speicher Summe
|
|
34
|
-
return r.PowerFactor_Scalefactor # 40038, SF = -3
|
|
35
|
-
elif address == 40041: # Maximale Zelltemperatur
|
|
36
|
-
return r.Temperature_Scalefactor # 40042, SF = 0
|
|
37
|
-
elif address == 40045: # PV-Leistung (nur mit ADW200)
|
|
38
|
-
return r.PV_Power_Scalefactor # 40046, SF = 1
|
|
39
|
-
|
|
40
|
-
# ------------------------------------------------------------------
|
|
41
|
-
# Modell 123 - Immediate Controls (40047 - 40053)
|
|
42
|
-
# ------------------------------------------------------------------
|
|
43
|
-
elif address == 40049: # Leistungsvorgabe prozentual
|
|
44
|
-
return r.PowerTargetScalefactor # 40052, SF = -2
|
|
45
|
-
# 40050 Timeout (s), 40051 Steuermodus (Enum),
|
|
46
|
-
# 40053 Referenzwert Maximalleistung (W, Well-Known) -> kein SF
|
|
47
|
-
|
|
48
|
-
# ------------------------------------------------------------------
|
|
49
|
-
# Modell 203 - WYE Connect 3Ph Meter ABC / ADW200 (40054 - 40094)
|
|
50
|
-
# ------------------------------------------------------------------
|
|
51
|
-
elif 40056 <= address <= 40059: # AC Strom Netz Summe/L1/L2/L3
|
|
52
|
-
return r.AC_Current_Scalefactor_Grid # 40060, SF = -1
|
|
53
|
-
elif 40061 <= address <= 40068: # Netzspannungen L-N und L-L
|
|
54
|
-
return r.Voltage_Scalefactor_Grid # 40069, SF = -1
|
|
55
|
-
elif address == 40070: # Netzfrequenz
|
|
56
|
-
return r.Frequency_Scalefactor_Grid # 40071, SF = -2
|
|
57
|
-
elif 40072 <= address <= 40075: # Wirkleistung Netz Summe/L1/L2/L3
|
|
58
|
-
return r.ActiveGridPower_Scalefactor # 40076, SF = 1
|
|
59
|
-
elif 40077 <= address <= 40080: # Scheinleistung Netz Summe/L1/L2/L3
|
|
60
|
-
return r.ApparentPower_Scalefactor_Grid # 40081, SF = 1
|
|
61
|
-
elif 40082 <= address <= 40085: # Blindleistung Netz Summe/L1/L2/L3
|
|
62
|
-
return r.ReactivePower_Scalefactor_Grid # 40086, SF = 1
|
|
63
|
-
elif 40087 <= address <= 40090: # Leistungsfaktor Netz Summe/L1/L2/L3
|
|
64
|
-
return r.PowerFactor_Scalefactor_Grid # 40091, SF = -3
|
|
65
|
-
|
|
66
|
-
# ------------------------------------------------------------------
|
|
67
|
-
# Modell 802 - Battery Base Model (40095 - 40114)
|
|
68
|
-
# ------------------------------------------------------------------
|
|
69
|
-
elif address == 40097: # Kapazitaet Speichersystem (Wh)
|
|
70
|
-
return r.Capacity_Scalefactor # 40110, SF = 0
|
|
71
|
-
elif 40098 <= address <= 40099: # Verf. Lade-/Entladeleistung (W)
|
|
72
|
-
return r.ChargeDischargePower_Scalefactor # 40111, SF = 0
|
|
73
|
-
elif 40100 <= address <= 40102: # Max/Min/Aktueller SoC (%)
|
|
74
|
-
return r.SoC_Scalefactor # 40112, SF = 0
|
|
75
|
-
elif address == 40109: # Durchschnittliche Zellspannung (mV)
|
|
76
|
-
return r.CellVoltage_Scalefactor # 40114, SF = 0
|
|
77
|
-
|
|
78
|
-
# 40103 Entladetiefe (%): in der Dokumentation ist KEIN Scalefaktor
|
|
79
|
-
# zugeordnet. Kandidat waere 40113 (Reserve, int16 sunsf, Wert 0),
|
|
80
|
-
# das an der Position von DoD_SF im SunSpec-Modell 802 steht.
|
|
81
|
-
# Bewusst nicht geraten -> None.
|
|
82
|
-
|
|
83
|
-
# 40000-40016, 40039/40040, 40043/40044, 40092-40094, 40104-40108,
|
|
84
|
-
# sowie alle sunsf-Register selbst haben keinen Scalefaktor.
|
|
85
|
-
else:
|
|
86
|
-
return None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|