Run a INSTAR Node-RED Dashboard in Docker

Mike Polinowski
INSTAR MQTT
Firmware Update
Full HD Series
INSTAR Deutschland GmbH
INSTAR MQTT

Make your camera the heart of your smart home

INSTAR MQTT

Using the MQTT interface of your INSTAR Full HD cameras you can connect them to an existing smarthome system (Home Assistant, OpenHAB, Node-RED, Athom Homey, Homematic, ioBroker, Loxone, homee) can be added. Or even make it the main broker for your MQTT sensors. MQTT allows you to automate ALL functions of your camera and link them to other services in your smarthome.

Mike Polinowski
IFTTT Applets
Firmware Update
Full HD Series
INSTAR Cloud
INSTAR Deutschland GmbH
INSTAR IFTTT Applets

Control your camera via the IFTTT online service

INSTAR IFTTT

On the IFTTT platform, we provided a service called INSTAR. The INSTAR applets provide you with the ability to control some settings of your INSTAR camera or INSTAR Cloud with IFTTT. You can connect INSTAR with triggers for location (Geo Location) and date & time, send notifications and much more. For example, you can connect INSTAR applets to the IFTTT location service and automatically disable the alarm when you arrive home. You can also use the INSTAR applets to create your own automation and connect them to other third-party applets.

Docker is an application that simplifies the process of managing application processes in containers. Containers let you run your applications in resource-isolated processes. They’re similar to virtual machines, but containers are more portable, more resource-friendly, and more dependent on the host operating system.

Ausführen eines INSTAR Node-RED Dashboards in Docker

Install Docker on Ubuntu 20.04

First, update your existing list of packages:

sudo apt update

Next, install a few prerequisite packages:

sudo apt install apt-transport-https ca-certificates curl software-properties-common

Then add the GPG key for the official Docker repository:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Add the Docker repository to APT sources:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"

Now update the package database with the Docker packages:

sudo apt update

Finally, install Docker:

sudo apt install docker-ce

Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it’s running:

sudo systemctl status docker

docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running)

If you want to avoid typing sudo whenever you run the docker command, add your username to the docker group:

sudo usermod -aG docker ${USER}

To apply the new group membership, log out of the server and back in, or type the following:

su - ${USER}

Now test that everything is set up by typing:

docker info

Download Node-RED Configuration

We now need a folder that the Node-RED container can use to persist it's data. Clone this repository or download the Zip file and unzipp it and save it into the /opt directory. Make sure that the Docker user has access to this directory and is allowed to write into it. E.g. :

chown -R nodered:nodered /opt/nodered/*
chmod -R 777 /opt/nodered

Run Node-RED in Docker

Start by pulling the official Node-RED image from Docker Hub:

docker pull nodered/node-red:latest

Now run the Node-RED container with the following command:

docker run -d --rm --privileged --net=host -v /opt/nodered/data:/data --name nodered nodered/node-red:latest
-dRun the container detached from my terminal in the background
-rmWhen I stop the container remove it
--privilegedThis is a bit like running the process with sudo and prevents you from running into LINUX security restrictions. You can remove this flag. If your permissions are set correctly the container should work without it.
--net=hostUsually Docker container are executed in an virtual network. To be able to access a service outside of localhost you have to open the necessary ports - you can replace this flag with -p 1880:1880 to only open the port that the Node-RED UI needs. If you install additional services in Node-RED that requirer different ports you have to add all of them in the RUN command. Setting the network to host is just a shortcut for local development.
-v /opt/Node-RED/data:/dataThis mounts the folder that you created into the container. All data that is stored by Node-RED inside the container will be persisted inside this folder.
--name noderedGive your container a name so you can address it by this name instead of having to know it's ID
nodered/node-red:latestIs the image that you want to spin up into this container

Configuring your Dashboard

Used Node-RED Nodes:

Ausführen eines INSTAR Node-RED Dashboards in Docker

To connect your INSTAR Full HD camera you need to:

  1. Double-click the ONVIF node and add you cameras IP Address, ONVIF Port and Admin Login.
  2. Double-click the GET Snap HTTP node and add your cameras snapshot URL:
    • JPG Path 1: http://192.168.x.x/tmpfs/snap.jpg?usr=usernam&pwd=password
    • JPG Path 2: http://192.168.x.x/tmpfs/auto.jpg?usr=usernam&pwd=password
    • JPG Path 3: http://192.168.x.x/tmpfs/auto2.jpg?usr=usernam&pwd=password
  3. Double-click the Alarmserver MQTT IN node and click to edit the Server (Broker). Now you can add your cameras MQTT broker configuration.This is the broker that is used by all MQTT nodes - so you only have to change it in one place. Note that if you are using an external MQTT Broker and your camera is connected as a client you can use your broker configuration here. But you will have to change the MQTT Topics in ALL MQTT nodes from the local topic to the camera specific topic using your cameras MQTT ID.

Ausführen eines INSTAR Node-RED Dashboards in Docker