Qolsys IQ Panel 2 and 3rd party integration

Sending json with curl is easy, not sure if we need post or put or get:

curl -k -X POST \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
-d '{"partition_id": 0, "action": "INFO", "info_type": "SUMMARY", "version": 0, "source": "C4"}' \
https://<panel ip>:12345

Gotcha, now how would the ApplyQolsysFields function be added to that JSON -d line?

That is a function that it is calling above

Once I add that information I can play around with my alarm panel and see if I can get it arm or something.

1 Like

Correct, and it looks like it adds the

payload[version_key]
payload[source-key]
payload[token_key]

to the json you sent on the -d line, and that’s what I don’t know how to format.

Those might be headers in the html request so use the example for the json above and add headers, but we would need to know what to put there…

It looks like verson_key and source_key are static

payload[VERSION_KEY] = 1
payload[SOURCE_KEY] = ‘C4’

I am assuming the payload[TOKEN_KEY] = Properties[“Token”] would be the token that I get from the IQ2 panel. The “Token” value equals some config/properties that I’m seeing in the xml file inside DriverEditor.

ok, so I tried this, and it just went into the curl where the alarm will send me information on the events.

curl -k --http0.9 -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"partition_id": 0, "action": "ARMING", "arming_type": "ARM_STAY", "version": 0, "usercode": "<mycode>", "source": "C4", "VERSION_KEY": 1, "SOURCE_KEY": 'C4', "TOKEN_KEY": "<mytoken>"}' https://<ipaddress>:12345

any ideas?

Right… I just remembered that port 12345 is a websocket so sending data on the curl cli probably won’t do anything. Try pasting in the json text once you are connected.

Gotcha. I didn’t know you could paste into curl. Lol.

I’ll try that in a few.

I tried several variations of some of the json code while the curl was running and nothing happened. Unfortunately I don’t know enough of how and what curl does to know what to test from there.

I’m definitely interested in seeing the decrypted driver code.

Not using HA at the moment (although that will probably change soon).

Based on info in this thread, I’ve got a node-red flow reading status info from my panel and updating the mode in Hubitat. Would definitely like to try and figure out full 2 way control via this interface, particularly with the zwave system in the alarm panel.

Can’t PM, guess my account here is too new.

Something that I’ve also found that might help keep the panel from needing to be rebooted every day to keep node-red working is to add --keepalive-time 30 to the curl command. It appears that the C4 driver uses a keepalive of 30 seconds on the connection.

One other thing that I’ve noticed in the drivers, I don’t think there is any zwave control through the API, it appears to only be control of the alarm and status of the sensors. Part of the status of the sensors is to request information from the panel which could be used to dynamically build which sensors are on the device and what type of sensors they are, but I don’t see anything in the driver for anything zwave other than a category for a zwave siren.

Now that is not to say that Qolsys hasn’t put that functionality into their API, but the C4 driver doesn’t send any zwave device commands.

-Edit-
Good news guys, I was able to get the panel to accept commands an arm from the connection. I will post more information later.

I was able to send an action:info info_type: summary and got this back.

{“event”:“INFO”,“info_type”:“SUMMARY”,“partition_list”:[{“partition_id”:0,“name”:“partition1”,“status”:“DISARM”,“secure_arm”:false,“zone_list”:[{“id”:“A634A3”,“type”:“Door_Window”,“name”:“Front Door”,“group”:“entryexitdelay”,“status”:“Closed”,“state”:“0”,“zone_id”:1,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:1,“partition_id”:0},{“id”:“83B7A6”,“type”:“Door_Window”,“name”:“Back Door”,“group”:“entryexitdelay”,“status”:“Closed”,“state”:“0”,“zone_id”:2,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:1,“partition_id”:0},{“id”:“B4DDAE”,“type”:“Door_Window”,“name”:“Laundry Door”,“group”:“entryexitdelay”,“status”:“Closed”,“state”:“0”,“zone_id”:3,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:1,“partition_id”:0},{“id”:“3B8FA1”,“type”:“Door_Window”,“name”:“Den Door”,“group”:“entryexitdelay”,“status”:“Closed”,“state”:“0”,“zone_id”:4,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:1,“partition_id”:0},{“id”:“46A5A4”,“type”:“Door_Window”,“name”:“Dining Room Window 1”,“group”:“instantperimeter”,“status”:“Closed”,“state”:“0”,“zone_id”:5,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:1,“partition_id”:0},{“id”:“07CBA9”,“type”:“Door_Window”,“name”:“Dining Room Window 2”,“group”:“instantperimeter”,“status”:“Closed”,“state”:“0”,“zone_id”:6,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:1,“partition_id”:0},{“id”:“8CA8AD”,“type”:“Door_Window”,“name”:“Den Window 1”,“group”:“instantperimeter”,“status”:“Closed”,“state”:“0”,“zone_id”:7,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:1,“partition_id”:0},{“id”:“B42BA0”,“type”:“Door_Window”,“name”:“Den Window 2”,“group”:“instantperimeter”,“status”:“Closed”,“state”:“0”,“zone_id”:8,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:1,“partition_id”:0},{“id”:“4C25AA”,“type”:“Door_Window”,“name”:“Den Window 3”,“group”:“instantperimeter”,“status”:“Closed”,“state”:“0”,“zone_id”:9,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:1,“partition_id”:0},{“id”:“A7F4AB”,“type”:“Door_Window”,“name”:“Kitchen Window”,“group”:“instantperimeter”,“status”:“Closed”,“state”:“0”,“zone_id”:10,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:1,“partition_id”:0},{“id”:“87F7A0”,“type”:“Door_Window”,“name”:“Cooper’s Window”,“group”:“instantperimeter”,“status”:“Closed”,“state”:“0”,“zone_id”:11,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:1,“partition_id”:0},{“id”:“00FFA1”,“type”:“Door_Window”,“name”:“Hannah’s Window 1”,“group”:“instantperimeter”,“status”:“Closed”,“state”:“0”,“zone_id”:12,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:1,“partition_id”:0},{“id”:“8CBFA4”,“type”:“Door_Window”,“name”:“Hannah’s Window 2”,“group”:“instantperimeter”,“status”:“Closed”,“state”:“0”,“zone_id”:13,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:1,“partition_id”:0},{“id”:“C72EAF”,“type”:“Door_Window”,“name”:“Master Bath Window”,“group”:“instantperimeter”,“status”:“Closed”,“state”:“0”,“zone_id”:14,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:1,“partition_id”:0},{“id”:“09CCA8”,“type”:“Door_Window”,“name”:“Master Bedroom Window”,“group”:“instantperimeter”,“status”:“Closed”,“state”:“0”,“zone_id”:15,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:1,“partition_id”:0},{“id”:“98B2AE”,“type”:“Door_Window”,“name”:“Living Room Window 1”,“group”:“instantperimeter”,“status”:“Closed”,“state”:“0”,“zone_id”:16,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:1,“partition_id”:0},{“id”:“6FD5A8”,“type”:“Door_Window”,“name”:“Living Room Window 2”,“group”:“instantperimeter”,“status”:“Closed”,“state”:“0”,“zone_id”:17,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:1,“partition_id”:0},{“id”:“0”,“type”:“Bluetooth”,“name”:“Michael’s iPhone”,“group”:“mobileintrusion”,“status”:“Closed”,“state”:“0”,“zone_id”:18,“zone_physical_type”:1,“zone_alarm_type”:1,“zone_type”:115,“partition_id”:0},{“id”:“996B2C”,“type”:“SmokeDetector”,“name”:“Smoke Detector 1 Smoke D”,“group”:“smoke_heat”,“status”:“Closed”,“state”:“0”,“zone_id”:19,“zone_physical_type”:9,“zone_alarm_type”:9,“zone_type”:5,“partition_id”:0},{“id”:“BCA327”,“type”:“SmokeDetector”,“name”:“Smoke Detector 2 Smoke D”,“group”:“smoke_heat”,“status”:“Closed”,“state”:“0”,“zone_id”:20,“zone_physical_type”:9,“zone_alarm_type”:9,“zone_type”:5,“partition_id”:0},{“id”:“855122”,“type”:“SmokeDetector”,“name”:“Smoke Detector 3 Smoke D”,“group”:“smoke_heat”,“status”:“Closed”,“state”:“0”,“zone_id”:21,“zone_physical_type”:9,“zone_alarm_type”:9,“zone_type”:5,“partition_id”:0},{“id”:“SWG1”,“type”:“Panel Glass Break”,“name”:“Panel Glass Break”,“group”:“glassbreakawayonly”,“status”:“Closed”,“state”:“0”,“zone_id”:22,“zone_physical_type”:1,“zone_alarm_type”:0,“zone_type”:116,“partition_id”:0},{“id”:“0”,“type”:“Bluetooth”,“name”:“Heather’s iPhone”,“group”:“mobileintrusion”,“status”:“Closed”,“state”:“0”,“zone_id”:23,“zone_physical_type”:1,“zone_alarm_type”:1,“zone_type”:115,“partition_id”:0},{“id”:“SWPM1”,“type”:“Panel Motion”,“name”:“Panel Motion”,“group”:“safetymotion”,“status”:“Closed”,“state”:“0”,“zone_id”:25,“zone_physical_type”:1,“zone_alarm_type”:3,“zone_type”:2,“partition_id”:0}]}],“nonce”:"",“requestID”:“77677d4c-51c3-4433-83cf-d3c8e9b99ddb”}
—Edit—
First I used openssl s_client -host 192.168.7.1 -port 12345 as the command to open up the session. All of the same information that comes in on curl shows up in this command.

Next you need to get your token from your panel, and these are the JSON strings that are used.

{“partition_id”:0,“action”:“ARMING”,“arming_type”:“ARM_STAY”,“version”:0,“nonce”:"",“source”:“C4”,“version_key”:1,“source_key”:“C4”,“token”:""}

{“nonce”:"",“action”:“INFO”,“info_type”:“SUMMARY”,“version”:0,“source”:“C4”,“token”:""}

{“partition_id”:0,“action”:“ARMING”,“arming_type”:“ARM_AWAY”,“version”:0,“nonce”:"",“source”:“C4”,“version_key”:1,“source_key”:“C4”,“token”:""}

{“partition_id”:0,“action”:“ARMING”,“arming_type”:“DISARM”,“version”:0,“nonce”:"",“source”:“C4”,“version_key”:1,“source_key”:“C4”,“token”:""}

I’m fairly sure that “source” can be changed, I just kept it in there for simplicity for now.

There are also commands to send an alarm from the API and there might be other things but C4 doesn’t use them. Additionally here is some tables that were used that can also help out with things.

QolsysZoneTypes = {

UNKNOWN = 0,

CONTACT = 1,

MOTION = 2,

SOUND = 3 ,

BREAKAGE = 4,

SMOKE_HEAT = 5,

CARBON_MONOXIDE = 6,

RADON = 7,

TEMPERATURE = 8,

PANIC_BUTTON = 9,

CONTROL = 10,

CAMERA = 11,

LIGHT = 12,

GPS = 13,

SIREN = 14,

WATER = 15,

TILT = 16,

FREEZE = 17,

TAKEOVER_MODULE = 18,

GLASSBREAK = 19,

TRANSLATOR = 20,

MEDICAL_PENDANT = 21,

WATER_IQ_FLOOD = 22,

WATER_OTHER_FLOOD = 23,

IMAGE_SENSOR = 30,

WIRED_SENSOR = 100,

RF_SENSOR = 101,

KEYFOB = 102,

WALLFOB = 103,

RF_KEYPAD = 104,

PANEL = 105,

WTTS_OR_SECONDARY = 106,

SHOCK = 107,

SHOCK_SENSOR_MULTI_FUNCTION = 108,

DOOR_BELL = 109,

CONTACT_MULTI_FUNCTION = 110,

SMOKE_MULTI_FUNCTION = 111,

TEMPERATURE_MULTI_FUNCTION = 112,

SHOCK_OTHERS = 113,

OCCUPANCY_SENSOR = 114,

BLUETOOTH = 115,

PANEL_GLASS_BREAK = 116,

POWERG_SIREN = 117,

BLUETOOTH_SPEAKER = 118,

PANEL_MOTION = 119,

ZWAVE_SIREN = 120,

COUNT = 121 }


VERSION_KEY = ‘version’

SOURCE_KEY = ‘source’

PARTITION_KEY = ‘partition_id’

ACTION_KEY = ‘action’

ARMING_VAL = ‘ARMING’

INFO_VAL = ‘INFO’

INFO_TYPE_KEY = ‘info_type’

ZONE_EVENT_VAL = ‘ZONE_EVENT’

ARMING_TYPE_KEY = ‘arming_type’

ZONE_EVENT_TYPE_KEY = ‘zone_event_type’

DISARM_VAL = ‘DISARM’

ARM_AWAY_VAL = ‘ARM_AWAY’

ARM_STAY_VAL = ‘ARM_STAY’

SUMMARY_VAL = ‘SUMMARY’

PARTITION_LIST_KEY = ‘partition_list’

PARTITION_STATUS_KEY = ‘status’

SCOPE_KEY = ‘scope’

EVENT_KEY = ‘event’

ID_KEY = ‘id’

ZONE_KEY = ‘zone’

ZONE_ID_KEY = ‘zone_id’

ZONE_LIST_KEY = ‘zone_list’

ZONE_STATUS_KEY = ‘status’

ZONE_OPEN_VAL = ‘Open’

ZONE_CLOSED_VAL = ‘Closed’

ZONE_ACTIVE_VAL = ‘Active’

ZONE_ACTIVATED_VAL = ‘Activated’

ZONE_IDLE_VAL = ‘Idle’

ZONE_NORMAL_VAL = ‘Normal’

ZONE_NAME_KEY = ‘name’

ZONE_TYPE_KEY = ‘zone_type’

ALARM_VAL = ‘ALARM’

ALARM_TYPE_KEY = ‘alarm_type’

EXIT_DELAY_KEY = ‘exit_delay’

ENTRY_DELAY_KEY = ‘entry_delay’

DELAY_KEY = ‘delay’

USERCODE_KEY = ‘usercode’

FIRE_VAL = ‘FIRE’

POLICE_VAL = ‘POLICE’

AUX_VAL = ‘AUXILIARY’

TOKEN_KEY = ‘token’

ERROR_TYPE_KEY = ‘error_type’

NONCE_KEY = ‘nonce’

BYPASS_KEY = ‘bypass’

DESCRIPTION_KEY = ‘description’

CODE_REQUIRED = ‘code_required’

SECURE_ARM_KEY = ‘secure_arm’

VALUE_KEY = ‘value’

2 Likes

I’m particularly interested to hear if that keep alive command helps. What’s the full curl command that you are putting in Node-Red?

I’m curious about using the motion sensor and camera on the panel, if it’s possible. It does look like a lot of those inputs are arm/disarm related.

Another small quirk is that the weather on the panel only updates once daily. I would like to update it hourly at a minimum, but I don’t think there is anything here that relates to that.

Currently it’s curl -kN --keepalive-time 30 --http0.9 https://xxxxxx:12345, however to get two way communication I used openssl s_client -host xxx.xxx.xxx.xxx -port 12345. I haven’t used OpenSSL yet in node red.

Part of those sensors are likely to be related to how the sensor is programmed. If I’m not mistaken you can program a motion sensor to act like a door/window sensor if you are looking at using it as a sensor to control devices. Now there is a command that you can send the panel to request all of the sensors associated with the panel. This is would be used to populate the sensors into home assistant and if a new sensor is added it would automatically show up in HA.

So far the only commands that I’ve seen that can be sent to the panel is arm (stay/away, bypass delay), request info, disarm, and panic. There might be more commands, however the C4 drivers do not expose any of those commands beyond what I found above, and likely won’t know any additional commands unless qolsys shares their api. With that said, it might be likely to take the qolsys alarm panel and stuff it somewhere and use some sort of other tablet for alarm control that the weather could be updated more frequently.

I plan to try and develop a true plugin/integration for home assistant that polls locally for sensor status and controls the alarm locally vs needing alarm.com integration.

My node-red flow has been running for a few days now and It’s still working fine with no keep alive.

curl -kN --http0.9 https://10.0.0.199:12345

Bummer. I need that more than I need the alarm state, although that’s certainly helpful.

Hubitat’s z-wave implementation is buggy and it doesn’t work as a secondary z-wave controller despite it being a documented feature. And they have no interest in even looking at the problem. Don’t want to hijack this thread, but I was going to install HA and see if it will work as a secondary z-wave controller to the QolSys IQ2+.

You’d think that if Control4 created an integration to the panel, they would also integrate with the z-wave system. Wonder if there’s another interface on the QolSys for this, or Control4 acts as a secondary and integrates that way.

The features that the iq 2 panel has for zwave is very limited it seems to me and the control from outside the panel is not known if it’s possible right now.

Best bet would possibly have HA do all of the zwave and automation control and have all of the zwave devices paired to it and once a plugin is developed to tie into HA let it handle the security sensors and alarm functions with HA being the dashboard.

Again there might be zwave control through the connection, but C4 doesn’t use it and there is no functions inside the code for zwave control. It’s possible that Qolsys doesn’t have that function, but without their api it will take reversing their firmware to discover that.

By itself, yes it is. But with alarm.com integration you get a good deal of automation and the z-wave radio in the QolSys is rock solid. The only thing you don’t get is the ability to create rules with conditionals, loops, etc. The QolSys cannot operate as a secondary though, it must be the primary or else you will not be able to use any alarm.com-based automation.

Also, I’m using the alarm .com thermostats and remote temp sensors. Although they’re z-wave, they have functionality that is only exposed via alarm.com. Might be possible to reverse engineer it, but I’d rather keep the QolSys as the primary z-wave controller for its stability and reliability, and just add a secondary for the few cases where I need more complex rules to control my z-wave devices.

Another reason I want to keep the QolSys z-wave system is that if a smoke alarm goes off, it will shut down the HVAC system automatically. I would not trust a feature like that to any home automation system. Also, I have water sensors connected to the alarm panel (not z-wave) and it can also turn off a z-wave based water shutoff valve. Again, too important for me to trust a ha system with critical functionality like this.