Software
Home Automation (MQTTv5)
This guide uses the MQTTv5 API. For Full HD cameras please replace the MQTT topics with the MQTTv3 API. If you don't use MQTT in your smarthome system please refer to our HTTP API (CGI) documentation - the CGI version of this guide can be found here.
homee Home Automation
- Home Automation MQTTv5
- Introduction
- How does it work
- Use external Sensors
- Activate Nightvision only when Motion is detected
- Schedule different Positions
- Verwenden Sie für jede Position unterschiedliche Erkennungsbereiche
- Use different Sensitivities for Day & Night
- Deaktivieren Sie den Alarm aller Kameras, wenn Sie zu Hause ankommen
- Use external Sensors to turn your Camera when Motion is detected
- Verwenden Sie externe Sensoren, um Alarmaufzeichnungen auszulösen
- Interconnect your Cameras
- Scan for Noise Sources
- Manually deactivate all Alarm functions for all your Cameras
- Switch between PIR and Software Motion Detection
Introduction
homee is a wireless gateway that allows you to communicate with wireless smart devices. You can control devices from anywhere using the free homee app.
Many devices differ in the wireless technology (Zigbee, Z-Wave, EnOcean) they use for communication. Each homee cube is responsible for a different wireless standard and can therefore talk to other devices. The white brain cube is the central unit. He collects all information and transmits it to your smartphone. So you can link very different devices together.
You can control your devices manually, with schedules and system variables or with intelligent programs called homeegrams. Those are simple If / Then clauses that you can set up from your smartphone or web browser - very similar to the IFTTT Cloud Service.
In the following paragraphs we want to show you how to connect external wireless sensors through the homee system with your INSTAR IP camera, set up time schedules for your surveillance and optimize your camera operation.
If you are looking for a deep dive into setting up your homee automation with an INSTAR IP camera, switch to our FULL GUIDE instead.
How does it work
When you are interested in using the MQTT interface to add your camera to a smarthome system, you are probably already familiar with our HTTP/S CGI interface that you can use to send commands to your camera through your web browser.
MQTT works much the same way. Every CGI command corresponds to an MQTT topic and every topic can carry specific payloads. For example to activate the first Motion Detection Area on your camera, you can send the following CGI command:
param.cgi?cmd=setmdattr&-name=1&-enable=[val]
Where the value (val
) can be 0
or 1
- depending on whether you want to deactivate or activate the detection area. In MQTT doing the same thing looks like this:
alarm/area1/enable {"val":"0"}, {"val":"1"}
The topic to switch the area on or off is alarm/area1/enable
and you have to send either a value of 1
or 0
to switch it.
- How to Configure the INSTAR MQTT Broker/Client
- The INSTAR MQTT Service
- The INSTAR MQTTv5 API Documentation
1. Use external Sensors
Triggering an alarm on the camera by an event registered by your home automation system:
alarm/pushalarm {"val":"1"}
2. Activate Nightvision only when Motion is detected
Activate your cameras night vision according to a schedule or triggered by an external sensor integrated in home automation system:
features/nightvision/autoled {"val":"0"}, {"val":"1"}, {"val":"2"}
The activation of the night vision in case of an alarm is of course only possible if the camera has an internal PIR sensor for motion detection, or if you use the alarm signal of an external sensor in home automation to "focus" the camera. The advantage - the camera is inconspicuous at night and the IR light attracts no insects / spiders. And the power consumption is of course also pressed.
3. Schedule different Positions
Scheduled day and night position - guard the front door when I'm not at home but I turn the camera to my carport when I'm back from work:
features/ptz/preset {"val":"0"} - {"val":"7"}
4. Verwenden Sie für jede Position unterschiedliche Erkennungsbereiche
In Kombination mit der geplanten Tag- und Nachtposition (siehe oben) können Sie auch verschiedene Bewegungserkennungsbereiche aktivieren - im Beispiel sind die Bereiche 1 & 2 tagsüber und die Bereiche 3 & 4 nachts aktiviert:
alarm/area1/enable {"val":"0"}, {"val":"1"}
alarm/area2/enable {"val":"0"}, {"val":"1"}
alarm/area3/enable {"val":"0"}, {"val":"1"}
alarm/area4/enable {"val":"0"}, {"val":"1"}
5. Use different Sensitivities for Day & Night
Since there are often different sensitivities needed for the motion detection during day and night conditions, you can also adjust these - in the example to 75% during the day and 25% at night:
alarm/area1/sensitivity {"val":"1"} - {"val":"100"}
alarm/area2/sensitivity {"val":"1"} - {"val":"100"}
alarm/area3/sensitivity {"val":"1"} - {"val":"100"}
alarm/area4/sensitivity {"val":"1"} - {"val":"100"}
6. Deaktivieren Sie den Alarm aller Kameras, wenn Sie zu Hause ankommen
Nutzen Sie eine Smartbutton oder Funk-Schlüsselanhänger um alle Alarmerkennungsbereiche und den PIR-Sensor aller Kameras zu deaktivieren, wenn Sie keinen Alarm auslösen möchten:
alarm/area1/enable {"val":"0"}, {"val":"1"}
alarm/area2/enable {"val":"0"}, {"val":"1"}
alarm/area3/enable {"val":"0"}, {"val":"1"}
alarm/area4/enable {"val":"0"}, {"val":"1"}
alarm/actions/pir/enable {"val":"0"}, {"val":"1"}
7. Use external Sensors to turn your Camera when Motion is detected
Let your camera move between positions depending on system variables in home automation system. For example - when the door sensor is tripped, look to the door, when the window sensor is triggered turn towards the window and when the external motion sensor detects a person, turn to the kitchen door:
features/ptz/preset {"val":"0"} - {"val":"7"}
This can be combined well with the parking position in the camera - the camera then automatically returns to the standard position after x minutes.
8. Verwenden Sie externe Sensoren, um Alarmaufzeichnungen auszulösen
Wenn Sie Ihre Kamera so einstellen, dass sie sich bei Auslösung durch einen externen Sensor auf eine Position ausrichtet, möchten Sie wahrscheinlich eine Alarmaufzeichnung auf der internen SD-Karte starten, um den Eindringling zu einzufangen. Dies kann durch Starten der manuellen Aufzeichnung über Ihr Hausautomationssystem und nach einer Verzögerung nach dem Stoppbefehl erfolgen. Aufgrund der einstellbaren Verzögerung ist die Länge des Alarmvideos frei wählbar (15s - 60s):
task/video/rec/start {"val":"15"}, {"val":"30"}, {"val":"45"}, {"val":"60"}
task/video/rec/stop {"val":"1"}
9. Interconnect your Cameras
Install your cameras so that they always keep an eye on each other by utilizing the Park Position that always returns your camera to a set position after it was moved. This prevents intruders from tampering with your cameras unseen.
When one camera detect a motion you can have it contact your home automation system using your camera's Alarmserver Function. You smarthome can then send a command to other cameras nearby to turn towards the position where the initial camera detected the intruder and start an alarm recording.
features/ptz/preset {"val":"0"} - {"val":"7"}
task/video/rec/start {"val":"15"}, {"val":"30"}, {"val":"45"}, {"val":"60"}
task/video/rec/stop {"val":"1"}
In this example both cameras look at each other - and keep an eye on what is happening behind the other camera. This position is stored as Position 1 (number=0) and set to be the Park Position. When the left camera detects something, the right one turns around towards the potential intruder - stored as Position 2-8 (number=1-7) - and starts a recording. And vice versa...
10. Scan for Noise Sources
For example, when triggering the audio detection on your camera, you probably do not know the location of the source of the noise. Here you can trigger a horizontal (hscan) or vertical (vscan) search scan. This must then be manually stopped again with the desired delay:
features/ptz/panscan {"val":"1"}
features/ptz/tiltscan {"val":"1"}
11. Manually deactivate all Alarm functions for all your Cameras
If you have activated more than one alarm trigger in your camera - PIR sensor, alarm areas, audio detection, alarm input - you can activate and deactivate them all at once via the alarm schedule without addressing each trigger individually:
alarm/schedule/master/sunday {"val":"NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN"} - {"val":"PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP"}
Set the alarm schedule for each day of the week from Monday through Sunday. Each P
is half an hour of the day the alarm schedule is active (48 x 30min = 24h). An N
equals a 30-minute period in which it is disabled. The schedule activates / deactivates all alarm actions.
12. Switch between PIR and Software Motion Detection
Most of our new cameras have both an internal, software-based motion detection and a hardware PIR (passive infrared) heat sensor to detect motion of objects that have a different surface temperature as the ambient. In most cases we recommend that you link both as they have different strengths and weaknesses and the coupling can filter many sources of false alerts.
But there are situation where one of those two ways to detect motion simply fails and does not provide any filtering effect anymore. Examples are:
- The PIR is exposed to direct sunlight through most of the day. Shadows and temperature changes trigger regular false alarms.
- The Motion Detection Areas are constantly triggered at night due to the light from passing cars.
- etc.
We can use our smarthome to automatically deactivate the problematic sensor during times where we know that their accuracy is affected. Since we probably want to use both sensors during times of the day when both work perfectly, we also have to switch the coupling on and off, accordingly.
Link between PIR and Alarm Areas
alarm/actions/pir/link {"val":"0"}, {"val":"1"}
Alarm Areas Activation / Deactivation
alarm/area1/enable {"val":"0"}, {"val":"1"}
alarm/area2/enable {"val":"0"}, {"val":"1"}
alarm/area3/enable {"val":"0"}, {"val":"1"}
alarm/area4/enable {"val":"0"}, {"val":"1"}
PIR Activation / Deactivation
alarm/actions/pir/enable {"val":"0"}, {"val":"1"}
Discuss this article on the INSTAR Forum !