How to Arm or disarm the SecPanel using Mqtt

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!
Post Reply
User avatar
Antori91
Posts: 82
Joined: Sunday 12 February 2017 18:12
Target OS: NAS (Synology & others)
Domoticz version: 4.97&3.5
Location: France
Contact:

How to Arm or disarm the SecPanel using Mqtt

Post by Antori91 » Monday 06 August 2018 15:39

Hello

To get the Security Panel Status, we have this JSON API : 'json.htm?type=command&param=getsecstatus'. Using Mqtt, I found that this command works {"command": "getdeviceinfo", "idx": 1} where 1 is the Security Panel device number (at least in my environment).

But, is it possible to arm and disarm the Security Panel using a Mqtt message as we can do it using JSON API like
'json.htm?type=command&param=setsecstatus&secstatus=0&seccode=-------------'
or 'json.htm?type=command&param=setsecstatus&secstatus=2&seccode=-------------'
Domoticz High Availability Cluster: Synology Dz V3.5877 (Main) - Raspberry Dz V4.97 (Backup) - Scripts Node.js
Alarm server: Raspberry - motionEye - iot_ALARM-SVR Node.js
Sensors/Actuators: ESP8266-Arduino
https://github.com/Antori91/Home_Automation

SweetPants
Posts: 2167
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V4.9866
Location: The Netherlands
Contact:

Re: How to Arm or disarm the SecPanel using Mqtt

Post by SweetPants » Tuesday 07 August 2018 8:34

I don't think so. There is also no MQTT message on domoticz/out when "arm home/arm away/disarm" is set. I'm also not sure if the sec panel uses an idx as you state. The output of 'json.htm?type=command&param=getsecstatus' is:

{
"secondelay" : 10,
"secstatus" : 1, (0 = Disarm, 1 = Arm Home, 2 = Arm Away)
"status" : "OK",
"title" : "GetSecStatus"
}

so no idx.
Ubuntu 16.04.3 LTS, Intel NUC, MySensors 2.3.0-alpha, Pro Mini 3.3/8M RFM69(HW), ESP8266 (SDK2.2.0), Sonoff, RFLink, RFXcom, MQTT, NodeRed, Domoticz Beta (from source)

User avatar
Antori91
Posts: 82
Joined: Sunday 12 February 2017 18:12
Target OS: NAS (Synology & others)
Domoticz version: 4.97&3.5
Location: France
Contact:

Re: How to Arm or disarm the SecPanel using Mqtt

Post by Antori91 » Tuesday 07 August 2018 9:44

Hello SweetPants,

Thanks for your answer.

Regarding SecStatus using Mqtt, I'm definitely sure it works. I use it like this in a new module I wrote a few weeks ago. I receive the following answer from Domoticz when I send {"command": "getdeviceinfo", "idx": 1} >>>
[Tue Aug 07 2018 10:55:17 GMT+0200 (CEST) Alarm-Mqtt_RX] {
"Battery" : 255,
"RSSI" : 12,
"dtype" : "Security",
"id" : "148702",
"idx" : 1,
"name" : "Security Panel",
"nvalue" : 0,
"stype" : "Security Panel",
"switchType" : "On/Off",
"unit" : 0
}

Take a look in the device list and you will see that the SecPanel has an idx.
Attachments
Capture.JPG
Capture.JPG (51.9 KiB) Viewed 97 times
Domoticz High Availability Cluster: Synology Dz V3.5877 (Main) - Raspberry Dz V4.97 (Backup) - Scripts Node.js
Alarm server: Raspberry - motionEye - iot_ALARM-SVR Node.js
Sensors/Actuators: ESP8266-Arduino
https://github.com/Antori91/Home_Automation

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests