Sparsnas Docker - martikainen87/Home-Automation GitHub Wiki

Sparsnas decoder @ GitHub Docker version @ GitHub

Build docker container as follows. The SENSORS is required and is the unique id of your sensors in the form sensor_id pulses_per_kwh. The various MQTT_args are optional (but highly recommended to enable communication to your mqtt_broker).

docker build -t sparsnas --build-arg SENSORS="656704 1000" \
  --build-arg MQTT_HOST=192.168.x.x --build-arg MQTT_PORT=1883 \
  --build-arg=MQTT_USERNAME=username --build-arg=MQTT_PASSWORD=password \
  https://github.com/tubalainen/sparsnas_decoder.git

Create and start the container, it will take a minute or so before it is up and running

docker create --name=sparsnas --restart=always --device=/dev/bus/usb sparsnas:latest
docker start sparsnas