Skip to content
e-mcgee edited this page Feb 9, 2019 · 31 revisions

Paradox alarm homebridge platform

I have tested on my Paradox MG5050 v4 and IP100. It also seems to work with IP150.

The code is based on Tertiush Python scripts, code I adopted from a Raspberry Pi Garage Door Opener, as well as several sample homebridge accessories/platforms I could find.

The platform requires homebridge version 0.4.36 or higher.

Please assist me in maintaining by donating to: paypal

The new version finally supports 2 partitions. I found a way to read the second partition state. The config.json file now requires 2 alarm accessories. These include the name and partition number. If the second partition is not implemented, use "inactive" as its name so that it is not loaded into homebridge. See the updated sample config.json file.

I added a switch control accessory to the Paradox platform to control connection status to the alarm. This is useful if you want to connect to the alarm with other apps such as iParadox or the Web page. You simply toggle the switch to control logged in status.

The platform works on the principle that it logs into the alarm and then reads events received from the alarm to set the zone and alarm status. In addition it polls the alarm a configurable number of seconds to explicitly read the status of the alarm and zones and set them accordingly. This poll delay is configurable. If the states are received correctly, HomeKit is updated with the new status values and if configured the status values are published to a MQTT broker. The platform remains logged in to the alarm and maintains the login should it fail. The continuous login ensures quick response of the alarm which is especially important for PGM operation as well as the received events.

The Paradox alarm only allows one process to login so once logged in, the platform blocks all other apps from accessing the alarm. Should you temporarily want to use something else (e.g. iParadox) simply use the switch control to disable the platform login to the alarm. The switch control will indicate the communication status with the alarm. Simply reconnect after use of the other application by toggling the switch.

The platform supports the following paradox accessories:

  1. The alarm (2 partition).
  2. Contact sensor.
  3. Motion sensor.
  4. Smoke Sensor.
  5. PGM's (modelled as a garage door opener).

It currently supports 2 partition, and 32 zones. Contact and Motion sensors are directly mapped to similar zones and can be named. They will appear in HomeKit with these names.

Gate openers require a contact sensor zone to indicate whether the door is open or closed.

I added a software debounce feature for all zones. I found on my garage door and gate that I would get a bouncing state at the moment of open or close with the new event driven state change. So I added a configurable debounce period per zone where once a state change is noticed all changes during the debounce period will be ignored.

Platform configuration

The platform config items are:

  1. "platform": "<Platform name e.g. Paradox>",
  2. "ip": "<x.x.x.x>",
  3. "port": (this is normally 10000),
  4. "password": "<your alarm password>".

These should be obvious and will need to match your setup.

The platform also allows the configuration of all the delays between commands you can tune for your specific setup. The following are available with their defaults (time in milliseconds):

  1. "logindelay": 3800 this is the time it takes to login to the alarm in total.
  2. "polldelay": 5000 this is the time between zone and alarm status reads.
  3. "waitafterlogin": 600 this is the time the plugin waits after login before new commands should be sent.
  4. "delaybetweencmds": 250 this is the time the plugin waits between sending commands to the alarm.
  5. "logoutdelay": 500 this is the time the plugin waits after sending the logout command.
  6. "logindelayafterreconnect": 1000 this is the time the plugin waits after it logged back in (used with disconnect switch and when link to alarm is lost).

Platform MQTT configuration

The platform also supports monitor of status of zones and alarm partitions in MQTT. This is very useful if you want to integrate with other MQTT enabled systems and in particular if you use Node-RED. The following MQTT configuration items are available for the platform (see sample config.json):

  1. "mqtt": true|false - determines if MQTT is used or not
  2. "mqtturl": "mqtt://<url>" - the URL to your MQTT broker
  3. "qos": 0|1|2 - the required MQTT quality of service
  4. "retain": true|false - MQTT persistence configuration
  5. "mqttusername": "user" - The MQTT Username for your MQTT broker
  6. "mqttpassword": "password" - The MQTT Password for your MQTT broker

If MQTT is enabled each accessory needs an added config item which is the MQTT Topic that it will publish the status of the accessory to your broker. This topic can be subscribed to in order to use for integration. Each accessory is required the following:

"topic": "<MQTT Topic to publish to>"

The config for the various accessories on the platform are configured in the your config file.

Alarm

It models the HomeKit Security system. The config items are:

  1. "name": "<Alarm_Partition_1|2>"
  2. "type": "Alarm",
  3. "partition": 0|1
  4. "topic": "<MQTT Topic to publish to>"

There must be two Alarms configured, one for each partition. If you are not using the second partition simply call it "inactive" so that it is not loaded into homebridge as an accessory.

Contact sensor

It models a contact sensor in HomeKit. There can be multiple contact sensors configured. The config items are:

  1. "name": "<contact sensor name>",
  2. "type": "Contact Sensor",
  3. "zone": <alarm zone number of contact sensor> (please remember zone numbering starts at 0)
  4. "topic": "<MQTT Topic to publish to>"
  5. "debounceDelay": <Milliseconds to ignore state changes after a state change is detected>

Motion sensor

It models a motion sensor in HomeKit. There can be multiple motion sensors configured. The config items are:

  1. "name": "<motion sensor name>",
  2. "type": "Motion Sensor",
  3. "zone": <alarm zone number of motion sensor> (please remember zone numbering starts at 0)
  4. "topic": "<MQTT Topic to publish to>"
  5. "debounceDelay": <Milliseconds to ignore state changes after a state change is detected>

Smoke sensor

It models a smoke sensor in HomeKit. There can be multiple smoke sensors configured. The config items are:

  1. "name": "<smoke sensor name>",
  2. "type": "Smoke Sensor",
  3. "zone": <alarm zone number of smoke sensor> (please remember zone numbering starts at 0)
  4. "topic": "<MQTT Topic to publish to>"
  5. "debounceDelay": <Milliseconds to ignore state changes after a state change is detected>

Garage Door Opener

It models a garage door opener in HomeKit. There can be multiple garage door openers configured. The door matches a PGM number that will open/close the door, and a contact sensor alarm zone that indicates whether the door is open or closed. It also includes a time period that it takes to open or close the door. It can also be used for gate openers. The config items are:

  1. "name": "<garage door or gate name>",
  2. "type": "Garage Door",
  3. "zone": <alarm zone number of contact sensor on door> (please remember zone numbering starts at 0),
  4. "pgm": <alarm PGM number for controlling opening or closing of door> (please remember PGM numbering starts at 0),
  5. "doorOpensInSeconds": <number of seconds to open or close>
  6. "topic": "<MQTT Topic to publish to>"
  7. "debounceDelay": <Milliseconds to ignore state changes after a state change is detected>

Please note:

  • The maximum password length is 16 characters.
  • The platform requires homebridge version 0.4.36 or higher