Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current/daily usage #12

Open
SchalkGreyling opened this issue Apr 23, 2020 · 6 comments
Open

Current/daily usage #12

SchalkGreyling opened this issue Apr 23, 2020 · 6 comments

Comments

@SchalkGreyling
Copy link

Thank you for this amazing app.

I was wondering if there is an API to find daily consumption?

I'm trying to compare my Solar charge against usage to figure out if my battery has fully charged. (My SOC graph stays on 100% until the battery is pretty much dead- the BMS cannot connect to my inverter).

@Sjord
Copy link
Owner

Sjord commented Apr 23, 2020

Can you see this information somewhere in the web app or in the mobile app? Where and how is it displayed there?

@SchalkGreyling
Copy link
Author

Hi Sjord,

Thank you for the response.

Yes it is availbale in both web page and mobile, please see the attached screenshots.

In the mobile app you can get the current solar production/storage/consumption and the daily overview (Please see screenshot below):
thumbnail_Image

In the web page you can see the same on a different layout style (Please see screenshot below):
Screen Shot 2020-04-24 at 7 47 50 AM

@SchalkGreyling
Copy link
Author

Hi Sjord,

Should you be able to access the battery voltage I'll be able to use that as well. Please let me know should you need Access to the website then I can share the details with you.

Screen Shot 2020-04-25 at 6 56 55 AM

Sjord added a commit that referenced this issue Apr 25, 2020
Related to #12
@Sjord
Copy link
Owner

Sjord commented Apr 25, 2020

I have added several new methods in the storage branch. Please try them out and let me know which are useful to you, and whether this solves your issue.

This comment describes how to switch branches. The branch is called storage. The new function are listed here.

Use something like the following to retrieve the information for your plant:

with GrowattApi() as api:
    api.login(username, password)
    plant_info = api.plant_list()

    plant_id = plant_info["data"][0]["plantId"]
    storage_sn = "TEE194904F"   # Or call get_all_device_list
    print(api.get_energy_overview_data(plant_id, storage_sn))
    print(api.get_system_status_data(plant_id, storage_sn))
    print(api.get_storage_energy_data(plant_id, storage_sn, "2020-04-20"))
    print(api.get_energy_prod_and_cons_data(plant_id, storage_sn, "2020-04-20"))
    print(api.get_storage_params(storage_sn))

@SchalkGreyling
Copy link
Author

This is AMAZING!!

Thank you very much :) I would not have been able to get this without your assistance. Really owe you for this.

@schimmelbirne
Copy link

Hi,

thanks for the good work!!!
Unfortunately, it seems the API is no longer able to connect to the new storage endpoints. E.g. the get_energy_overview_data function is returning:

File "/volume2/software/scripting/git/growatt_api_client/growatt/__main__.py", line 26, in <module> print("System Status: " + str(yaml.load(json.dumps(api.get_system_status_data(plant_id, storage_sn))))) File "growatt/__init__.py", line 180, in get_system_status_data return self._obj_success_response(response) File "growatt/__init__.py", line 225, in _obj_success_response raise GrowattApiError(data) growatt.GrowattApiError: {u'msg': u'504', u'obj': None, u'result': 0}

Seems like a http 504 status?
Kind regards, Andi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants