Publishes Tibber live consumption data from Tibber API per MQTT.
If you are a customer of Tibber and use a Tibber Pulse, you can retrieve realtime consumption data via the Tibber API.
This program publishes realtime consumption data from Tibber to one or more MQTT brokers of your choise.
- Go to https://developer.tibber.com/settings/access-token , log in with your Tibber credentials and you will see the access token
- After this, open https://developer.tibber.com/explorer and paste the following code into the left text box:
{
viewer {
homes {
id
}
}
}
- Execute the query (play button above the text box) and you will see your home id in the left text box
- Python version 3.8 or newer with pip + venv
This program should run in any OS, but I have no capacity to test this, so feedback is appreciated. My test machines run Ubuntu and Raspbian.
git clone https://github.com/danielringch/tibber2mqtt.git
python3 -m venv <path to virtual environment>
source <path to virtual environment>/bin/activate
python3 -m pip install -r requirements.txt
The configuration is done via yaml file. The example file can be found in config/sample.yaml
To keep sensitive content out of config files, some parameters can also be passed using environment variables. See the example config file for further explanations.
source <path to virtual environment>/bin/activate
python3 -B tibber2mqtt/tibber2mqtt.py --config /path/to/your/config/file.yaml
You have trouble getting started? Something does not work as expected? You have some suggestions or thoughts? Please let me know.
Feel free to open an issue here on github or contact me on reddit: 3lr1ng0.