Das Smarthome Menü :: MQTT
param.cgi?cmd=getmqttattr
mq_enable
: Enable MQTT Service [1,0]mq_broker_ws
: Enable MQTT over Websocket (WS) [1,0]mq_broker
: Use external MQTT Broker / Client Mode1
or internal broker0
[1,0]mq_host
: MQTT Broker IP Addressmq_port
: MQTT Broker Port, default1883
mq_broker_ws_port
: WS Broker Port, default1885
mq_portssl
: MQTT Broker TLS Port, default8883
mq_broker_ws_portssl
: WSS Broker TLS Port, default8885
mq_ssl
: MQTT Broker SSL Supportmq_broker_min_tls
: Minimum TLS version ['tlsv1.2','tlsv1.3']mq_qos
: MQTT Quality-of-Service, default1
[0-2]mq_insecure
: Do not validate SSL certificate [1,0]mq_auth
: MQTT Broker Authenticationmq_user
: MQTT Broker Usernamemq_pass
: MQTT Broker Password Note: The password can be SET but will not be returned in a GET request!mq_prefix
: MQTT Topic Prefixmq_clientid
: MQTT Camera Client IDmq_lwt
: Client Last-will topicmq_lwmon
: Client Last-will payload when onlinemq_lwmoff
: Client Last-will payload when offline
Example
GET: http://admin:instar@192.168.2.168/param.cgi?cmd=getmqttattr
cmd="getmqttattr";
mq_enable="1";
mq_broker="0";
mq_broker_ws="1";
mq_broker_ws_port="1884";
mq_broker_ws_portssl="8885";
mq_broker_min_tls="tlsv1.2";
mq_host="192.168.2.112";
mq_port="1883";
mq_portssl="8883";
mq_ssl="0";
mq_auth="1";
mq_user="admin";
mq_insecure="1";
mq_prefix="cameras";
mq_lwt="/connection";
mq_lwmon="online";
mq_lwmoff="offline";
mq_clientid="115";
mq_qos="1";
response="200";
GET: http://192.168.2.168/param.cgi?cmd=getmqttattr&user=admin&pwd=instar
cmd="getmqttattr";
mq_enable="1";
mq_broker="0";
mq_broker_ws="1";
mq_broker_ws_port="1884";
mq_broker_ws_portssl="8885";
mq_broker_min_tls="tlsv1.2";
mq_host="192.168.2.112";
mq_port="1883";
mq_portssl="8883";
mq_ssl="0";
mq_auth="1";
mq_user="admin";
mq_insecure="1";
mq_prefix="cameras";
mq_lwt="/connection";
mq_lwmon="online";
mq_lwmoff="offline";
mq_clientid="115";
mq_qos="1";
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";