Python client library for Stromnetz Graz API
Project description
Python client library for Stromnetz Graz API
This is a simple client library for the (unofficial) Stromnetz Graz Smart Meter Web API.
Please note that you must be able to login and view data on the portal before this library will work. Please refer to Stromnetz Graz how to set up access to the smart meter statistics. Best results are achieved in the IME
mode (15 minute reading intervals), however the library can also fall back to IMS
(daily reading interval). The most recent data available will be the one for the previous day (see also their FAQ).
Example
from sngraz import StromNetzGraz
sn = StromNetzGraz(mail, password)
await sn.authenticate()
await sn.update_info()
for installation in sn.get_installations():
print("Installation ID", installation._installation_id)
print("Installation is installed at", installation._address)
for meter in installation.get_meters():
print("Meter ID", meter.id)
print("Meter Name", meter._short_name)
await meter.fetch_consumption_data()
# meter._data now contains the meter readings of the last 30 days
print(meter._data)
await sn.close_connection()
The example needs to run in an async context, please see issue #6 for an example if you want to run it standalone.
An installation
is usually an house or apartment with an individual address and may contain multiple meters (for example a second meter for a hot water boiler). A meter
is the actual single meter.
Stromnetz Graz assigns individual numerical IDs to both installation
s and meter
s. The usually used meter number (33 characters usually starting with AT00
) is available as attributes (meter._name
& meter._short_name
).
Home Assistant Integration
This library is used in my Home Assistant Custom Component ha-stromnetzgraz, available via HACS. It allows you to have your Smart Meter readings inside Home Assistant! See the ha-stromnetzgraz repository for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file stromnetzgraz-0.1.8.tar.gz
.
File metadata
- Download URL: stromnetzgraz-0.1.8.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 351a7234c9b06657bd505028a8f2022c3147d5a4dcf58ea17e0eba842a0a231e |
|
MD5 | 61242b8118523a3c53bcedbf402a9916 |
|
BLAKE2b-256 | a159dec690cb064d629d52ea932335f91f91416244164aa01bc68f2119d8054b |
File details
Details for the file stromnetzgraz-0.1.8-py3-none-any.whl
.
File metadata
- Download URL: stromnetzgraz-0.1.8-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 155de9cc3488c44e893db2332c79a40167c8b1ee33f272fd77f62424d4707c43 |
|
MD5 | 3f46842d3a06898f87a0cc31b7440ae7 |
|
BLAKE2b-256 | 11377910d51037f08ec49c19c47bb8b26daa4a7193afb0678691ad71b51d9076 |