Selbstsigniertes SSL-Zertifikat für den INSTAR MQTT-Broker und Node-RED

Q: Wie verwende ich ein benutzerdefiniertes SSL-Zertifikat für den INSTAR MQTT-Broker mit Node-RED?

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

Machen Sie Ihrer Kamera zum Herzstück Ihres Smarthomes

INSTAR MQTT Support

Mithilfe der MQTT Schnittstelle Ihrer INSTAR Full HD Kameras können Sie diese zu einem bestehenden Smarthome-System (Home Assistant, OpenHAB, Node-RED, Athom Homey, Homematic, ioBroker, Loxone, homee) hinzufügen kann. Oder auch zum Haupt-Broker für Ihre MQTT Sensoren machen. MQTT ermöglicht es Ihnen ALLE Funktionen Ihrer Kamera zu automatisieren und mit anderen Diensten in Ihrem Smarthome zu verknüpfen.

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

Kontrollieren Sie Ihre Kamera über den IFTTT Online Dienst

INSTAR IFTTT Support

Auf der IFTTT-Plattform stellten wir einen Dienst namens INSTAR zur Verfügung. Die INSTAR Applets bieten Ihnen die Möglichkeit, einige Einstellungen Ihrer INSTAR Kamera oder INSTAR Cloud mit IFTTT zu steuern. Sie können INSTAR mit Auslösern für Ort (Geo Location) und Datum & Zeit verbinden, Benachrichtigungen versenden und vieles mehr. Zum Beispiel können Sie die INSTAR Applets mit dem IFTTT-Ortungsdienst verbinden und automatisch den Alarm deaktivieren lassen, wenn Sie zu Hause ankommen. Sie können die INSTAR-Applets auch verwenden, um Ihre eigene Automatisierung zu erstellen und sie mit anderen Applets von Drittanbietern zu verbinden.

A: Wir haben bereits gezeigt, wie Sie Ihren INSTAR MQTT-Broker mit einem selbstsignierten SSL-Zertifikat einrichten können. Nach dieser Anleitung haben wir nun eine Kamera als unseren MQTT-Broker und eine zweite Kamera als MQTT-Client in unserem MQTT-Netzwerk konfiguriert. Beide Kameras kommunizieren SSL-verschlüsselt mit einem selbstsignierten Zertifikat.

Kamera Setup

Die Broker-Kamera verwendet die broker.pem Datei als SSL-Zertifikat:

Node-RED Self-Signed Cert for INSTAR MQTT

Und ist so konfiguriert, dass es ihren eigenen MQTT-Broker (127.0.0.1) mit einem Benutzer-Login verwendet:

Node-RED Self-Signed Cert for INSTAR MQTT

Node-RED Setup

Wir können nun fortfahren, indem wir den Broker zu Node-RED hinzufügen:

Node-RED Self-Signed Cert for INSTAR MQTT

Fügen Sie die IP-Adresse und den MQTT (TLS)-Port Ihrer Broker-Kameras hinzu (Standard: 8883) und klicken Sie danach auf das "Stift-Symbol", um die TLS-Konfiguration zu bearbeiten.

Node-RED Self-Signed Cert for INSTAR MQTT

Laden Sie nun die Datei client.pem als Zertifikat für die Broker-Verbindung hoch.

Node-RED Self-Signed Cert for INSTAR MQTT

Auf der Registerkarte Sicherheit können Sie Ihr Broker-Benutzer-Login hinzufügen.

Node-RED Self-Signed Cert for INSTAR MQTT

Node-RED Flow

Wir können jetzt beginnen einige MQTT-Knoten hinzufügen, um unsere beiden Kameras zu steuern. Fügen Sie ein paar MQTT-Topics mit der MQTT-ID Ihrer Kameras hinzu:

Node-RED Self-Signed Cert for INSTAR MQTT

Dieser Flow ermöglicht es mir, die 4 Bewegungserkennungsbereiche auf jeder Kamera entweder selektiv zu aktivieren oder zu deaktivieren. Oder sie alle mit dem "all" Topic auf einmal zu schalten:

Node-RED Self-Signed Cert for INSTAR MQTT

Sie können jetzt zur Node-RED UI wechseln und die Funktion ausprobieren:

Node-RED Self-Signed Cert for INSTAR MQTT

Node-RED JSON Flow Export

Sie können diesen Flow in Ihr Node-RED-Dashboard importieren. Alles, was Sie tun müssen, damit dieser auch mit Ihren Kameras funktioniert, ist das Hinzufügen Ihres persönlichen MQTT-Brokers zu allen MQTT-Knoten und das Ändern der MQTT-IDs, die zur Adressierung jeder Kamera verwendet werden:

[{"id":"61ef0727.5861e8","type":"comment","z":"f2874ee3.2c36e","name":"Multi Cam","info":"","x":80,"y":540,"wires":[]},{"id":"c3a24119.accef","type":"mqtt in","z":"f2874ee3.2c36e","name":"117 alarm/area1/enable","topic":"instar/10D1DC218F96/status/alarm/area1/enable","qos":"1","datatype":"auto","broker":"b37fd286.bdd28","x":120,"y":588,"wires":[["44093f9e.3ef07"]]},{"id":"44093f9e.3ef07","type":"ui_switch","z":"f2874ee3.2c36e","name":"Area 1","label":"Area 1","tooltip":"","group":"b4c0e313.f6a4f","order":0,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"instar/091419200118/alarm/area1/enable","style":"","onvalue":"{\"val\":\"1\"}","onvalueType":"str","onicon":"","oncolor":"","offvalue":"{\"val\":\"0\"}","offvalueType":"str","officon":"","offcolor":"","x":289,"y":588,"wires":[["2b72fc92.405c94"]]},{"id":"2b72fc92.405c94","type":"mqtt out","z":"f2874ee3.2c36e","name":"117 alarm/area1/enable","topic":"instar/10D1DC218F96/alarm/area1/enable","qos":"1","retain":"false","broker":"b37fd286.bdd28","x":471,"y":588,"wires":[]},{"id":"e1b10edd.1ba0d","type":"mqtt in","z":"f2874ee3.2c36e","name":"117 alarm/area2/enable","topic":"instar/10D1DC218F96/status/alarm/area2/enable","qos":"1","datatype":"auto","broker":"b37fd286.bdd28","x":120,"y":627,"wires":[["2f0b228d.d7fbee"]]},{"id":"2f0b228d.d7fbee","type":"ui_switch","z":"f2874ee3.2c36e","name":"Area 2","label":"Area 2","tooltip":"","group":"b4c0e313.f6a4f","order":0,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"instar/091419200118/alarm/area1/enable","style":"","onvalue":"{\"val\":\"1\"}","onvalueType":"str","onicon":"","oncolor":"","offvalue":"{\"val\":\"0\"}","offvalueType":"str","officon":"","offcolor":"","x":289,"y":627,"wires":[["3a2f05e9.f06eca"]]},{"id":"3a2f05e9.f06eca","type":"mqtt out","z":"f2874ee3.2c36e","name":"117 alarm/area2/enable","topic":"instar/10D1DC218F96/alarm/area2/enable","qos":"1","retain":"false","broker":"b37fd286.bdd28","x":471,"y":627,"wires":[]},{"id":"11f6be0a.933122","type":"mqtt in","z":"f2874ee3.2c36e","name":"117 alarm/area3/enable","topic":"instar/10D1DC218F96/status/alarm/area3/enable","qos":"1","datatype":"auto","broker":"b37fd286.bdd28","x":120,"y":667,"wires":[["446266e0.332f38"]]},{"id":"446266e0.332f38","type":"ui_switch","z":"f2874ee3.2c36e","name":"Area 3","label":"Area 3","tooltip":"","group":"b4c0e313.f6a4f","order":0,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"instar/091419200118/alarm/area1/enable","style":"","onvalue":"{\"val\":\"1\"}","onvalueType":"str","onicon":"","oncolor":"","offvalue":"{\"val\":\"0\"}","offvalueType":"str","officon":"","offcolor":"","x":289,"y":667,"wires":[["1bfca69d.b4ac79"]]},{"id":"1bfca69d.b4ac79","type":"mqtt out","z":"f2874ee3.2c36e","name":"117 alarm/area3/enable","topic":"instar/10D1DC218F96/alarm/area3/enable","qos":"1","retain":"false","broker":"b37fd286.bdd28","x":471,"y":667,"wires":[]},{"id":"95a60594.dc2e28","type":"mqtt in","z":"f2874ee3.2c36e","name":"117 alarm/area4/enable","topic":"instar/10D1DC218F96/status/alarm/area4/enable","qos":"1","datatype":"auto","broker":"b37fd286.bdd28","x":120,"y":707,"wires":[["8781da14.2efa48"]]},{"id":"8781da14.2efa48","type":"ui_switch","z":"f2874ee3.2c36e","name":"Area 4","label":"Area 4","tooltip":"","group":"b4c0e313.f6a4f","order":0,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"instar/091419200118/alarm/area4/enable","style":"","onvalue":"{\"val\":\"1\"}","onvalueType":"str","onicon":"","oncolor":"","offvalue":"{\"val\":\"0\"}","offvalueType":"str","officon":"","offcolor":"","x":289,"y":707,"wires":[["56c3148a.72c15c"]]},{"id":"56c3148a.72c15c","type":"mqtt out","z":"f2874ee3.2c36e","name":"117 alarm/area4/enable","topic":"instar/10D1DC218F96/alarm/area4/enable","qos":"1","retain":"false","broker":"b37fd286.bdd28","x":471,"y":707,"wires":[]},{"id":"f51f0525.a81ad8","type":"mqtt in","z":"f2874ee3.2c36e","name":"116 alarm/area1/enable","topic":"instar/10D1DC21F5DB/status/alarm/area1/enable","qos":"1","datatype":"auto","broker":"b37fd286.bdd28","x":120,"y":780,"wires":[["13bdd46e.5633ac"]]},{"id":"13bdd46e.5633ac","type":"ui_switch","z":"f2874ee3.2c36e","name":"Area 1","label":"Area 1","tooltip":"","group":"959e1975.f9b138","order":0,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"instar/000389888811/alarm/area1/enable","style":"","onvalue":"{\"val\":\"1\"}","onvalueType":"str","onicon":"","oncolor":"","offvalue":"{\"val\":\"0\"}","offvalueType":"str","officon":"","offcolor":"","x":289,"y":780,"wires":[["1df97bf7.99ba54"]]},{"id":"1df97bf7.99ba54","type":"mqtt out","z":"f2874ee3.2c36e","name":"116 alarm/area1/enable","topic":"instar/10D1DC21F5DB/alarm/area1/enable","qos":"1","retain":"false","broker":"b37fd286.bdd28","x":471,"y":780,"wires":[]},{"id":"a5ac0958.2b97c8","type":"mqtt in","z":"f2874ee3.2c36e","name":"116 alarm/area2/enable","topic":"instar/10D1DC21F5DB/status/alarm/area2/enable","qos":"1","datatype":"auto","broker":"b37fd286.bdd28","x":120,"y":819,"wires":[["2e5d3f2c.e1c5d"]]},{"id":"2e5d3f2c.e1c5d","type":"ui_switch","z":"f2874ee3.2c36e","name":"Area 2","label":"Area 2","tooltip":"","group":"959e1975.f9b138","order":0,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"instar/000389888811/alarm/area1/enable","style":"","onvalue":"{\"val\":\"1\"}","onvalueType":"str","onicon":"","oncolor":"","offvalue":"{\"val\":\"0\"}","offvalueType":"str","officon":"","offcolor":"","x":289,"y":819,"wires":[["936d0631.a57e68"]]},{"id":"936d0631.a57e68","type":"mqtt out","z":"f2874ee3.2c36e","name":"116 alarm/area2/enable","topic":"instar/10D1DC21F5DB/alarm/area2/enable","qos":"1","retain":"false","broker":"b37fd286.bdd28","x":471,"y":819,"wires":[]},{"id":"2d660b21.7f72f4","type":"mqtt in","z":"f2874ee3.2c36e","name":"116 alarm/area3/enable","topic":"instar/10D1DC21F5DB/status/alarm/area3/enable","qos":"1","datatype":"auto","broker":"b37fd286.bdd28","x":120,"y":859,"wires":[["7379cd9b.71c534"]]},{"id":"7379cd9b.71c534","type":"ui_switch","z":"f2874ee3.2c36e","name":"Area 3","label":"Area 3","tooltip":"","group":"959e1975.f9b138","order":0,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"instar/000389888811/alarm/area1/enable","style":"","onvalue":"{\"val\":\"1\"}","onvalueType":"str","onicon":"","oncolor":"","offvalue":"{\"val\":\"0\"}","offvalueType":"str","officon":"","offcolor":"","x":289,"y":859,"wires":[["fd1e8946.05a348"]]},{"id":"fd1e8946.05a348","type":"mqtt out","z":"f2874ee3.2c36e","name":"116 alarm/area3/enable","topic":"instar/10D1DC21F5DB/alarm/area3/enable","qos":"1","retain":"false","broker":"b37fd286.bdd28","x":471,"y":859,"wires":[]},{"id":"4351599b.296338","type":"mqtt in","z":"f2874ee3.2c36e","name":"116 alarm/area4/enable","topic":"instar/10D1DC21F5DB/status/alarm/area4/enable","qos":"1","datatype":"auto","broker":"b37fd286.bdd28","x":120,"y":899,"wires":[["ef7b24a2.79db68"]]},{"id":"ef7b24a2.79db68","type":"ui_switch","z":"f2874ee3.2c36e","name":"Area 4","label":"Area 4","tooltip":"","group":"959e1975.f9b138","order":0,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"instar/000389888811/alarm/area4/enable","style":"","onvalue":"{\"val\":\"1\"}","onvalueType":"str","onicon":"","oncolor":"","offvalue":"{\"val\":\"0\"}","offvalueType":"str","officon":"","offcolor":"","x":289,"y":899,"wires":[["35133b33.3d0d04"]]},{"id":"35133b33.3d0d04","type":"mqtt out","z":"f2874ee3.2c36e","name":"116 alarm/area4/enable","topic":"instar/10D1DC21F5DB/alarm/area4/enable","qos":"1","retain":"false","broker":"b37fd286.bdd28","x":471,"y":899,"wires":[]},{"id":"ad7bea57.2dc018","type":"mqtt out","z":"f2874ee3.2c36e","name":"all alarm/area1/enable","topic":"instar/all/alarm/area1/enable","qos":"1","retain":"false","broker":"b37fd286.bdd28","x":290,"y":999,"wires":[]},{"id":"799bc157.ec3d8","type":"ui_button","z":"f2874ee3.2c36e","name":"","group":"b0726aac.cd7738","order":4,"width":0,"height":0,"passthru":false,"label":"Areas On","tooltip":"","color":"","bgcolor":"","icon":"","payload":"{\"val\":\"1\"}","payloadType":"str","topic":"instar/all/alarm/area1/enable","x":79,"y":1060,"wires":[["ad7bea57.2dc018","33494e47.15c612","88d1c280.e6537","c051ddad.c946b"]]},{"id":"25a2feac.0e4a82","type":"mqtt out","z":"f2874ee3.2c36e","name":"all alarm/area1/enable","topic":"instar/all/alarm/area1/enable","qos":"1","retain":"false","broker":"b37fd286.bdd28","x":289,"y":1177,"wires":[]},{"id":"99e2c1a8.2b636","type":"ui_button","z":"f2874ee3.2c36e","name":"","group":"b0726aac.cd7738","order":4,"width":0,"height":0,"passthru":false,"label":"Areas Off","tooltip":"","color":"","bgcolor":"","icon":"","payload":"{\"val\":\"0\"}","payloadType":"str","topic":"instar/all/alarm/area1/enable","x":79,"y":1240,"wires":[["25a2feac.0e4a82","cc0c95c4.d6f4f8","699e04aa.e26d5c","14281fe7.cceda"]]},{"id":"33494e47.15c612","type":"mqtt out","z":"f2874ee3.2c36e","name":"all alarm/area2/enable","topic":"instar/all/alarm/area2/enable","qos":"1","retain":"false","broker":"b37fd286.bdd28","x":290,"y":1039,"wires":[]},{"id":"cc0c95c4.d6f4f8","type":"mqtt out","z":"f2874ee3.2c36e","name":"all alarm/area2/enable","topic":"instar/all/alarm/area2/enable","qos":"1","retain":"false","broker":"b37fd286.bdd28","x":289,"y":1217,"wires":[]},{"id":"88d1c280.e6537","type":"mqtt out","z":"f2874ee3.2c36e","name":"all alarm/area3/enable","topic":"instar/all/alarm/area3/enable","qos":"1","retain":"false","broker":"b37fd286.bdd28","x":290,"y":1079,"wires":[]},{"id":"699e04aa.e26d5c","type":"mqtt out","z":"f2874ee3.2c36e","name":"all alarm/area3/enable","topic":"instar/all/alarm/area3/enable","qos":"1","retain":"false","broker":"b37fd286.bdd28","x":289,"y":1257,"wires":[]},{"id":"c051ddad.c946b","type":"mqtt out","z":"f2874ee3.2c36e","name":"all alarm/area4/enable","topic":"instar/all/alarm/area4/enable","qos":"1","retain":"false","broker":"b37fd286.bdd28","x":290,"y":1119,"wires":[]},{"id":"14281fe7.cceda","type":"mqtt out","z":"f2874ee3.2c36e","name":"all alarm/area4/enable","topic":"instar/all/alarm/area4/enable","qos":"1","retain":"false","broker":"b37fd286.bdd28","x":289,"y":1297,"wires":[]},{"id":"b37fd286.bdd28","type":"mqtt-broker","z":"","name":"192.168.2.117 (PrivCert)","broker":"192.168.2.117","port":"8883","tls":"7d9f372e.6892b8","clientid":"nodered","usetls":true,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"b4c0e313.f6a4f","type":"ui_group","z":"","name":"Alarm Areas 117","tab":"a28030c1.b97b8","disp":true,"width":"6","collapse":false},{"id":"959e1975.f9b138","type":"ui_group","z":"","name":"Alarm Areas 116","tab":"a28030c1.b97b8","disp":true,"width":"6","collapse":false},{"id":"b0726aac.cd7738","type":"ui_group","z":"","name":"Alarm Areas All","tab":"a28030c1.b97b8","disp":true,"width":"6","collapse":false},{"id":"7d9f372e.6892b8","type":"tls-config","z":"","name":"192.168.2.117 (PrivCert)","cert":"","key":"","ca":"","certname":"client.pem","keyname":"","caname":"","servername":"","verifyservercert":false},{"id":"a28030c1.b97b8","type":"ui_tab","z":"","name":"Multi Cam","icon":"dashboard","disabled":false,"hidden":false}]

Jetzt können Sie mit unserem regulären Tutorial zum Hinzufügen Ihrer ersten Schalter und Automatisierungen fortfahren.