Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IoT Docker Setup with Node-Red, Mosquitto, Home Assistant, deCONZ, InfluxDB and Grafana

This Setup is using the official Docker Images of

Install

You will need to install git to check out the repository or download it manually

sudo apt install git

Checkout the repository with:

git clone git@github.com:maddindeiss/iot-docker-mqtt-setup.git 

The first step is to run the setup script to create the folder structure, set permissions and install all the necessary packages.

bash setup.sh

Ops commands use just. setup.sh installs it when missing. You can also install manually:

curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin

List available commands from the repo root:

just

Setup

You will need to change some default passwords and settings.

Copy each service *.env.dist to the matching *.env file (for example services/mosquitto/docker/mosquitto.env.distmosquitto.env) and edit values before starting.

DECONZ

Before running the setup for the deconz Docker container, you may need to add your Linux user to the dialout group, which allows the user to access to serial devices (i.e. Conbee/Conbee II/Conbee III/RaspBee/RaspBeeII):

sudo usermod -a -G dialout $USER

Also make sure the device path in deconz.env matches the host device mounted in services/deconz/docker-compose.yml.

Run

From the repository root:

just start
just start nodered mosquitto
just status

You can still run Compose directly:

docker compose -f ./services/nodered/docker-compose.yml up -d

Backup

Create a local archive (services tree, Node-RED data, InfluxDB 2.x dump when running):

just backup

InfluxDB

Influx backup needs services/influx/docker/influxdb.env with a real DOCKER_INFLUXDB_INIT_ADMIN_TOKEN (the operator/setup token from first Influx init). The helper works for InfluxDB 2.7.x and 2.9.x.

Restoring a backup taken on InfluxDB 2.9+ may require:

influx restore /path/to/backup --operator-token <token>

rclone (optional offsite upload)

Configure a remote and write scripts/backup.env:

just setup-rclone

If RCLONE_REMOTE is empty/unset, backups stay local only. Template: scripts/backup.env.dist.

Update

Update all services (pull/build + recreate):

just update

Or selected services:

just update nodered grafana

The update script prompts to abort, run a backup first, or continue without backup.

Teslamate / Postgres

A Postgres major upgrade (for example 17 → 18) wipes Teslamate database data on purpose. The old data directory is renamed to data.wiped-<timestamp>. You will need to re-link the Tesla account afterwards.

Non-interactive wipe (for automation only):

bash scripts/update.sh --yes --wipe-teslamate-db teslamate

InfluxDB 2.7 → 2.9 keeps its data volume; take a backup before updating.

Issues

Permission denied on docker commands

Got a permission denied error, when I try to run Docker commands like docker info or docker-compose up

Server:
ERROR: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.24/info: dial unix /var/run/docker.sock: connect: permission denied

My user was already in the 'docker' group, so this was not the Problem.

I fixed the problem by changing the access permissions:

sudo chmod 666 /var/run/docker.sock

Error getting credentials on docker commands

I had the following error when I tried to start a docker container: error getting credentials - err: exit status 1, out: 'Cannot autolaunch D-Bus without X11 $DISPLAY'

By default, Docker looks for the native binary on each of the platforms; i.e., “osxkeychain” on macOS, “wincred” on windows, and “pass” on Linux. A special case is that on Linux, Docker will fall back to the “secretservice” binary if it cannot find the “pass” binary.

he simplest solution to fix the “Cannot autolaunch D-Bus without X11 $DISPLAY” error is to install pass.

sudo apt-get install pass gnupg2

# create a gpg2 key
gpg2 --gen-key

# create the password store using the gpg user id
pass init $gpg_id

Deconz error on startup

Error:

Fatal Python error: init_interp_main: can't initialize time

Solution:

Update libseccomp2 to >=2.5.4

https://packages.debian.org/sid/armhf/libseccomp2/download

wget http://ftp.us.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.4-1+b1_armhf.deb

sudo dpkg -i libseccomp2_2.5.4-1+b1_armhf.deb

Software Packages / Links

About

IoT Docker Setup with Node-Red, Mosquitto, Influx, Grafana and OpenHab

Topics

Resources

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages