This is a little helper Tool, that requests the Data from tibber and publishes the result in the MQTT Broker
Tibber offers a pretty decent api which can be used to request a lot of data. You can request information from Tibber itself or connect your devices to Tibber and request even that information.
For example, I have a Fronius Inverter and after adding the Inverter to my App, I can request the id of the "bubbles" (icons shown in the App) and add my inverter to the request query.
The Queries are made through a build GraphQL query. Which is simply a JSON structure to select the fields you want.
docker run -d --restart=always \
-e TIBBER2MQTT_TIBBER_EMAIL="[email protected]" \
-e TIBBER2MQTT_TIBBER_PASS="..." \
-e TIBBER2MQTT_MQTT_CACHE=1 \
-e TIBBER2MQTT_MQTT_SINGLE=1 \
-e TIBBER2MQTT_MQTT_HOST=192.168.0.3 \
-e TIBBER2MQTT_QUERY_FILENAME="your_file_name" \
--name tibber2mqtt freakern/tibber2mqt
The key to request the Values from Tibber is to get a working query.
A quick example
This will show you all your bubbles in the app.
Navigate through the DOCS Menu to the right in the Query Playground to create a query that fits your needs
Let's start with the tibber_bubbles (without defining the query-filename the tibber_bubbles is default)
docker run -d --restart=always \
-e TIBBER2MQTT_TIBBER_EMAIL="[email protected]" \
-e TIBBER2MQTT_TIBBER_PASS="your-password" \
-e TIBBER2MQTT_MQTT_HOST=192.168.0.3 \
-e TIBBER2MQTT_DEBUG=1
-e TIBBER2MQTT_MQTT_CACHE=1 \
-e TIBBER2MQTT_MQTT_SINGLE=1 \
freakern/tibber2mqtt
When you have your query ready, place the textfile with the Query in the config folder and add the ENV Variable (before the last line):
-v ${PWD}/config:/app/config \
-e TIBBER2MQTT_QUERY_FILENAME="your_file_name" \
Cache is a simple "Do not publish the same value again" and the Single Parameter is to send each value individually else it would publish the entire json each time (if it's not cached)
| ENV Variable Name | Description | Default | Required |
|---|---|---|---|
| TIBBER2MQTT_DEBUG | Enable Debug Mode | False | False |
| TIBBER2MQTT_VERBOSE | Enable Verbose Mode | False | False |
| TIBBER2MQTT_TIBBER_EMAIL | Tibber email | True | |
| TIBBER2MQTT_TIBBER_PASS | Tibber Password | True | |
| TIBBER2MQTT_TOKEN_FILENAME | Filename of the File where the Token will be read from and write into | token | False |
| TIBBER2MQTT_QUERY_FILENAME | Filename of the File where the gql query will be saved into (must be located in the config folder) | tibber_bubbles | False |
| TIBBER2MQTT_REQUEST_INTERVAL | The request interval | False | |
| TIBBER2MQTT_MQTT_SINGLE | Send each value individually to the MQTT Broker | False | False |
| TIBBER2MQTT_MQTT_CACHE | Cache the send values (works best in single (-s) mode) | False | False |
| TIBBER2MQTT_MQTT_HOST | MQTT Host to connect to | localhost | False |
| TIBBER2MQTT_MQTT_PORT | MQTT port to connect to | 1883 | False |
| TIBBER2MQTT_MQTT_TOPIC | MQTT Topic to publish to | tibber2mqtt | False |
| TIBBER2MQTT_MQTT_CLIENT_ID | MQTT Client-ID | tibber2mqtt | False |
| TIBBER2MQTT_MQTT_USER | MQTT user to connect to | False | |
| TIBBER2MQTT_MQTT_PASS | MQTT password to connect to | False |
I do not have a Tibber Contract, I am just using the account to connect to my Polestar 2. So I can't really help if it is about the data related to a running contract.
That out of the way, if you have a good working Tibber Query and you want to share it. Please create a Pull-Request with your running query in the config folder.
I would suggest you replace the ID's and put some comments with a # Symbol in front of it
This project is licensed under the Apache 2.0 License - see the LICENSE.md file for details
Content type
Image
Digest
sha256:657b064c9…
Size
365 MB
Last updated
almost 3 years ago
docker pull freakern/tibber2mqtt