Skip to main content

Home Assistant, OpenHAB, Node-RED, ioBroker, MotionEye, ZoneMinder, Frigate, iSpy Agent, Kerberos Containerized (Docker)

Siem Reap, Cambodia

Smarthome Cheat Sheet (Docker Edition)

Home Assistant

docker pull homeassistant/home-assistant:stable
mkdir -p /opt/homeassistant/config
chmod -R 775 /opt/homeassistant
docker run -d --rm --privileged --net=host --name='home-assistant' -e 'TZ=Europe/Berlin' -v /opt/homeassistant/config:/config homeassistant/home-assistant:stable

http://localhost:8123

Node-RED

docker pull nodered/node-red:latest
mkdir -p /opt/nodered/data
chmod -R 775 /opt/nodered
chown 1000:1000 -R /opt/nodered
docker run -d --rm --privileged --net=host -v /opt/nodered/data:/data --name nodered nodered/node-red

http://localhost:1880

Theming

cd /opt/nodered/data
npm install @node-red-contrib-themes/midnight-red

Add the following to the editorTheme section of your settings.js:

editorTheme: {
projects: {
// To enable the Projects feature, set this value to true
enabled: false
}
}

Change to ->

// Customising the editor
editorTheme: {
page: {
css: '/opt/nodered/data/node_modules/@node-red-contrib-themes/midnight-red/theme.css'
}
}

OpenHAB

docker pull openhab/openhab:latest-alpine
groupadd -g 9001 openhab
useradd -g 9001 openhab
usermod -a -G openhab myownuser
mkdir -p /opt/openhab/{openhab_addons,openhab_conf,openhab_userdata}
chmod -R 775 /opt/openhab
docker run \
--name openhab \
--net=host \
--privileged \
--rm \
-v /etc/localtime:/etc/localtime:ro \
-v /opt/openhab/openhab_addons:/openhab/addons \
-v /opt/openhab/openhab_conf:/openhab/conf \
-v /opt/openhab/openhab_userdata:/openhab/userdata \
-d \
openhab/openhab:latest-alpine

http:localhost:8080

OpenHAB CLI

docker exec -it openhab /openhab/runtime/bin/client -p habopen

Updating the Image

Use the following steps to update the docker image and all installed add-ons.

Stop the container:

docker stop openhab

Delete the container:

docker rm openhab

Delete the contents of /opt/openhab/userdata/cache and /opt/openhab/userdata/tmp

rm -rf /opt/openhab/userdata/cache
rm -rf /opt/openhab/userdata/tmp

Pull down the latest image:

docker pull openhab/openhab:`latest`

Restart the container using the full command above.

ioBroker

docker pull iobroker/iobroker:latest

And and run it:

docker run \
--net=host \
--privileged \
--rm \
--name iobroker \
-v /opt/iobroker:/opt/iobroker \
-v /opt/iobroker/home:/home/iobroker \
--detach=true \
iobroker/iobroker:latest

http://localhost:8081

MotionEye

docker pull ccrisan/motioneye:master-amd64

And and run it:

docker run --name='motioneye' \
--net=host \
--privileged \
--rm \
--hostname='motioneye' \
-v /etc/localtime:/etc/localtime:ro \
-v /opt/motioneye:/etc/motioneye \
-v /opt/motioneye/lib:/var/lib/motioneye \
--security-opt label=disable \
--detach=true \
ccrisan/motioneye:master-amd64

http://localhost:80

ZoneMinder

docker pull dlandon/zoneminder:latest

And and run it:

docker run -d --name="zoneminder" \
--privileged="false" \
--shm-size="5G" \
--net=host \
--rm \
-e TZ="America/New_York" \
-e PUID="99" \
-e PGID="100" \
-e INSTALL_HOOK="0" \
-e INSTALL_FACE="0" \
-e INSTALL_TINY_YOLOV3="0" \
-e INSTALL_YOLOV3="0" \
-e INSTALL_TINY_YOLOV4="0" \
-e INSTALL_YOLOV4="0" \
-e MULTI_PORT_START="0" \
-e MULTI_PORT_END="0" \
-v "/opt/zoneminder":"/config":rw \
-v "/opt/zoneminder/data":"/var/cache/zoneminder":rw \
dlandon/zoneminder
docker run -d --name="zoneminder" \
--net="bridge" \
--privileged="false" \
--shm-size="5G" \
-p 9000:9000/tcp \
-p 443:443/tcp \
-p 80:80/tcp \
-e TZ="America/New_York" \
-e PUID="99" \
-e PGID="100" \
-e INSTALL_HOOK="0" \
-e INSTALL_FACE="0" \
-e INSTALL_TINY_YOLOV3="0" \
-e INSTALL_YOLOV3="0" \
-e INSTALL_TINY_YOLOV4="0" \
-e INSTALL_YOLOV4="0" \
-e MULTI_PORT_START="0" \
-e MULTI_PORT_END="0" \
-v "/opt/zoneminder":"/config":rw \
-v "/opt/zoneminder/data":"/var/cache/zoneminder":rw \
dlandon/zoneminder

http://localhost:80

Frigate NVR

docker pull ghcr.io/blakeblackshear/frigate:stable
mkdir -p /opt/frigate/storage
nano /opt/frigate/config.yml
mqtt:
host: <ip of your mqtt server>
user: <username>
password: <password>
cameras:

fullhd31: # <------ Name der Kamera
ffmpeg:
inputs:
- path: rtsp://admin:instar@192.168.2.31:554/11 # <----- RTSP Pfad der Kamera
roles:
- detect
- rtmp
detect:
width: 1920 # <---- Auflösung des gewählten RTSP Streams
height: 1080 # <---- Auflösung des gewählten RTSP Streams

wqhd120: # <------ Name der Kamera
ffmpeg:
inputs:
- path: rtsp://admin:instar@192.168.2.120:554/livestream/12 # <----- RTSP Pfad der Kamera
roles:
- detect
- rtmp
detect:
width: 1920 # <---- Auflösung des gewählten RTSP Streams
height: 1080 # <---- Auflösung des gewählten RTSP Streams
docker run -d \
--name frigate \
--restart=unless-stopped \
--mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000 \
--device /dev/bus/usb:/dev/bus/usb \
--device /dev/dri/renderD128 \
--shm-size=64m \
-v /opt/frigate/storage:/media/frigate \
-v /opt/frigate/config.yml:/config/config.yml:ro \
-v /etc/localtime:/etc/localtime:ro \
-e FRIGATE_RTSP_PASSWORD='password' \
-p 5000:5000 \
-p 1935:1935 \
ghcr.io/blakeblackshear/frigate:stable

http://localhost:5000

Docker-Compose

nano /opt/frigate/docker-compose.yml
version: "3.9"
services:
frigate:
container_name: frigate
privileged: true # dies ist nicht für alle Konfigurationen erforderlich
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:0.12.0-beta5
shm_size: "64mb" # Update für Ihre Kameras basierend auf der obigen Berechnung
devices:
- /dev/bus/usb:/dev/bus/usb # besteht den USB Coral, muss für andere Versionen modifiziert werden
- /dev/apex_0:/dev/apex_0 # peine PCIe-Koralle einbauen, folgen Sie den Anweisungen des Treibers hier https://coral.ai/docs/m2/get-started/#2a-on-linux
- /dev/dri/renderD128 # für intel hwaccel, muss für Ihre Hardware aktualisiert werden
volumes:
- /etc/localtime:/etc/localtime:ro
- /opt/frigate/config.yml:/config/config.yml:ro
- /opt/frigate/storage:/media/frigate
- type: tmpfs # Optional: 1 GB Arbeitsspeicher, reduziert den Verschleiß von SSD/SD-Karten
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "5000:5000"
- "1935:1935" # RTMP feeds
environment:
FRIGATE_RTSP_PASSWORD: "password"

iSpy Agent DVR

git clone https://github.com/mpolinowski/agent-dvr-docker.git && cd agent-dvr-docker
docker build -t agent-dvr .
sudo mkdir -p /opt/dvr-agent/{config,media,commands}
sudo chown -R myuser /opt/dvr-agent/*
docker run --restart=unless-stopped -d -p 8090:8090 -p 3478:3478/udp -p 50000-50010:50000-50010/udp \
-v /opt/dvr-agent/config/:/agent/Media/XML/ \
-v /opt/dvr-agent/media/:/agent/Media/WebServerRoot/Media/ \
-v /opt/dvr-agent/commands:/agent/Commands/ \
-e TZ=Europe/Berlin \
--name agent-dvr agent-dvr:latest

http://localhost:8090

Kerberos.io

docker pull kerberos/kerberos:latest
docker run --name mycamera -p 8080:80 -p 8889:8889 -d kerberos/kerberos:latest
mkdir -p /opt/kerberos/{config,capture,logs,webconfig}
docker run --name garage \
-p 8080:80 -p 8889:8889 \
-v /opt/kerberos/config:/etc/opt/kerberos/config \
-v /opt/kerberos/capture:/etc/opt/kerberosio/capture \
-v /opt/kerberos/logs:/etc/opt/kerberosio/logs \
-v /opt/kerberos/webconfig:/var/www/web/config \
-d kerberos/kerberos

http://192.168.2.111:8080