2024-10-28 21:15:14 +01:00
|
|
|
This is the docker container and script to publish the energy consumption of the Huette to the MQTT broker.
|
|
|
|
|
|
|
|
The data is a json array with index 0 means today, index 1 one day in the past, index 2 two days in the past and so on. The data is in watt hours.
|
|
|
|
|
|
|
|
e.g. [1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000]
|
|
|
|
|
|
|
|
# Environment variables
|
|
|
|
|
|
|
|
MQTT_HOST: The host of the MQTT broker
|
|
|
|
MQTT_PORT: (Optional) The port of the MQTT broker
|
|
|
|
MQTT_TOPIC: The topic to publish to
|
|
|
|
MQTT_USERNAME: (Optional) The user for the MQTT broker
|
|
|
|
MQTT_PASSWORD: (Optional) The password for the MQTT broker
|
|
|
|
|
2024-10-28 21:07:57 +01:00
|
|
|
# Build
|
|
|
|
|
|
|
|
```
|
|
|
|
docker build -t huette-energy-consumption-weekperday .
|
|
|
|
```
|
|
|
|
|
|
|
|
# Run
|
|
|
|
|
|
|
|
```
|
|
|
|
docker run -d -e MQTT_HOST=10.2.3.2 -e MQTT_TOPIC=c3re/huette/energy/consumption/week_per_day -t huette-energy-consumption-weekperday
|
|
|
|
```
|