Paradox Alarm to Home Assistant interface through Pi Zero W (without IP150 module)

AxField

Expert Member
Joined
Apr 30, 2009
Messages
1,647
Reaction score
1,749
I've had a few people ask about how I integrated my Paradox Alarm with Home Assistant. There's a few ways to do it, but I wanted the most elegant and compact (hardware wise) solution for me, without paying stupid money for an IP150 module which is still very limited, especially with the newer firmware. I also wanted it to be self contained and run on my WiFi network, with all the other IoT devices I have running.

Most of the software work has been done by the authors of PAI, but for some reason there's no tutorial to do it the way I wanted to do it using a Pi Zero W. As a proof of concept, I eventually got it going using a Paradox USB interface (which is nothing other than a fancy USB to TTL interface), which I had laying around that I used to program my Panel using Babyware.

IMG-7552.jpg

I had this running for a few weeks to make sure the Pi Zero is suitable for the purpose (seeing as it's not on the PAI recommended list) and it worked like a dream. Only issue is that it's not very elegant nor neat. As it was tested, you're going from Paradox TTL to USB, into the USB port of the Pi, then back to a virtual Serial port into PAI. A better way to do it would be to go directly from the Paradox serial port into the Pi. Only issue is that the Paradox TTL Serial is at 5V and the Pi Serial is 3V3 (and I checked, the PI I/O is not 5V tolerant).

After some messing about, I came up with the below wiring diagram. I'm using a 12V to 5V DC to DC converter to power the Pi directly off the 12V Aux pin1 on the Paradox Serial connector.
I used this one, but any suitable board will work:
https://www.robotics.org.za/D1-POWER?search=d1 power shield

For level shifting the 5V TTL of the Paradox Serial port to the 3V3 TTL of the Pi Zero, I used this. It's a 4 channel unit (you only need 2 channels), but it's all they had in stock:
https://www.robotics.org.za/BOB-12009?search=4 Channel - Logic Level Converter Bi-Directional

This is the way it's all connected:PAI Interface.png

This is how it's all wired up, as per the above schematic. It's not pretty, but it's solid and compact. I sandwiched a piece of plastic between the PI and the two boards, with a little hot glue to keep it all together:
IMG-7559.jpg

I recently got a 3D printer and was itching to use it for something other than printing Benchies. It's actually the first time I designed anything in 3D, so just excuse the lack of any flair :)
IMG-7566.jpg

And done, with the lid in place as well. Still battling to get my bed leveling perfect on the printer, but it's functional at least.
IMG-7567.jpg

Last but not least, it's working perfectly with Home Assistant.
IMG-7569.PNG

In as much as setting it all up on the Pi Zero W, I'm running the latest Raspberry Pi OS, 32bit Lite (as I don't need a GUI because it's running headless in the panel).

Setting up PAI, I followed this guide:
https://github.com/ParadoxAlarmInterface/pai/wiki/Manual

Because you're running a Pi Zero W, there's some additional step you need to take in order to enable the serial port on the GPIO pins, it's not enabled by default on the Pi Zero W as would be the case with other versions.

I'm going to assume you know your way around Linux, using Nano as a configuration editor and how to use Putty to SSH into the Pi. Things in Italic is what you need to enter

Enable hardware UART PL011 port:

- Disable built in BT module
sudo nano /boot/config.txt
Add dtoverlay=pi3-miniuart-bt to end of file, save and reboot

- After reboot, check if ttyS0 is now available. This shows that BT is switched off and that ttyAMA0 is available on GPIO. If it doesn't return ttyS0 then ttyAMA0 is still mapped internally to BT device.
ls -lsa /dev/serial*
0 lrwxrwxrwx 1 root root 7 Sep 26 12:12 /dev/serial0 -> ttyAMA0
0 lrwxrwxrwx 1 root root 5 Sep 26 12:12 /dev/serial1 -> ttyS0

- Disable Console Messages over UART
sudo nano /boot/cmdline.txt
Remove console=serial0,115200 at start of file, save and reboot

Once the above is done, you need to configure PAI to send Panel updates using MQTT (I prefer this method over directly integrating with HA, as MQTT is more universal for non HA implementations).

See below my configuration, yours would probably be very similar to mine. I've only included the changes to the example pai.conf file


CONNECTION_TYPE = 'Serial' # Serial or IP
SERIAL_PORT = '/dev/ttyAMA0' # Pathname of the Serial Port
SERIAL_BAUD = 9600 # 9600 for SP/MG. For EVO: Use 38400(default setting) or 57600
KEEP_ALIVE_INTERVAL = 10 # Interval between status updates
POWER_UPDATE_INTERVAL = 60 # Interval between updates of the battery, DC and VDC voltages
PUSH_POWER_UPDATE_WITHOUT_CHANGE = True # Always notify interfaces of power changes
PUSH_UPDATE_WITHOUT_CHANGE = False # Always notify interfaces of all changes
MQTT_ENABLE = True # Enable MQTT Interface
MQTT_HOST = 'yourmqttbroker' # Hostname or address
MQTT_PORT = 1883 # TCP Port (TLS port if MQTT_TLS_CERT_PATH is set)
MQTT_USERNAME = 'yourmqttbrokerusername' # MQTT Username for authentication
MQTT_PASSWORD = 'yourmqttbrokerpassword' # MQTT Password
MQTT_RETAIN = True # Publish messages with Retain
MQTT_REPUBLISH_INTERVAL = 60 * 60 * 12 # Interval for republishing all data
MQTT_BASE_TOPIC = 'paradox' # Root of all topics
MQTT_ZONE_TOPIC = 'zones' # Base for zone states
MQTT_PARTITION_TOPIC = 'partitions' # Base for partition states
MQTT_BUS_TOPIC = 'buses' # Base for buses states
MQTT_MODULE_TOPIC = 'bus-module' # Base for bus module states
MQTT_SYSTEM_TOPIC = 'system' # Base for panel states
MQTT_USER_TOPIC = 'users' # Base for user states
MQTT_EVENTS_TOPIC = 'events' # Base for events
MQTT_CONTROL_TOPIC = 'control' # Base for control of other elements (ROOT/CONTROL/TYPE)
MQTT_DEFINITIONS_TOPIC = 'control' # Base for definitions
MQTT_HOMEASSISTANT_DISCOVERY_PREFIX = 'homeassistant'
MQTT_OUTPUT_TOPIC = 'outputs'
MQTT_DOOR_TOPIC = 'doors'
MQTT_KEYPAD_TOPIC = 'keypads'
MQTT_STATES_TOPIC = 'states'
MQTT_NOTIFICATIONS_TOPIC = 'notifications'
MQTT_SEND_PANIC_TOPIC = 'panic'
MQTT_PUBLISH_RAW_EVENTS = True
MQTT_INTERFACE_TOPIC = 'interface'
MQTT_TOGGLE_CODES = {}
MQTT_USE_NUMERIC_STATES = False # use 0 and 1 instead of True and False
MQTT_PUBLISH_COMMAND_STATUS = True # Publish command statuses to MQTT
MQTT_COMMAND_STATUS_TOPIC = "command_status"
MQTT_HOMEASSISTANT_AUTODISCOVERY_ENABLE = True

That should be it. It seems a little involved but the above should get you going in no time :)
 
Amazing. Thx for sharing. Gonna go this route to to get rid of the ip150.
 
Very interesting, thanks for posting. I've got an Olarm module attached to my serial port (which works well enough). Would it be possible to wire this to the same port? I suspect that a "read only" implementation would be fine, but I'm not sure how this protocol works.
 
Very interesting, thanks for posting. I've got an Olarm module attached to my serial port (which works well enough). Would it be possible to wire this to the same port? I suspect that a "read only" implementation would be fine, but I'm not sure how this protocol works.
Afraid not my man. RS232 cannot have multiple devices on the same bus, as there's no master/slave relationship and thus no collision detection. Also, if you want to integrate, a Read Only strategy won't really work because you don't want to simply see detector states but also want to arm/disarm the panel. Lastly, when PAI connects to a panel it requests all detector labels and partition allocations; this is likely to clash with any other device on the network. Years ago we used RS232 multiplexers when we needed to integrate multiple devices on the same port, but that's a pretty involved process, hardware wise, by itself. Not a likely avenue to take in your case.
 
Afraid not my man. RS232 cannot have multiple devices on the same bus, as there's no master/slave relationship and thus no collision detection. Also, if you want to integrate, a Read Only strategy won't really work because you don't want to simply see detector states but also want to arm/disarm the panel. Lastly, when PAI connects to a panel it requests all detector labels and partition allocations; this is likely to clash with any other device on the network. Years ago we used RS232 multiplexers when we needed to integrate multiple devices on the same port, but that's a pretty involved process, hardware wise, by itself. Not a likely avenue to take in your case.

I see. I only really want a backup channel for if the alarm triggers. I could get that from the siren output (minus silent panic of course).

Damn, I got the Home Assistant VM running last night just to check it out and I'm impressed. Looking forward to getting this running on some SBC. Got sucked into watching what people could wire up with this.

Regarding the Olarm. I got curious after I got it installed a while back. Seems like it also uses MQTT (between the IOS app and remote service at least) and as I recall, I could find some prod/test MQTT references on the sites hosted on the IPs I looked at. Would not be surprised if it's "just" a few of these open source projects wired together. It does work well. On that robotics site you posted you can even get a data SIM card, and I suspect the same one is lurking within the Olarm unit.
 
Well, if it supports MQTT then you all set to get it into HA pretty easily. Then you won’t have to go through any of the above drama at all. As for an SBC, the Raspberry Pi 4 is highly recommended. It has more than enough horse power for even large HA installations.
 
Well, if it supports MQTT then you all set to get it into HA pretty easily. Then you won’t have to go through any of the above drama at all. As for an SBC, the Raspberry Pi 4 is highly recommended. It has more than enough horse power for even large HA
From what I can see, digging around MQTT is used, I just have no idea how you would go about getting logged in to the MQTT service and subscribe to the topics (if my terminology is correct)
 
Last edited:
Just wanted to update this post, I have emailed Olarm and been told that they are busy with an API that will allow monitoring and possibly control the device also, I am waiting to see what the documentation looks like.
 
Bud, there's really no need to use anything USB as far as my guide in concerned. The reason I use a level shifter is because the TTL level of the panel is 5V, but on a Pi the TTL level is 3v3. It's exactly the same protocol, just the voltages are different. I do power the Pi Zero from the alarm serial port (which is 12v), hence the second PCB in my thread, which is a 12V to 3V3 regulator. But the Pi Zero draws such little power (less than 100mA) that it's ok to do so. The bigger Pi's draw much more power so you should use a separate power supply. I wanted sleek, compact and elegant, which is why I spent the effort I did. It's not the only way to do things though.

Of course, the alternative is to use the USB/TTL adaptors to talk to the paradox panel (although you need to pick the 5v TTL version) and plug the USB into the RPi, and TTL side into the Paradox panel. That is more in line with the various guides for the PAI integration than what I did. It's just klunky, especially as it needs a dedicated PSU for the Pi. Many ways to skin a cat. The idea of my thread was to make things simple; seems like I failed :)

Maybe we should take the discussion to that thread rather?


Replying to your post from the other Home Assistant thread.

I appreciate the effort to make things simple but I lack the skills and equipment to perform such a delicate task as you have.

If I had the soldering equipment and the skills to solder on such a small board I would definitely do it. Maybe when I'm more clued up in future and when I'm ready to upgrade from a Pi to a VM on PC then I'll be more comfortable.

But in the mean time I was looking for a more direct easy/noob option
 
Yeah, if soldering puts you off then rather get the USB to TTL interface, plug TTL into the panel and USB into the Pi. Power the Pi separately and follow the software part of my guide.

This one, set to 5V, is probably the cheapest way to get going


The guide above does assume direct serial, going usb is probably easier. Once you have it all together then we can try and get you going step by step.
 
Yeah, if soldering puts you off then rather get the USB to TTL interface, plug TTL into the panel and USB into the Pi. Power the Pi separately and follow the software part of my guide.

This one, set to 5V, is probably the cheapest way to get going


The guide above does assume direct serial, going usb is probably easier. Once you have it all together then we can try and get you going step by step.



Would this work? I dont mind if its "untidy" it will all be out of sight.
I'll just need to add the female to female cables.
I want to get some other stuff from this robofactory so I wanted to try get everything in 1 order
 
Just wanted to update this post, I have emailed Olarm and been told that they are busy with an API that will allow monitoring and possibly control the device also, I am waiting to see what the documentation looks like.
Any update from Olarm on this? Would be great to get this integrated into HA and keep Olarm functionality.
 
I don't have any problem with an IP-150 attached to a EVO-192 panel. It lets me see open zones if I need to, can arm and disarm and sends me alerts upon an alarm event, so I can check that the response co is doing their job

The Paradox USB interface is not that cheap today (dealer price R 775,00 and an IP-150 is R 1395,00)

I use Insite Gold on a mobile phone

Your project is very interesting though
 
The Paradox USB interface is not that cheap today (dealer price R 775,00 and an IP-150 is R 1395,00)
You don’t need anything (outside of the actual panel) from Paradox for the above to work. Not the usb module or the IP module. Only reason the usb module is in the above pics is because I used it as a proof of concept. I see that created confusion with many, so I should’ve rather not mentioned it.

In terms of hardware, there’s less than R400 in parts (the Pi Zero being the biggest chunk).
 
Any update from Olarm on this? Would be great to get this integrated into HA and keep Olarm functionality.
Hi Sorry for the delay, the API will give you all the information required in a json format to see the status of your zones as well as arm / disarm, bypass zone etc.

I have started to try to bring this in to HA, but I am not very familiar with HA and the structures to utilize this data.

You will have to contact olarm and request access to the API and you would then be able to access the documentation from https://login.olarm.co

/M
 
Hi Sorry for the delay, the API will give you all the information required in a json format to see the status of your zones as well as arm / disarm, bypass zone etc.

I have started to try to bring this in to HA, but I am not very familiar with HA and the structures to utilize this data.

You will have to contact olarm and request access to the API and you would then be able to access the documentation from https://login.olarm.co

/M
This is very interesting, so we need an integration of sorts to take that json and present it to HA as entities
 
@gbyleveldt very cool indeed, and thanks for sharing. I discovered Homebridge and the PAI plugin recently and have been trying to get it set up on my Rpi 4 so that I can manage the alarm through Home(Homekit) on my Apple devices. Haven't had 100% success yet though, as I'm struggling to get the connection via the IP150 module correct, and with my limited Rpi, MQTT and related knowledge, it's a bit of a fumble in the dark!
 
Top
Sign up to the MyBroadband newsletter
X