Smarthome Menu :: MQTT


param.cgi?cmd=getmqttattr

  • mq_enable: Enable MQTT Service [1, 0]
  • mq_broker: MQTT Broker/Client Mode [1, 0]
  • mq_host: MQTT Broker IP Address
  • mq_port: MQTT Broker Port
  • mq_portssl: MQTT Broker TLS Port
  • mq_ssl: MQTT Broker SSL Support
  • mq_insecure: Do not validate SSL certificate
  • mq_auth: MQTT Broker Authentication
  • mq_user: MQTT Broker Username
  • mq_pass: MQTT Broker Password
  • mq_prefix: MQTT Topic Prefix
  • mq_clientid: MQTT Camera Client ID
  • mq_lwt: Client Last-will topic
  • mq_lwmon: Client Last-will payload when online
  • mq_lwmoff: Client Last-will payload when offline

Example

GET: http://admin:instar@192.168.2.168/param.cgi?cmd=getmqttattr

cmd="getmqttattr";
mq_enable="0";
mq_broker="1";
mq_host="192.168.2.115";
mq_port="1883";
mq_portssl="8883";
mq_ssl="1";
mq_auth="1";
mq_user="admin";
mq_pass="instar";
mq_insecure="1";
mq_prefix="cameras";
mq_lwt="/lastwill";
mq_lwmon="alive";
mq_lwmoff="dead";
mq_clientid="115";
response="200";
GET: http://192.168.2.168/param.cgi?cmd=getmqttattr&user=admin&pwd=instar

cmd="getmqttattr";
mq_enable="0";
mq_broker="1";
mq_host="192.168.2.115";
mq_port="1883";
mq_portssl="8883";
mq_ssl="1";
mq_auth="1";
mq_user="admin";
mq_pass="instar";
mq_insecure="1";
mq_prefix="cameras";
mq_lwt="/lastwill";
mq_lwmon="alive";
mq_lwmoff="dead";
mq_clientid="115";
response="200";
SET: http://admin:instar@192.168.2.168/param.cgi?cmd=setmqttattr&mq_enable=0&mq_dispatcher=0&mq_host=192.168.2.117&mq_port=1883&mq_auth=1&mq_user=admin&mq_pass=instar&mq_prefix=instar&mq_clientid=camera123

cmd="setmqttattr";
response="200";

param.cgi?cmd=testmqtt

Test the Alarmserver

This command allows you to emit a alarmserver MQTT update to the configured MQTT Broker. The test will update two MQTT topics - one for the alarm trigger and a second for the detected object (if object detection is enabled)

Alarm Trigger

MQTT Topic: alarm/triggered

  • Alarm Area 1 triggered: &active=1 -> {"val":"1"}
  • Alarm Area 2 triggered: &active=2 -> {"val":"2"}
  • Alarm Area 3 triggered: &active=3 -> {"val":"3"}
  • Alarm Area 4 triggered: &active=4 -> {"val":"4"}
  • Alarm-In / PIR triggered: &active=5 -> {"val":"5"}
  • Audio Alarm triggered: &active=6 -> {"val":"6"}
  • PIR triggered & Alarm Area 1 triggered: &active=7 -> {"val":"7"}
  • PIR triggered & Alarm Area 2 triggered: &active=8 -> {"val":"8"}
  • PIR triggered & Alarm Area 3 triggered: &active=9 -> {"val":"9"}
  • PIR triggered & Alarm Area 4 triggered: &active=10 -> {"val":"10"}
  • Manual trigger (cmd=pushhostalarm): &active=99 -> {"val":"99"}

Detected Object

MQTT Topic: alarm/triggered/object

  • Person: &object=1 -> {"val":"1"}
  • Vehicles: &object=2 -> {"val":"2"}
  • Animals: &object=3 -> {"val":"3"}

Both topic will reset to {"val":"0"} 5 seconds after they were triggered.

Example

GET: http://admin:instar@192.168.2.168/param.cgi?cmd=testmqtt&active=5&object=3

cmd="testmqtt";
result="0";
response="200";
GET: http://192.168.2.168/param.cgi?cmd=testmqtt&active=5&object=3&user=admin&pwd=instar

cmd="testmqtt";
response="200";