1440p Web User Interface

Smarthome Menu

INSTAR MQTT Broker

All camera functions of your INSTAR Full HD camera can be controlled through the HTTP/S CGI interface. This is the interface that is used by the web user interface and all INSTAR smartphone apps. In the Smarthome and Internet-of-Things (IoT) realm there is another protocol that is widely in use and that offers a few advantages over the classical HTTP - the protocol is called MQTT. Adding an MQTT interface* to our Full HD cameras makes adding those cameras to an existing Smarthome - almost - too easy :)

Web User Interface - 1440p Series - Network MQTT

MQTT Settings
Description
Activate MQTTThe MQTT service is deactivated by default. Use this switch to start the broker.
Use external MQTT BrokerBy default the internal `127.0.0.1` broker is used. If you want to connect your camera to a different broker activate the option here and type in it`s address below.
MQTT Server addressLeave this value at `127.0.0.1` to use the internal broker. When you activated the option to use an external broker type in it`s address here.
MQTT Server PortThis is the port the MQTT broker uses to connect to clients without TLS encryption. The default value is `1883`
MQTT Server Port (SSL)This is the port the MQTT broker uses to connect to clients with TLS encryption. The default value is `8883`
AuthenticationAuthentication has to be active, if you are using your camera as broker. If you already use an external broker set up without user authentication you can deactivate it here.
UsernameType in the username you want to use to access the MQTT broker.
PasswordAdd the corresponding password here.
Download Client CertificateWhen you are using the TLS encryption for your MQTT network each client needs to have a client key to be allowed to connect to your broker. This key can be downloaded here.
Upload Server CertificateThe MQTT broker uses an official CA certificate for the TLS encryption - the same one that is used to connect with your camera using HTTPS. If you require a you can upload it here.

Web User Interface - 1440p Series - Network MQTT

MQTT Settings
Beschreibung
MQTT Topic PrefixSpecify a prefix that will be prepended to each camera topic. This is used to group MQTT devices in your network. For example, use "cameras" to put all cameras in one group. Or "garden/cams" to create further subgroups.
MQTT Client IDThe ID follows the prefix in the topic. For example, if you selected "garden/cams" above and the client ID here is 115 (the last number of the camera`s IP), then all MQTT topics for the camera will start with "garden/cams/115".
MQTT LWTThe Last Will and Testament of the camera. Under this topic, the camera stores both an "I am online" and an "I have no connection to the MQTT broker" value. If the camera`s "heartbeat" is missing for 60 seconds, the broker automatically changes the topic to the latter value.
MQTT LWT OnlineValue of the LWT when the camera has a connection to the broker.
MQTT LWT OfflineValue of the LWT when the camera has no connection to the broker.
Attention

The username and password may not contain more then 30 characters. The following special characters are currently supported: ! # ( ) * - . / ? @ [ ] ^ _ { | } <. The following special characters are not supported: ä ö ü ´ " ' , > ; ~ $ § % +

How to talk MQTT

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.

You can find an overview over all available MQTT topics and their Payload here.

Syntax

In order to send an MQTT command to the camera, an instar/ must first be prepended. To address exactly the right camera you now have 3 options. Either you use /local/ to address the camera on which the MQTT Broker is running. Or you can name a specific camera by its (LAN!) MAC address. For example, if the LAN MAC of your camera is 10:D1:DC:21:8F:96, then the MQTT ID of this camera is 10D1DC218F96 and the MQTT Topic must contain /10D1DC218F96/ to address the camera. And last but not least you have the possibility to address all cameras in the MQTT network at once via /all/:

  • instar/local/alarm/area1/enable
  • instar/10D1DC218F96/alarm/area1/enable
  • instar/all/alarm/area1/enable

After you have updated such a command topic, your camera will return a status topic to tell you that everything worked:

  • instar/local/alarm/area1/enable Command Topic
  • instar/local/status/alarm/area1/enable Status Topic

More information can be found in our MQTT Topics and Payloads Overview.

What Software can I use this with?

We are collecting an ever growing list of software that is compatible with the MQTT protocol. An easy way to get started are Dashboard and Testing applications that can be installed on your Android phone or under Windows or macOS:

  1. Android Apps for MQTT
  2. Windows and macOS Apps for MQTT

Both Android apps are simple dashboards that allow you to control your camera through the MQTT interface. In case of the desktop apps, they are used to test your connection to your camera, record interactions between your camera and client application and to debug your MQTT network.

You can also check the MQTT logon your camera to debug your setup. All error messages will be listed here:

http://Camera-IP/tmpfs/mqtt-log

Web User Interface - 1440p Series - Network MQTT

For compatible Smarthome Systems please check out our guides for :

  1. Home Assistant
  2. OpenHAB 2
  3. Athom Homey
  4. Android Apps
  5. Windows & macOS Apps
  6. Node-RED
  7. Homematic
  8. Loxone
  9. homee
  10. IOBroker
  11. FHEM

And more to follow...

Please read our FAQ if you want to use a self-signed SSL certificate for the INSTAR MQTT-Broker.

* Eclipse Mosquitto

The INSTAR MQTT Interface is build upon the Eclipse Mosquitto open source MQTT broker. The source code can be downloaded from Github and is available under the Eclipse Public License 2.0.

Mike Polinowski
MQTT Topic: Alarm Schedule
Firmware Update
Full HD Series
Mike Polinowski
INSTAR MQTT: Topic Added

Added missing topic for the alarm schedule:

Your camera has 2 alarm schedules - one that determines whether the alarm detection is armed or not and a back-up schedule of the setting you set. This way it is possible to manipulate the alarm schedule for a short time ("Snooze" function) and then restore it from the BackUp. The value displayed in the WebUI is always the BackUp schedule. If you make changes to the schedule via the MQTT API, you should accordingly always switch both schedules at the same time. This is now possible with the following topics:


  • alarm/schedule/dayoftheweek
  • alarm/schedule/dayoftheweek/webui

The latter is intended for the back-up schedule, which is used, among other things, for the display in the WebUI. And the value dayoftheweek is for the day of the week you want to adjust: monday, tuesday, wednesday, usw..