INSTAR Deutschland GmbH

INSTAR MQTT Broker



The MQTT Interface

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 webUI and all INSTAR smartphone and desktop apps. But 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 classic HTTP - this protocol is called MQTT (Message Queuing Telemetry Transport). Adding an MQTT interface to our Full HD cameras makes adding those cameras to an existing Smarthome - almost - too easy :)

INSTAR MQTT Server

In MQTT you control your camera by publishing updates to MQTT Topics. The value you want to update such a topic to is formated in JSON and added to the Message Payload. So instead of sending a CGI command like param.cgi?cmd=setmdattr&-name=1&-enable=$val to either activate (val=1) or deactivate (val=0) Motion Detection Area 1 you publish this update to the topic alarm/area1/enable formated like {val:1} or {val:0}.

Addressing the right Camera

To make sure that this update is received by the correct device on your MQTT network, we first have to prefix the topic with instar - this makes sure that your camera will try to match the update to an internal function - like updating the state of an detection area. Secondly, we have to state what camera we want to address by either saying all to update all INSTAR cameras on your network or picking a specific one by it's MAC address, e.g. 000389888811. You can find the MAC address of your camera under System/Overview - simply remove the colons, e.g. 00:03:89:88:88:11.

INSTAR MQTT Server

If you want to address the camera that is running your MQTT broker, you can also use the prefix local instead. The complete topic will then look like this:

  • instar/all/alarm/area1/enable - to address all INSTAR Full HD cameras on your MQTT network (all have to be connected to the same MQTT broker).
  • instar/000389888811/alarm/area1/enable - to address a camera with the (LAN) MAC address 00:03:89:88:88:11.
  • instar/local/alarm/area1/enable - to address the cameras that runs the MQTT broker on your network.

You can find the allowed payloads for each MQTT topic in the table below. The second table below that displays the corresponding CGI command to each topic (if you are already familiar with the HTTP API and are looking for a specific command).

Status, Command or Raw Topics

Once you update a COMMAND Topic like instar/000389888811/alarm/area1/enable you will see that you receive an update on the STATUS Topic instar/000389888811/status/alarm/area1/enable once you camera received the command and updated its settings.

INSTAR MQTT Server

If your application doesn't support sending command payloads in the JSON format, you can use the RAW Topic by adding raw to the end of the topic and use the value as a string directly:

  • instar/000389888811/alarm/area1/enable/raw - the message payload here is simply either 1 or 0 instead of {val:1} or {val:0}.

Update your first MQTT Topic

To update a topic you can use a desktop software like the MQTT Explorer or MQTT.fx for Windows, macOS or LINUX. Or one of the many available Smartphone Apps. These allow you to try out the MQTT API without the need of additional Hardware (Smarthome Gateways) and quickly debug your MQTT network.

Configure and Test your MQTT Broker


INSTAR MQTT Server
Home Assistant


MQTT Topics and Message Payloads


MQTT Topic
MQTT Payload
Category: Network
network/config/dhcp{"val":"on"}, {"val":"off"}
network/config/ipaddr{"val":"192.168.178.23"}
network/config/netmask{"val":"255.255.255.0"}
network/config/gateway{"val":"192.168.178.1"}
network/config/dns{"val":"192.168.178.1"}
network/config/http{"val":"80"}
network/config/https{"val":"443"}
network/config/rtspauth{"val":"1"}, {"val":"0"}
network/config/rtspport{"val":"554"}
network/config/rtmpport{"val":"1935"}
network/remote/instarddns{"val":"1"}, {"val":"0"}
network/remote/otherddns{"val":"1"}, {"val":"0"}
network/remote/instarp2p{"val":"1"}, {"val":"0"}
network/upnp/enable{"val":"1"}, {"val":"0"}
network/onvif/enable{"val":"1"}, {"val":"0"}
network/onvif/auth{"val":"1"}, {"val":"0"}
network/onvif/timeset{"val":"1"}, {"val":"0"}
network/onvif/port{"val":"8080"}
Category: Multimedia
Category: Features
Category: Alarm
Category: Tasks
Category: System


MQTT Topic to CGI Command Mapping


MQTT Topic
CGI Command
Category: Network
network/config/dhcpparam.cgi?cmd=setnetattr&-dhcp=${val}
network/config/ipaddrparam.cgi?cmd=setnetattr&-ipaddr=${val}
network/config/netmaskparam.cgi?cmd=setnetattr&-netmask=${val}
network/config/gatewayparam.cgi?cmd=setnetattr&-gateway=${val}
network/config/dnsparam.cgi?cmd=setnetattr&-fdnsip=${val}
network/config/httpparam.cgi?cmd=sethttpport&-httpport=${val}
network/config/httpsparam.cgi?cmd=sethttpsport&-httpsport=${val}
network/config/rtspauthparam.cgi?cmd=setrtspauth&-rtsp_aenable=${val}
network/config/rtspportparam.cgi?cmd=setrtspport&-rtspport=${val}
network/config/rtmpportparam.cgi?cmd=setrtmpattr&-rtmpport=${val}
network/remote/instarddnsparam.cgi?cmd=setourddnsattr&-our_enable=${val}
network/remote/otherddnsparam.cgi?cmd=set3thddnsattr&-d3th_enable=${val}
network/remote/instarp2pcmd=setsmartp2pattr&-smartp2p_enable=${val}
network/upnp/enableparam.cgi?cmd=setupnpattr&-upm_enable=${val}
network/onvif/enableparam.cgi?cmd=setonvifattr&-ov_enable=${val}
network/onvif/authparam.cgi?cmd=setonvifattr&-ov_authflag=${val}
network/onvif/timesetparam.cgi?cmd=setonvifattr&-ov_forbitset=${val}
network/onvif/portparam.cgi?cmd=setonvifattr&-ov_port=${val}
Category: Multimedia
Category: Features
Category: Alarm
Category: Tasks
Category: System


Compatible Software


Android
Home Assistant
OpenHAB2
Node-RED
OpenHAB2
HomeMatic
IOBroker
Loxone
homee
FHEM