Skip to content

Commit

Permalink
Added inverter temperature for PVOutput Temperature column and AC Vol…
Browse files Browse the repository at this point in the history
…tage for Power Used column
  • Loading branch information
ZuinigeRijder committed Sep 4, 2022
1 parent 362f8c0 commit 21d67a3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 25 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ The soliscloud_to_pvoutput.py script will get the first station id with the secr
* DC PV voltage (assuming no more than 4 strings)
* watt (current)
* watthour today
* inverter temperature (logged only)
* AC voltage (assuming 1 phase system, logged only)
* inverter temperature (instead of outside temperature, you can still overrule with weather device)
* AC voltage (assuming 1 phase system, used "Power Consumption" field, so read "AC Volt" for the "Power Used" column of PVOutput and ignore "Energy Used" column)

This information is used to compute the new information to be send to PVOutput, when the timestamp is changed.

Expand Down Expand Up @@ -81,10 +81,11 @@ Log files are written in the home subdirectory solis
```
20220730 23:00:17: Outside solar generation hours (5..23)
Exiting program to start fresh tomorrow
20220731 06:34:07: inverter temperature: 36.1, AC voltage: 237.2 data=20220731,06:33,0,20,-1,-1,,77.4
20220731 06:49:17: inverter temperature: 36.1, AC voltage: 237.2 data=20220731,06:48,5,20,-1,-1,,82.0
20220731 06:54:20: inverter temperature: 36.1, AC voltage: 237.2 data=20220731,06:53,6,20,-1,-1,,111.0
20220731 06:59:24: inverter temperature: 36.1, AC voltage: 237.2 data=20220731,06:58,7,20,-1,-1,,170.1
20220731 07:04:28: inverter temperature: 36.1, AC voltage: 237.2 data=20220731,07:03,8,20,-1,-1,,142.0
20220731 07:09:30: inverter temperature: 36.1, AC voltage: 237.2 data=20220731,07:08,9,20,-1,-1,,143.6
....
20220904 17:52:32: data=20220904,17:50,7600,90,-1,227.7,36.5,161.5
20220904 17:56:34: data=20220904,17:55,7600,100,-1,227.3,36.4,161.5
20220904 18:01:42: data=20220904,18:00,7600,100,-1,226.7,36.2,161.4
20220904 18:05:46: data=20220904,18:05,7700,100,-1,226.9,36.1,161.4
20220904 18:10:51: data=20220904,18:10,7700,110,-1,227.4,36.1,161.4
```
30 changes: 13 additions & 17 deletions soliscloud_to_pvoutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,9 @@ def get_solis_cloud_data(url_part, data) -> str:


# == send_pvoutput_data ======================================================
def send_pvoutput_data(
prefix, datetime_current, watthour_today, watt, volt
) -> str:
def send_pvoutput_data(pvoutput_string) -> str:
"""send pvoutput data with the provided parameters"""
pvoutput_string = (
'data=' + TODAY +
',' + datetime_current.strftime("%H:%M") +
',' + str(watthour_today) +
',' + str(watt) +
',-1,-1,,' + str(volt)
)
log(prefix + ' ' + pvoutput_string)
log(pvoutput_string)
headers = {
'X-Pvoutput-Apikey': PVOUTPUT_API_KEY,
'X-Pvoutput-SystemId': PVOUTPUT_SYSTEM_ID,
Expand Down Expand Up @@ -175,10 +166,6 @@ def main_loop():
watthour_today = round(inverter_detail['eToday'] * 1000)
inverter_temp = inverter_detail['inverterTemperature']
ac_volt = inverter_detail['uAc1']
prefix = (
'inverter temperature: ' + str(inverter_temp) +
', AC voltage: ' + str(ac_volt)
)

if timestamp_previous == '0':
hi_res_watthour_today = watthour_today
Expand All @@ -202,8 +189,17 @@ def main_loop():
# hi_res_total_watthour was too high
hi_res_watthour_today = watthour_today + 99

send_pvoutput_data(
prefix, datetime_current, hi_res_watthour_today, watt, volt)
pvoutput_string = (
'data=' + TODAY + # Date
',' + datetime_current.strftime("%H:%M") + # Time
',' + str(watthour_today) + # Energy Generation
',' + str(watt) + # Power Generation
',-1' + # no Energy Consumption
',' + str(ac_volt) + # Power generation used for AC voltage
',' + str(inverter_temp) + # inverter temp iso outside temp
',' + str(volt) # Voltage
)
send_pvoutput_data(pvoutput_string)
timestamp_previous = timestamp_current


Expand Down

0 comments on commit 21d67a3

Please sign in to comment.