indykoning / PyPi_GrowattServer

MIT License
70 stars 32 forks source link

How to read the data I need from the Growatt Server #69

Open rowanbradley opened 11 months ago

indykoning commented 11 months ago

You might need to be a little more specific on what data you want to get. I do suggest looking at the Examples And the readme to see how to use it and what methods are available

rowanbradley commented 1 month ago

I'm trying this again. I want to read from the Growatt Server the following concerning my SPF3600 inverter and 6.5kWh battery:

  1. Solar generation now, and per 1/2 hour time slot during the whole of yesterday.
  2. Consumption now, and per 1/2 hour time slot during the whole of yesterday.
  3. Exported now, and per 1/2 hour time slot during the whole of yesterday.
  4. Imported now, and per 1/2 hour time slot during the whole of yesterday.
  5. Battery level now, and per 1/2 hour time slot during the whole of yesterday.

My current problem is that I don't understand how to get the value of storage_id so that I can call api.storage_detail(storage_id), api.storage_params(storage_id) and api.storage_energy_overview(storage_id).

The response I'm getting from api.plant_info() is {'totalData': {'CO2Sum': '1.02 KT', 'currentPowerSum': '0 W', 'isHaveStorage': 'false', 'todayEnergySum': '9.3 kWh', 'eTotalMoneyText': '0.0 ', 'totalEnergySum': '2.56 MWh'}, 'data': [{'isHaveStorage': 'false', 'currentPower': '0 W', 'totalEnergy': '2.56 MWh', 'plantMoneyText': '0.0 ', 'plantId': '2016929', 'todayEnergy': '9.3 kWh', 'plantName': 'SYLVESTER-BRADLEY CB8'}], 'success': True} {'isHaveOptimizer': 0, 'totalEnergy': '2562.4', 'nominal_Power': 3680, 'totalMoneyText': '0', 'optimizerType': 0, 'storageTodayPpv': '790', 'storagePuser': '-399.5', 'Co2Reduction': '1024.96', 'useEnergy': '0', 'nominalPower': 0, 'isHavePumper': '0', 'ammeterType': '0', 'invTodayPpv': '0', 'plantMoneyText': '0.00/£', 'deviceList': [{'deviceType': 'mix', 'pCharge': '0', 'eChargeToday': '6.7', 'lost': False, 'datalogSn': 'JPC8CK72AN', 'location': '', 'deviceSn': 'OOCTCHT07L', 'deviceAilas': 'OOCTCHT07L', 'deviceStatus': 5, 'energy': '2562.4', 'capacity': '98%'}], 'todayEnergy': '9.3', 'todayDischarge': '0', 'storagePgrid': '1189.5'}

Thank you - Rowan