Skip to main content

A Python wrapper for the official Wiener Netze Smart Meter API (WN_SMART_METER_API)

Project description

Wiener Netze Smart Meter API

PyPI - Version PyPI - Python Version


Table of Contents

Introduction

This project provides a Python wrapper for the official Wiener Netze Smart Meter API (WN_SMART_METER_API), which is published by Wiener Stadtwerke through their developer portal. Unlike other approaches (notably fleinze’s vienna-smartmeter API Python wrapper and DarwinsBuddy’s HomeAssistant Integration) that rely on web-login recreation and can fail due to captchas, rate limiting, or other website changes, this wrapper uses the official endpoint.

By following the instructions below, you can acquire the necessary API credentials (client ID, client secret, and API key) from Wiener Stadtwerke’s developer portal and start fetching your power usage data .

First Steps

  1. Create an account at the Developer Portal of the Wiener Stadtwerke
  2. Create an application here for the WN_SMART_METER_API
  3. When the application is released you will get an e-mail from API Developer Portal that the application is approved. The API-key is found in the details of the newly created application.
  4. Write an e-mail to the Smart Meter Portal Support to connect the application with the Smart Meter Portal user. It usually takes 1-2 weeks to get a response.
  5. Afterwards the client-ID and client-secret can be found in the settings of the Smart Meter-Businessportal.

Installation

pip install wiener-netze-smart-meter-api

Usage

from wiener_netze_smart_meter_api import WNAPIClient
from datetime import datetime

client = WNAPIClient(client_id="client-id", client_secret="client-secret", api_key="API-key")

# Fetch all smart meters
smart_meters = client.get_anlagendaten()
print("All Smart Meters:", smart_meters)

# Fetch specific smart meter details
smart_meter_number = "AT0010000000000000001000000000000"
specific_meter = client.get_anlagendaten(smart_meter_number)
print("Specific Smart Meter:", specific_meter)

# Fetch quarter-hourly measured values for all meters for the last 3 years
quarter_hour_values = client.get_quarter_hour_values()
print("Quarter-Hourly Values:", quarter_hour_values)

# Fetch daily measured values for a specific meter for the last 3 years
daily_values = client.get_daily_values(smart_meter_number)
print("Daily Values for Specific Meter:", daily_values)

# Fetch meter readings for a specific meter for specific days
meter_readings = client.get_meter_readings(smart_meter_number,datetime(2025,1,1).strftime('%Y-%m-%d'),datetime(2025,1,2).strftime('%Y-%m-%d'))
print("Meter Readings:", meter_readings)

License

wiener-netze-smart-meter-api is distributed under the terms of the MIT license.

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

wiener_netze_smart_meter_api-0.0.6.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

wiener_netze_smart_meter_api-0.0.6-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file wiener_netze_smart_meter_api-0.0.6.tar.gz.

File metadata

File hashes

Hashes for wiener_netze_smart_meter_api-0.0.6.tar.gz
Algorithm Hash digest
SHA256 376ae32edbd6aab00f60829050a7c906d958c2b44a3dfe227a8488a9c6363dd0
MD5 07b97537d1ccb20ed9e37bba05daf3e5
BLAKE2b-256 0994a50435a5ae91ad5d87b52c42502e21a83baedb5c5ba82a46c98a5cdb9dc8

See more details on using hashes here.

File details

Details for the file wiener_netze_smart_meter_api-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for wiener_netze_smart_meter_api-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 91e2ff1a56c3d1ae68af581582ccd8c629e80281e1efbf29a43d6fc4dc919594
MD5 04fa8479abfd33b32b6a2b287d240295
BLAKE2b-256 6fcc45a2b4d5a4103bf818d6985c1ebe7cbec8f410faa2da0b71d0104665b550

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