Skip to content

Commit

Permalink
issue fixed wrt reading solar data
Browse files Browse the repository at this point in the history
  • Loading branch information
janleenders committed Jan 8, 2023
1 parent 4a963aa commit 86000de
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This version is the first working increment after the first sprint.

Properties
----------
- Version: 1.0 (01-01-2023)
- Version: 1.1.1 (08-01-2023)
- Name: MyHome
- Author: Jan Leenders (janleenders@kpnplanet.nl)

Expand All @@ -28,12 +28,12 @@ The design is based on the following requirements:
- Make use of broadly accepted general components where necessary
- Make use of broadly accepted programming language(s)
- Relatively easy configurable for specific home situations in the netherlands (and probably also in Belgium)
- Enphase and Fronius solar systems are supported. Other can be added on request.

Product backlog items
---------------------
- Exception handling when no solar datastream is available. Also, make it configurable in the config file
- Try to make it 'running out of the box'
- Add instructions to get the cron service within linux running
- Additional development of the reports functionality in the webservice.
- Create the first version of the control functionality
- Add additional control on the quality of the configuration file input, to enhance the stability of the application.
Expand Down
4 changes: 2 additions & 2 deletions py/package_reader/solar.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def get_datapoint(solar_system, solar_request_path ):
if solar_system == 'fronius':
watt_production_data = session.get(solar_request_path +
'/solar_api/v1/GetInverterRealtimeData.cgi?Scope=System&DataCollection=CommonInverterData').text
return_value['actual'] = json.loads(watt_production_data)["Body"]["Data"]["PAC"]
return_value['total'] = float(json.loads(watt_production_data)["Body"]["Data"]["TOTAL_ENERGY"]) / 1000 # should be in kWh
return_value['actual'] = json.loads(watt_production_data)["Body"]["Data"]["PAC"]["Values"]["1"]
return_value['total'] = float(json.loads(watt_production_data)["Body"]["Data"]["TOTAL_ENERGY"]["Values"]["1"]) / 1000 # should be in kWh

except Exception:
pass
Expand Down
7 changes: 2 additions & 5 deletions py/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,9 @@ def average(lst):
if timestamp >= details_timestamp_watt:
# Get the actual solar system data
solar_datapoint = solar.get_datapoint(solar_system, solar_request_path)
print(solar_request_path)
print(solar_system)
print(solar_datapoint)
watt_production_actual = int(solar_datapoint['actual'])
watt_production_production = float(solar_datapoint['total'])
if watt_production_production == float(0.0): # no solar data available at this moment.
watt_production= float(solar_datapoint['total'])
if watt_production == float(0.0): # no solar data available at this moment.
# Get the last value from the database. Solar system is down of sleeping.
cur= conn.cursor()
cur.execute("select return_high + return_low from p1_channel_detail where channel=9 order by tst desc limit 1")
Expand Down

0 comments on commit 86000de

Please sign in to comment.