Skip to main content

A Python wrapper for Growatt API

Project description

README.md

Growatt API

A Python wrapper for the Growatt API, allowing you to interact with Growatt's services.

Installation

pip install growatt-api

Usage

Initialization and Login

First, create an instance of the Growatt class and log in using your Growatt credentials.

from growatt import Growatt

api = Growatt()
api.login("your_email@example.com", "your_password")

Fetching Plants

Retrieve the first plant and get the id.

plant_list = api.get_plants()[0]["id"]
print(plant_list)

Fetching Specific Plant

Get detailed information about a specific plant.

plant_id = "plant_id"
plant_topic = api.get_plant(plant_id)
print(plant_topic)

Quick Demo

Here's a quick demo showing how to use the Growatt API wrapper.

from growatt import Growatt

api = Growatt()

api.login("user@example.com", "pass123")

plantId = api.get_plants()[0]["id"]
print(f"Plant ID: {plantId}")

plant = api.get_plant(plantId)
print(plant)

mixSn = api.get_mix_ids(plantId)[0][1]
print(mixSn)

mixTotal = api.get_mix_total(plantId, mixSn)
print(mixTotal)

mixStatus = api.get_mix_status(plantId, mixSn)
pprint(mixStatus)

Fetching periodic data

To fetch periodic data such as daily, monthly, yearly or total, you can use the following functions.

Daily

api.get_energy_stats_yearly("2024-08-06",1234567,"ODCUTJF8IFP")

Monthly

api.get_energy_stats_yearly("2024-08",1234567,"ODCUTJF8IFP")

Yearly

api.get_energy_stats_yearly("2024",1234567,"ODCUTJF8IFP")

Battery weekly data

Battery information is in a weekly format.

api.get_weekly_battery_stats(1234567,"ODCUTJF8IFP")

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

growatt_api-0.1.4.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

growatt_api-0.1.4-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file growatt_api-0.1.4.tar.gz.

File metadata

  • Download URL: growatt_api-0.1.4.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for growatt_api-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a95b478696ce2a55de34a242fa7acd1e6edf24e39439bcc0a21334bfd114cd27
MD5 c66b67cd5ad66babc94b1d4fecf57fa2
BLAKE2b-256 01c9dea545ffd061fa46fb0933cd7f4ead8fc3e705528fb1e746be38871dca89

See more details on using hashes here.

File details

Details for the file growatt_api-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: growatt_api-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for growatt_api-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7518dc93b0dc200f08b1f7a8b2bfbc0902a30d0ad155913f7707c05765a9cbfa
MD5 e6ed30d76478ff29d237f22396f0e156
BLAKE2b-256 8c19ac1a2d3c77f9605803f8a3e6d5139087130a5f2a628b184589c43d2d609a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page