diff --git a/README.md b/README.md index 6622b62..fad08f8 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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. diff --git a/py/package_reader/solar.py b/py/package_reader/solar.py index 08f178e..205f9e1 100644 --- a/py/package_reader/solar.py +++ b/py/package_reader/solar.py @@ -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 diff --git a/py/reader.py b/py/reader.py index 8e7581a..528c4ca 100755 --- a/py/reader.py +++ b/py/reader.py @@ -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")