Skip to main content

pyTibber

PyPI version Ruff pre-commit

Python3 library for Tibber.

Get electricity price and consumption.

If you have a Tibber Pulse or Watty you can see your consumption in real time.

Buy me a coffee :)

Go to developer.tibber.com/ to get your API token.

Install

pip3 install pyTibber

Example:

import tibber.const
import tibber
import asyncio


async def start():
  tibber_connection = tibber.Tibber(tibber.const.DEMO_TOKEN, user_agent="change_this")
  await tibber_connection.update_info()
  print(tibber_connection.name)

  home = tibber_connection.get_homes()[0]
  await home.fetch_consumption_data()
  await home.update_info()
  print(home.address1)

  await home.update_price_info()
  print(home.current_price_info)

  # await tibber_connection.close_connection()

loop = asyncio.run(start())

Example realtime data:

An example of how to subscribe to realtime data (Pulse/Watty):

import tibber.const
import asyncio

import aiohttp
import tibber

def _callback(pkg):
    print(pkg)
    data = pkg.get("data")
    if data is None:
        return
    print(data.get("liveMeasurement"))


async def run():
    async with aiohttp.ClientSession() as session:
        tibber_connection = tibber.Tibber(tibber.const.DEMO_TOKEN, websession=session, user_agent="change_this")
        await tibber_connection.update_info()
    home = tibber_connection.get_homes()[0]
    await home.rt_subscribe(_callback)

    while True:
      await asyncio.sleep(10)

loop = asyncio.run(run())

The library is used as part of Home Assistant.

Download files

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

Source Distribution

pytibber-0.38.0.tar.gz (43.9 kB view details)

Uploaded Source

Built Distribution

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

pytibber-0.38.0-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

Details for the file pytibber-0.38.0.tar.gz.

File metadata

  • Download URL: pytibber-0.38.0.tar.gz
  • Upload date:
  • Size: 43.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for pytibber-0.38.0.tar.gz
Algorithm Hash digest
SHA256 79739b9889a99fec064223cca2b15147ff2e3a860c20ac77d18e18fe08ce6484
MD5 4186a59b1e8ac96db85b370f50f77d3a
BLAKE2b-256 786b8bc2488649c9abab580caa37fee7254ce38a48c58510aeb6d4ab323bae2b

See more details on using hashes here.

File details

Details for the file pytibber-0.38.0-py3-none-any.whl.

File metadata

  • Download URL: pytibber-0.38.0-py3-none-any.whl
  • Upload date:
  • Size: 35.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for pytibber-0.38.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16941eb09ed9ebf3f18ff282e08b8b04f78d280b5fbe7841744278275874a3b9
MD5 76345e05d3fd9c620c6a0d3415222788
BLAKE2b-256 af56d509ab62807b128cd4a93d527d36e60945a9cae6e05201d6197925f26365

See more details on using hashes here.

Release history Release notifications | RSS feed

Supported by

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