Skip to content

Commit 2b37ce3

Browse files
committed
Added support for multiple inverters
1 parent c74af29 commit 2b37ce3

File tree

3 files changed

+52
-4
lines changed

3 files changed

+52
-4
lines changed

README.md

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1+
- [SolisCloud to PVOutput and/or Domoticz](#soliscloud-to-pvoutput-andor-domoticz)
2+
- [SolisCloud](#soliscloud)
3+
- [PVOutput](#pvoutput)
4+
- [Domoticz](#domoticz)
5+
- [Configuration](#configuration)
6+
- [Configuration with multiple inverters in one SolisCloud station](#configuration-with-multiple-inverters-in-one-soliscloud-station)
7+
- [Combined data of two PVOutput accounts/inverters](#combined-data-of-two-pvoutput-accountsinverters)
8+
- [Usage](#usage)
9+
- [Windows 10](#windows-10)
10+
- [Raspberry pi](#raspberry-pi)
11+
- [Raspberry pi Configuration](#raspberry-pi-configuration)
12+
- [log files](#log-files)
13+
- [Example output solis.log](#example-output-solislog)
14+
115
# SolisCloud to PVOutput and/or Domoticz
2-
Simple Python3 script to copy latest (normally once per 5 minutes) SolisCloud portal update to PVOutput portal and/or Domoticz.
16+
Simple Python3 script to copy latest (normally once per 5 minutes) SolisCloud portal inverter update to PVOutput portal and/or Domoticz.
317

4-
The soliscloud_to_pvoutput.py script will get the first station id with the secrets of SolisCloud (see next section). Thereafter it will get the first inverter id and serial number. Then in an endless loop the inverter details are fetched and the following information is used:
18+
The soliscloud_to_pvoutput.py script will get the first station id with the secrets of SolisCloud (see next section). Thereafter it will get the inverter id and serial number via the configured SOLISCLOUD_INVERTER_INDEX (default the first inverter). Then in an endless loop the inverter details are fetched and the following information is used:
519
* timestamp
620
* DC PV voltage (assuming no more than 4 strings)
721
* watt (current)
@@ -16,7 +30,7 @@ Notes
1630
* the script will exit outside 5 and 23
1731
* Each new day the "watthour today" starts with 0
1832
* Because the resolution of the SolisCloud watthour is in 100 Watt, a higher resolution is computed with current Watt
19-
* if you have more than 1 station/inverter, more than 4 strings or a 3 phase inverter, you need to adapt the script
33+
* if you have more than 1 station, more than 4 strings or a 3 phase inverter, you need to adapt the script
2034

2135
## SolisCloud
2236
[SolisCloud](https://www.soliscloud.com/) is the next generation Portal for Solis branded PV systems from Ginlong.
@@ -41,12 +55,22 @@ The python script requires a PVOutput API_KEY and SYSTEM_ID to function.
4155
* Make a note of your System Id
4256
* Save your settings
4357

58+
## Domoticz
59+
[Domoticz](https://www.domoticz.com/) is a very light weight home automation system that lets you monitor and configure miscellaneous devices, including lights, switches, various sensors/meters like temperature, rainfall, wind, ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and many more. Notifications/alerts can be sent to any mobile device.
60+
61+
If you want to know how to configure in Domoticz your inverter, see [this discussion](https://github.com/ZuinigeRijder/SolisCloud2PVOutput/discussions/18).
62+
63+
![alt text](https://user-images.githubusercontent.com/17342657/237064859-b7bcb83a-a753-4399-b60d-801bdd2741a3.png)
64+
65+
![alt text](https://user-images.githubusercontent.com/17342657/237064582-59fcd74b-5b04-4578-98a4-18819bf8482f.png)
66+
4467
## Configuration
4568
Change in soliscloud_to_pvoutput.cfg the following lines with your above obtained secrets and domoticz configuration, including if you want to send to PVOutput, Domoticz or both. By default only output is send to PVOutput:
4669
* send_to_pvoutput = True
4770
* soliscloud_api_id = 1300386381123456789
4871
* soliscloud_api_secret = 304abf2bd8a44242913d704123456789
4972
* soliscloud_api_url = https://www.soliscloud.com:13333
73+
* soliscloud_inverter_index = 0
5074
* pvoutput_api_key = 0f2dd8190d00369ec893b059034dde1123456789
5175
* pvoutput_system_id = 12345
5276
* send_to_domoticz = False
@@ -56,6 +80,26 @@ Change in soliscloud_to_pvoutput.cfg the following lines with your above obtaine
5680
* domot_inverter_temp_id = 0
5781
* domot_volt_id = 0
5882

83+
## Configuration with multiple inverters in one SolisCloud station
84+
85+
Make 2 PVOutput accounts (you need 2 email addresses) for each inverter a separate PVOutput account. Make sure to configure the PVOutput accounts and get the PVOutput API keys.
86+
87+
The solution is to have 2 scripts running in different directories (one for each inverter) and for the each directory you do modifications, e.g. the configuration to get the appropriate inverter and send the output to a appropriate PVOutput account as target.
88+
89+
Create two directories, copy the SolisCloud2PVOutput files to each directory and configure in each directory soliscloud_to_pvoutput.cfg:
90+
- solis
91+
- solis2
92+
93+
In solis2 directory you change the following:
94+
- modify soliscloud_to_pvoutput.cfg to point the second PVOutput account secrets and change the soliscloud_inverter_index to 1 (to get the data of the second inverter)
95+
- rename solis.sh to solis2.sh and modify solis2.sh to go to directory solis2 (line 9: cd ~/solis2)
96+
97+
Have two cronrabs running (for solis.sh and solis2.sh)
98+
99+
## Combined data of two PVOutput accounts/inverters
100+
101+
if you also want the combined data of the two inverters, use a third PVOutput account (yet another email address) and use my python tool [CombinePVOutputSystems](https://github.com/ZuinigeRijder/CombinePVOutputSystems#combine-pvoutput-systems).
102+
59103
## Usage
60104
### Windows 10
61105
python soliscloud_to_pvoutput.py

soliscloud_to_pvoutput.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ send_to_pvoutput = True
33
soliscloud_api_id = 1300386381123456789
44
soliscloud_api_secret = 304abf2bd8a44242913d704123456789
55
soliscloud_api_url = https://www.soliscloud.com:13333
6+
soliscloud_inverter_index = 0
67
pvoutput_api_key = 0f2dd8190d00369ec893b059034dde1123456789
78
pvoutput_system_id = 12345
89

soliscloud_to_pvoutput.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
SOLISCLOUD_API_ID = api_secrets["soliscloud_api_id"] # userId
3030
SOLISCLOUD_API_SECRET = api_secrets["soliscloud_api_secret"].encode("utf-8")
3131
SOLISCLOUD_API_URL = api_secrets["soliscloud_api_url"]
32+
SOLISCLOUD_INVERTER_INDEX = int(api_secrets["soliscloud_inverter_index"].strip())
3233
PVOUTPUT_API_KEY = api_secrets["pvoutput_api_key"]
3334
PVOUTPUT_SYSTEM_ID = api_secrets["pvoutput_system_id"]
3435

@@ -170,7 +171,9 @@ def get_inverter_list_body() -> str:
170171

171172
body = '{"stationId":"' + station_id + '"}'
172173
content = get_solis_cloud_data(INVERTER_LIST, body)
173-
inverter_info = json.loads(content)["data"]["page"]["records"][0]
174+
inverter_info = json.loads(content)["data"]["page"]["records"][
175+
SOLISCLOUD_INVERTER_INDEX
176+
]
174177
inverter_id = inverter_info["id"]
175178
inverter_sn = inverter_info["sn"]
176179

0 commit comments

Comments
 (0)