Qolsys IQ Panel 2 and 3rd party integration

If anyone is interested developing this integration further and would like the decrypted IQ2 panel drivers PM me

I only wish I has the development knowledge to contribute, but I am really interested in this myself.

What are the drivers?

Is there a way to talk to you about node-red? I’m working to try and get the iq panel 2 to work with smart things also and need some help.

These are the IQ2 panel drivers for the C4 panel mentioned above. Currently that’s the only official IQ2 Integration. The drivers might be useful in writing an integration. The NodeRed solution works ok for listening, but there are a few things that could be improved. The flow will occasionally stop responding, require a NodeRed restart.

I’m using the NodeRed / HomeAssistant Integration. I don’t know a lot about NodeRed, I have it running well enough that it’s acceptable.

Are you using SmartThings with HomeAssistant or are you using SmartThings with NodeRed directly?

Thank you for all your work on this, y’all. I recently bought a house with this panel installed, and although I scoffed at it at first, it’s cool that this is all possible and I’m warming up to the idea of keeping it in place. After scouring through this thread I was able to get Jason’s flow working perfectly quite quickly.

Weirdly, I don’t seem to be having the same issues you did with the motion detector. I changed the Source like you said, but after checking Home Assistant I appear to have been getting signals from before that. I switched it back to S-Line and am still getting updates. I also didn’t use your newer version with the second fuction, but I seem to be getting normal behavior without it so I’ll leave it for now.

At this point, with the ability to monitor these devices, the panel is so close to being ACTUALLY useful… the final piece at this point would be to simply sideload the HA .apk to the device somehow… or even just default it to a web view that would show HA as the main interface… puts thinking cap on

I can’t find any results on Google about successfully using adb on this thing but I might give it a shot.

If you try to connect to https://ip_of_panel:8883 it’s requesting a certificate to connect.

I think I found the key to decrypt the driver.

So I was able to get into the driver, and the best that I can tell, the IQ panel 2 sends and receives commands over the 12345 port even from the C4 driver. I need some help from someone that can help me deconstruct the driver a bit more to understand how it sends the commands and potentially someone that can help develop a plugin for Home Assistant to directly connect and control the panel without Node-red.
------------Addition---------
So I think I’ve figured out a little more looking through the driver. I still haven’t figured out exactly what URL the commands are sent to, but it does appear that they are sent to https://ip_address:12345. The information that is sent to the IQ2 appears to be in a json format, and in the driver there are examples of the json information that is passed to the panel for actions but here is some relevant functions.

function ApplyQolsysFields(payload)
    payload[VERSION_KEY] = 1
    payload[SOURCE_KEY] = 'C4'
    payload[TOKEN_KEY] = Properties["Token"]
end

function RequestSummary(nonce)
    --'{"partition_id": 0, "action": "INFO", "info_type": "SUMMARY", "version": 0, "source": "C4"}'
    local ReqInfo = {}
    ReqInfo[NONCE_KEY] = nonce or ""
    ReqInfo[ACTION_KEY] = INFO_VAL
    ReqInfo[INFO_TYPE_KEY] = SUMMARY_VAL
    ApplyQolsysFields(ReqInfo)
    SendCommand(C4:JsonEncode(ReqInfo))
end

The RequestSummary function mirrors the other functions like sending an arming/disarming command. Now please excuse me in this, I am more of a sys admin and not a developer. In RequestSummary it looks like it builds an array called ReqInfo of information that needs to be passed to the IQ panel, then it gets passed to the ApplyQolsysFields to the ReqInfo array, this I believe is where it apply the “Token” that you obtain from the panel.

What I don’t know is how all of this would be formatted and sent (with curl?) to the panel to activate that function.

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.