Help build binding for Paradox Alarm Panel with IP150

Yep, it was about 30 min ago, so hopefully all good.

Just a thought. It would be nice if there was an MQTT command to disconnect/reconnect this from the IP150. Just in case OpenHAB stops responding for whatever reason and I need to default back to the Paradox App. I like to have fallback options… :wink:

Sounds like a good idea. I also need to work on general failure recovery mechanisms in the app.

Got it running as a daemon on the mac. I’ll put my Plist file on Github for anyone else who might need it.

Implemented the enable/disable of polling and pushed to github [also updated the readme over there]. This is actually quite useful now that I’ve implemented it!

I also introduced a state machine to better handle errors (especially the unknown ones).

I’m still getting error.

Attempting connection to MQTT Broker: 192.168.1.yyy:xxxx
Connected to MQTT Broker
Attempting connection to IP module: 192.168.1.yyy:xx
Connected with result code 0
 No connection to IP Module, are you already logged in? Attempting logout and trying again... (3)
Disconnect OK received from IP Module
No connection to IP Module, are you already logged in? Attempting logout and trying again... (2)
Disconnect OK received from IP Module
No connection to IP Module, are you already logged in? Attempting logout and trying again... (1)
Disconnect OK received from IP Module
No connection to IP Module, are you already logged in? Attempting logout and trying again... (0)
Failure, cannot connect
Last received data: 
HTTP/1.0 200 OK
Server: lwIP/1.4.0 (http://savannah.nongnu.org/projects/lwip)
Content-type: text/html
Cache-control: no-cache

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
<html>
<head>
	<meta http-equiv='content-type' content='text/html; charset=UTF-8' />
	<link rel='stylesheet' type='text/css' href='webstyles.css' />
	<title></title>
<script type='text/javascript'>function redirect(){var port="xxx";window.location = "https://" + window.location.hostname + ":" + port + window.location.pathname + window.location.search;} redirect();</script></head><body></body></html>
******************* Attempting to login again *******************

I have my http port xx redirect to an https port.
So if I connect via browser to the ip address of my IP150 to port xx it redirect to xxx and then I get the login page.
Really strange…

By the way, just downloaded from Github and replaced

Aha - you have https enabled in your IP module. Unfortunately I haven’t given any though for encrypted links yet so for now you need to manually log into the IP module, go to “IP150 Configuration” and click “No” next to the HTTPS port option. Then click save. Noting that whenever you log into the IP module your data will now not be encrypted, if that is a problem to you.

Ok, sorry. I wasn’t aware that with https was not working.
Now I’ve got it work and I can see my Alarm Name, Area Names and Zone Names.

The it says "Going to State_Machine 3, what does it mean?
And then “Connected and polling data every 0.5s”

What I don’t, and I can see in the script, is the state in a clear way, Arm, Disarm, Stay etc.

After this what can be done and how, if already implemented?

In the meantime, I thank you for the work you did. Very nice, even if I’m little bit afraid to leave the web panel without https…

You need to use the MQTT broker to subscribe to the data. On github I’ve documented the expected messages. The script doesn’t output much after being connected as I don’t want log files (screen prints /outputs) to unnecessarily cause writing to the disk; useful on installations running on an sd card.

Right.
Just tried with an MQTT client ant it’s working like a charm.
The siren, as you say in the documentation, gives me a question mark.

Very, very nice. Now i’m just a little bit worried about security.
With no https and MQTT don’t know if it’s secure, since it’s not a weather sensor or a light switch.
Probably you can understand me…
I saw there was another project on Github regarding IP150, but was much more complicated and for me that are just an user (maybe advanced), your project is fantastic.

Thanks
again

Hello folks,
I think that if the script is running on your internal (home) network you can stay quiet with HTTP protocol, but for sure HTTPS is better :slight_smile:
I’ve a IP100 module (there is only HTTP protocol), if you want I can try this solution.
Can I run the daemon on a Linux machine ? Is there a plan to build a OpenHAB binding ?

Thanks
Francesco

Hi Francesco

If you can test with the IP100 I’d appreciate it. I hope that Paradox has implemented the same Web interface, in which case it should work.

Regarding HTTPS, it doesn’t seem very difficult to implement in python, although the end user would need to install openssl as it’s a dependency. Will look into that later.

Hey, this sounds great and probably takes up a lot less resources than what I went through. I’ve been away for a while and not around again until next week, but i’ll for sure jump in and help out on this one.

Have you integrated it into OpenHAB yet? If so, I’d like to see the item if possible, I think we would need to do some transformation/REGEX on the incoming MQTT message to separate each zone with ON/OFF.

Regex will do the job. I have similar items from MQTT where REGEX is quite simple to use. Will send an example later today.

I couldn’t get REGEX to work with a transformation [to get the 1/0 to open/close] within an item alone, so easier for me was just to modify my code. There’s now a couple new items in the .ini file, one of which maps the 1 and 0 to open and close [or whatever you prefer]. You can then use this REGEX (using a contact) to update an item:

Contact myItem "testZone6 [%s]" {mqtt="<[RaspberryPI:Paradox/ZS/Z6:state:REGEX(S\\:(.*),P.*)]"}

I’ve not fiddled with the other message structures, however I believe the Alarm Status should be easily transformed with a simple .map file, something like:

Disarmed=OPEN Armed=CLOSED undefined=unknown

I’m a very lazy unit-tester so I hope there’s no obvious bugs added :innocent:

Link to code: https://github.com/Tertiush/ParadoxIP150

Thanks, I got all the Zones working. Had to change the REGEX slightly. My ITEM looks like:

Contact Alarm_Zone_2 "Alarm Lounge [%s]" {mqtt="<[mattsplace:/Paradox/ZS/Z2:state:REGEX(.*S\\:(.*),P.*)]"}

But it’s working great. Just got to do the changing of Alarm state control now. Thanks for your efforts.

Got it all working. For anyone else looking to tie into Openhab, these are my items. First is an individual zone:

Contact Alarm_Zone_1 "Alarm Lounge [%s]" {mqtt="<[mqttbroker:Paradox/ZS/Z1:state:REGEX(.*S\\:(.*),P.*)]"}

Next is the Alarm state:

String Alarm_State "House Status [%s]" {mqtt="<[mqttbroker:Paradox/AS/P1:state:default]"}

Then to control the alarm, i.e. Arm/Disarm:

Switch Alarm_Control_Arm "Full Arm Alarm" {mqtt=">[mqttbroker:Paradox/C/P1/Arm:command:ON:1],>[mqttbroker:Paradox/C/P1/Disarm:command:OFF:0]"} Switch Alarm_Control_Sleep "Sleep Arm Alarm" {mqtt=">[mqttbroker:Paradox/C/P1/Sleep:command:ON:1],>[mqttbroker:Paradox/C/P1/Disarm:command:OFF:0]"} Switch Alarm_Control_Stay "Stay Arm Alarm" {mqtt=">[mqttbroker:Paradox/C/P1/Stay:command:ON:1],>[mqttbroker:Paradox/C/P1/Disarm:command:OFF:0]"}

Then to control the polling of the IP150 in case you want to have something else connecting to the IP150 as it only allows 1 connection at a time:

Switch Alarm_Connect "Connect to alarm" {mqtt=">[mqttbroker:Paradox/C/Polling/Enable:command:ON:1],>[mqttbroker:Paradox/C/Polling/Disable:command:OFF:0]"}

It all seems to be working great! The only issue I’ve found is that it seems the OpenHAB GUI doesn’t respond as fast as the alarm zones activate and deactivate, so I might need to put some kind of rule to delay updates to the zones.

So, it would appear as if I found a way to talk on the software port! I quite literally just got my first successful reply so there’s been no real “development” of sorts, but the method seems proven. I plan to rewrite the entire script [replicate current functionality as a minimum] to use this port instead, which will mean we have full access to the PGMs and other goodies since we’re not limited to what the web interface exposes. Once done an Openhab binding would then just be a straight port of my code.

2 Likes

That’s cool! I’m not using PGM’s myself, but maybe it will allow multiple connections at a time.

Well done, this will open a new phase of my system! Got it working between IP150 to MQTT. Do not have OpenHab yet, will try eventually, for now bringing MQTT into Node-Red, with UI from same.

Q1: How do I work the PGM? I have one on my gate.

The topic published through the interface is:
Paradox/ZS/Z14 with a payload of S:CLOSED,P:1,N:“Gate_Garage”

I have tried sending Paradox/C/P1/Z14/OPEN and derivatives of this command, but not yet able to operate the PGM’s?