Skip to main content

Unofficial API bindings for Elvia's consumer facing APIs

Build Status

With the Elvia API you can access information about your own power consumption and get the current grid tariffes in Elvia's power grid.

Installation

Install from pip by using:

pip install --upgrade elvia

Requirements

  • Python 3.6+

Getting access tokens

Elvia's APIs are available for consumers using Elvia for their grid fees (nettleie).

The MeterValue and GridTariff APIs uses different authentication methods, and different tokens.

Meter Value API

Get token using this guide: https://www.elvia.no/smart-forbruk/alt-om-din-strommaler/slik-gjor-du-det-aktivering-og-bruk-av-elvias-metervalueapi/

Grid Tariff API

Get token by logging into https://elvia.portal.azure-api.net/signin and subscribe to the GridTariffAPI

Using the API

from elvia import Elvia
import json
import asyncio
import os

# token from elvia.no/minside
meter_value_token = os.environ.get("ELVIA_METER_VALUE_TOKEN")

# token from https://elvia.portal.azure-api.net/signin
grid_tariff_token = os.environ.get("ELVIA_GRID_TARIFF_TOKEN")

# the metering point id of your home
metering_point_id = os.environ.get("ELVIA_METERING_POINT_ID")

elvia = Elvia(meter_value_token = meter_value_token)

async def get_meter_values():
    meter_value_client = elvia.meter_value()
    meter_values = await meter_value_client.get_meter_values(
        start_time = "2021-12-08T01:00:00",
        end_time = "2021-12-08T02:00:00",
        metering_point_ids = [metering_point_id],
        include_production = True
    )
    print(json.dumps(meter_values))
asyncio.run(get_meter_values())

# And use it to get grid tariffs

elvia = Elvia(grid_tariff_token = grid_tariff_token)

async def get_grid_tariffs():
    grid_tariff_client = elvia.grid_tariff()

    grid_tariffs = await grid_tariff_client.grid_tariffs_for_metering_points(
        range = "today",
        metering_point_ids = [metering_point_id]
    )
    print(json.dumps(grid_tariffs))
asyncio.run(get_grid_tariffs())

Release files for elvia 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for elvia 0.1.0
File Size Uploaded
elvia-0.1.0.tar.gz 8.8 kB Details

Release files / elvia-0.1.0.tar.gz

Download URL elvia-0.1.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cd4362cf85d78a068783b55abcdd90fe83f83fbf99ce8ed26ee33a3a065c7b0b
BLAKE2b-256 checksum
How to use checksums
d2d0f0081cdabb8ddd80c66437545e0a7aa0f8ac547f363d38645a3e838415f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.14

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page