Qolsys IQ Panel 2 and 3rd party integration

The get status command to the panel will allow the panel to send you every sensor attached to the panel, so that would be one of the first steps in getting it to dynamically populate the sensors.

Yeah I realized that after I spent all that time :upside_down_face:. That’s OK, I needed it done… still figuring out how to listen on the websocket and feed data back to HA. I really like the MQTT sensors, so I’ll probably keep using that scheme.

I’ve made some really great progress using your script as a starting point @mzac. I have the socket open in a thread and can have it output as events happen, as well as feed events in. It’s kinda (very) poorly written right now but I should be able to share it soon. I’ve forked the repo and you can see current progress: https://github.com/roopesh/qolsys_client/tree/separate_socket

I was thinking about incorporating the entire MQTT sensor approach into the python script. Then it could run entirely independent (no more node-red). I make no promises on approach and I’m totally open to feedback. I am separating how data gets published from the panel as a callback function so this could be replaced with however you want to get the data. Hopefully I have something fully functioning and semi-solid by the weekend.

1 Like

This is great! I am really a beginner at Python so any improvements that can be made will be great. If it all works would you like to merge it back and I’ll create another release on Pypi? (Or I could make you a developer?)

BTW, in your MQTT section I would probably add options for username/password to connect to MQTT, and possibly also certificate/encryption options. What do you think?

Hey I just wanted to check in and say that I’ve had literally zero restart or communication problems by using Jason’s original Node Red flow from January 2nd. I know that’s anecdotal and not very helpful but I wonder what the differences are. All I’ve really done is:

  • Update my panel’s firmware fully (via Wifi)
  • Enabled the external API access
  • Implemented Jason’s flow according to the directions (which were a little thin but I got there :wink: ). It has been untouched and fully working since then. Even after a few reboots. If there are any communication problems happening I’m not noticing at all.

Thanks again everyone for the awesome work here. I’m trying to find some time to contribute.

So it seems like I might have figured out the arm away function where my panel would count down and then at 0, automatically arm stay.

I primarily use Home Bridge to pipe everything through to Apple home stuff, and when I would run the “arm away” function, I was already out of the house. This is key as I have the security system set to if a door isn’t opened after arming away, it will automatically change over to arm stay. To get around this, I added “delay”:0 to the command so that it instantly arms away. This works fine for me because when I use that function through Apple Homekit, I am already out of the house, so a door will not open at that point. If someone doesn’t have that setting enabled in the alarm panel, then I don’t think my same issue would apply to everyone, however I don’t remember if that is a customizable feature in the alarm or not.

One issue that I need to work out, I noticed it when my house cleaner left the other day, she armed the house through the panel, and Homekit immediately locked the door. lol. So I will need to do an arm away and see what the message is passed from the panel when it starts the countdown and what it says when the countdown is complete and adjust my flow accordingly.

Good catch. That option is enabled by default. It’s under Advanced Settings, Installation, Security and Arming, Auto Stay.

Ahh, that makes sense. Something to keep in mind if someone is trying to send an arm command to the panel. Any time that I would want to send an arm command to my panel from outside the Qolsys I don’t need the delay as I’m already out of the house.

@mzac I haven’t worried about MQTT security yet. Maybe in the future.

@Smwoodward I can’t seem to disarm the alarm via the socket. Have you been able to do it? If so, can you post your json message?

This works for me:

{
    "version": 1,
    "source": "C4",
    "partition_id": 0,
    "action": "ARMING",
    "arming_type": "DISARM",
    "nonce": "",
    "usercode": "xxxx",
    "token": "xxxxxx"
}

Took a few tries to get it right, and if you don’t get it right the panel doesn’t do anything, probably for security reasons. No error message or anything.

Thanks @dcaton. The usercode was missing :slight_smile: .

I can have the thread running listening to events quite easily now. With so much running in Python now, though, I’m feeling like I need to make this run in AppDaemon otherwise I’m not sure how/where it’ll run.

I just committed a basically working version of the python app. However, there’s no documentation yet.

Anyone here familiar enough with AppDaemon to run the python app in there?

Thanks for all your work on this so far, looking very promising. Is anybody woking on a installable plugin? Or are we just experimenting at this time?

Not sure what you mean by installable plugin-in. Since so much of the logic sits in python and I now have it fully functioning, I am going to try diving into AppDaemon to see if I can get it working there.

FYI there have been big changes to the python module on Pypi, we just pushed release 0.1.0 thanks to @crazeeeyez !!


3 Likes

Just wanted to thank you guys for your hard work. Really appreciate it.
The curl command has timed out a few times over the past couple of days even with the keep alive flag. It seemed to fail a bit more often as I added more panels into the flow. I’ll be trying out your qolsys-client python module soon @mzac
Does the python module support multiple panels?

So I’m still running into issues where my node-red daemon of OpenSSL command eventually the panel stops responding until a reboot. What’s odd is it’s not completely blocking it as the daemon does report back the connected 003 (or what ever the first line respond is). I’m not 100% sure when or anything else that it decides to take a poop and require a restart.

Anyone have an idea of things to try? My flow doesn’t send commands much to my panel so I’m at a bit of a loss.

I’m going to leave nodered open on my server with all of the daemon messages into debug. Maybe I can get the last messages sent from the process and see what they say.

I’ve seen the panel stop responding while I’m testing and opening connections repeatedly and/or sending improperly formatted commands. Not sure what trips it off, but I assume there’s some DOS mechanism in the panel to protect itself.

But it has never happened to me in normal running mode.

You’re using node-red-node-daemon to run OpenSSL? Is it up to date? Sometimes it would show “stopped” under the node even though OpenSSL was still running. Updated everything and I haven’t seen that since.

Yes there is IPTables running on the panel. If you look through this thread you’ll find the config that is on the panel that describes how they are blocking repeated connections.