Guide to setup of a NX584E alarm serial interface with HA

Thought I share my experience in interfacing with the NX584E with HA and save someone time and pain to configure/ troubleshooting the installation process.

First part of the step is checking your serial port on your Raspberry or equivalent host port is working. Worth noting you can’t use the on board GPIO serial of the RP3, these pins are 0-3V input levers and potentially damaging your RP3 if you connect the NX584E comms to these GPIO pins. NX584E uses true RS232 levels (transmits with +/-12V signal leves) and RP3 GPIO are 3.3V.

Simplest method to interface with the NX584E use a standard USB to serial converter.
Once the USB to serial converter is plugged in, install and fire up minicom. Select the relevant serial port /dev/ttyUSB0, set both hardware and software flow control to no and baudrate to 9600.
Short pins 2&3 of the DB9 connector, anything you type (TX) in minicom will be echo back (RX) to you. This is a 99% sure way to confirm your serial port TX & RX pins on your host are working.
The wiring from your host to the NX584 uses three pins on a DB9 connector, pins 2, 3 and 5.
Wired as follows:
NX584E HOST
2 3
3 2
5 5
Installing the NX584E with the alarm controller board is relatively easy, 3 wires need to be connected POS, COM and DAT which connect to the respective same pins used for the alarm keypads and marked KP POS/KP COM/ KP DATA. Manual doesn’t mention anything about switching the unit off whilst installing these cables, you don’t need to power off your alarm to connect these wires. Obviously care and caution needs to be taken installing the NX584E. If you choose to install the unit with the power off ensure battery is also disconnected. Keep in mind, this caused the alarm controller to loose its date/time setting (panel service light will illuminate). Refer to the panel manual on how to set the date/time.
Okay if you’re lucky (which I wasn’t) you should be able to follow the manual to program the NX584E and will elaborate on this shortly. After i connected the NX584E to the alarm controller, alarm keypads became semi unresponsive. To test, try arming and disarming the keypad. Has something to do with NX584E not been enrolled into the alarm controller board. Found this mentioned in a scanned manual online….hence the quandary how the f#@#@! Do you enrol the NX584 when it being connected caused the keypads not to work!!!
image
After soul searching and maybe more luck and sheer persistence, devised the following processed to enrol the NX584 and still be able to use the keypad at the same time:

  1. Remove the KB DATA wire to the NX584E only, leave your NX584E powered with the other COM and POS wires still connected
  2. Via keypad (which now functions), enter the panel into program mode *8
  3. Enter your master code, default is 9713. (Suggest you change this at some point!!)
  4. Enter [9]-[1]-[5]-[#]-[Exit]-[Exit], and wait 12 seconds. (this performs the enrolment process)
  5. Immediately after you press the last [EXIT] key connect the NX584E KB DATA back and ensure it has a good connection at this point it enrols the NX584E
    Ideally this is a two person job one on the keypad and other ready to connect the wire.
    Your keypad will now work with the NX584E connected!
    Okay at this point keep minicom running, you should see some garbled data coming through. Don’t stress the NX584e hasn’t been configured as yet.

Follow the NX584E install manual and set the following parameters:
(Refer to https://github.com/kk7ds/pynx584/wiki/Setting-up-your-NX-alarm-panel for more detail)

  • Protocol: ASCII
    Feature: 0
    Segment: 1
    Option: 1
    • Speed: 9600 Baud (OR WHICHEVER YOU CHOOSE).
      Nb. People have reported that anything above 9600bps can have adverse affects on some system integrations including Home Assistant. This is likely dependent on the serial hardware that is used, however 9600bps is typically a safe option.
      Feature: 1
      Segment: 1
      Option: 4

    • Enabled Transition Messages:
      Feature: 2
      Segment: 1
      Options:
      2 - Interface Configuration Message
      5 - Zone Status Message
      7 - Partition Status Message
      Segment: 2
      Options:
      1 - System Status Message
      2 - X-10 Message Received (OPTIONAL)
      3 - Log Event Message
      4 - Keypad Message Received (OPTIONAL)

    • Enabled Commands:
      Feature: 3
      Segment: 1
      Options:
      2 - Interface Configuration Request
      4 - Zone Name Request
      5 - Zone Status Request
      6 - Zones Snapshot Request
      7 - Partition Status Request
      8 - Partitions Snapshot Request
      Segment: 2
      Options:
      1 - System Status Request
      2 - Send X-10 Message (OPTIONAL)
      3 - Log Event Request
      4 - Send Keypad Text Message (OPTIONAL)
      Segment: 3
      Options:
      1 - Program Data Request (OPTIONAL)
      2 - Program Data Command (OPTIONAL)
      Segment: 4
      Options:
      4 - Set Clock / Calendar Command
      5 - Primary Keypad Function with PIN (OPTIONAL)
      7 - Secondary Keypad Function (OPTIONAL)
      8 - Zone Bypass Toggle (OPTIONAL)

Besides working out how to use the alarm keypad to program which takes some time getting to understand the process, the only challenge had was setting baudrate to 9600, default was “3”, which should be 4800. Couldn’t for some reason change to “4” which should have set the baud to 9600.
Once programmed the alarm/584 controller, should see a string of HEX data now coming into Minicom. Strange part here is the baudrate on the panel was in theory set to 4800 and minicom set to 9600 data was coming through perfectly. Hence think something particular to my panel that option 3 is 9600???
Screen shot below from minicom shows the stream of data coming in, having the correct baud rate will show a string of HEX data as opposed to the last line having the incorrect baud rate, displaying garbled characters.
image
At this point you’re receiving data from the NX584 yeah!
We still need to confirm if you can transmit to the panel. :frowning:
Follow this process to install the py server component:


To test, open two SSH sessions.

One session running:
nx584_server --serial /dev/ttyUSB0 --baud 9600 (assuming these are your parameters)

Second session:
Referring to the link above, try the arm & disarm commands.
If you’re able to arm/disarm this confirm you’ve successfully transmitted data back to the panel!
If you can’t double check your wiring and serial port, send me an email and will help debug your problem.

Okay, next step is to get the NX_584 server to run as a daemon and autoload on boot up.
Follow this process to ensure NX584 loads on power up:


Here’s the content of the file nx584.service
[Unit]
Description=NX584 daemon
[Service]
Type=simple
User=pi
WorkingDirectory=/usr/local/bin/
ExecStart=/usr/local/bin/nx584_server --config /home/pi/alarmpanel.ini --serial /dev/ttyUSB0 --baud 9600
Restart=on-failure
[Install]
WantedBy=multi-user.target

You can check status of the daemon using:
sudo systemctl status nx584.service
Keep in mind close off all manually stared nx584_server instances as two servers can’t communicate to the same serial port.

The PYN584 server should have discovered all the zones and created a config.ini, couldn’t find this file hence referring to the following link:

Created a file called “alarmpanel.ini” file as defined above in the nx586.service file above in the appropriate location.
Contents of alarmpanel.ini:
[config]
max_zones = 6
euro_date_format = False

[zones]
1 = Hallway
2 = Family Kitchen
3 = Formal rooms
4 = Upstairs
5 = study spare bed
6 = Bathroom Laundry

You’ll need to stop/start the service for changes to be recognised.
Since the nx584_server discovers the zones every time the server starts and only discovers when the zones are triggered, having and server using alarmpanel.ini stops the need for zones to be discovered. If a zone isn’t discovered when HA starts, HA doesn’t display the zones. Hope that makes sense.
HA also uses the zone names as the friendly name.
Refer to:


The only other issue I’ve found, if you’re nx584_server isn’t running or stops, HA disconnects and stops reporting on the sensor status.
Need to restart HA to re-establish the connection to nx584_server, would be nice if NX584 HA component had some resilience to re-establish the connection.
Hope this get you of a bind, if need help send PM and happy to help.

Rob.

3 Likes

Hi Rob. just beginning to look into this and your guide will be a great help. One thing I just want to confirm with the PIN settings you listed, if 5 on the NX584 needs to connect to pin 5 on the host/Pi, does that mean you cant just use a serial gender changer to connect the two together (as pin 5 would line up to pin 1).

Cheers,
Darren

Rob, Thanks for this. I’ve got my nx-8 working except Home Assistant is reporting the system is armed away regardless of whether it is armed away or stay. Any ideas? Thanks!

Apologies for late reply…

pin 5 to pin 5, based on a DB9 connector. Pin 5 is the ground wire

Not sure on that one, it simply worked for me.
Can you arm or disarm the panel via HA?
Just trying to establish you’ve got 2 way comms. Have you run through my suggested steps?

Rob.

Hi Rob, yes, I can arm/disarm, view zone status, etc so the connection is good. After looking at the source code, it looks like home away vs stay is actually dependent on whether zones are bypassed. Do you know if that is accurate? I don’t have any interior zones, so nothing gets bypassed, the only difference for me is the instant alarm versus delay.

Hi JM,

Just checked regardless of arming mode ie home or away, it reports it’s state as “armed away”.
In saying this, the alarm hasn’t been configured for a home arming mode. Hence maybe why it’s reverting to arm away??

Noticed it can be also hit and miss to arm the system, sometimes it arms on the first go but typically have to enter the arm code several times before it accepts. Have you experienced this issue?

No issues with the system responding, although I wish the response time for arming/disarming was faster…

Hi @robg. Just a quick note to say thanks heaps for putting the effort in to post this. System is up and running with relatively little work thanks to your guide. Much appreciated.

Just noticed your reply…thanks nice to give back help to others!

Hi. I have the nx-4 and when I am in programming mode and I press [9]-[1]-[5]-[#] , nothing happens. any idea?

Did you turn off AC and disconnect the battery when installing the NX584? I have made several attempts connecting the NX584. Everytime, my control panel does not work properly when the NX584 is connected.

I have tried disconnect the “data” wire from the NX584, go in programming mode on the control panel. Connect the “data” wire back on the NX584 and press exit on the control panel but nothing happens… NX584 does not seem to get enrolled.

Will I have better luck turning off the nx-4 and rebooting it? but not sure and not very confident with electricity to turn it off… I disconnect one AC cable and one cable from battery? will that turn off the nx-4?

lol I give up… could not get the NX584 to enroll with my nx-4.
I even powered my nx-4 down and i still can’t enroll the NX584 :frowning:
When the NX584 is connected, my control pad behaves weirdly

Hey Yeahman!

Again sorry…just seen this post but haven’t touched the working panel in sometime. If you’re still interested in getting this resolve PM directly and will assist if I can.

Rob.

Hello,

I have installed a caddx NX-8 alarm system with 3 partitions and a NX584 module.
I have connected my RPi3 running home assistant with the NX-8 board via the nx584 module using a usb-to-serial-rs232 adapter.
At the moment i can communicate with the nx-8 alarm system through home assistant buy I have some issues.

The main problem I face is that I can arm the alarm but I cannot disarm it.
In the log file I see the arm activation but there is nothing (no error indication) when i send the disarm command.

Also a second issue I have is that I have included nx584 as a binary sensor in my configuration.yaml file but I cannot see any of my zones, they are not exposed to home assistant.

Can someone help me with the above issues, please?
Thank you in advance.
Nikos

The two issues I had were now resolved since I have forgotten to activate options 1 & 2 of Feature 3 / Segment 3 of the NX-584 module. Now I can arm and disarm the partitions.
Also, as you suggested, I have manually created the config.ini file and now I can see the zones.

The new problem I am facing know is is that when I start the pynx584 server, my alarm signals handler (a company to which my Caddx NX-8 system is connected via phone line, in order to report the status of my system) calls me and informs me that they have received an alarm signal from my NX-8 system, which is actually a false alarm since the siren in my home is not activated.
Also, the same false alarm signals are received from the alarm signals hander company when I arm my NX-8 system.
When the pynx584 server is not running no false alarm signals are send to the alarm signals hander company.
As I mentioned before the only cases those false alarm signals are send to the alarm signals hander company is when I start the pynx584 server and when I arm the alarm system while pynx584 is running.
Have someone ever faced such issue? Do you have any idea why this happens?

Yesterday, I found out which was the responsible for the false alarm signals. I have a TRIKDIS G16 cellular communicator attached on the NX-8 board. When I unplugged the TRIKDIS and have only my land phone line connected on NX-8 board, no false alarm signals were generated.
What I am looking right now to find out is why the TRIKDIS generates these false alarm signals at the following specific situations:

  • when I start the pynx584 server, or
  • when I arm the alarm system

If anyone has any idea on this please let me know.

Never had that problem, I’ve also got a cellular modem and interfaces via a RJ11 plug to the panel. Here’s a good explanaton about how they work. http://library.ademconet.com/MWT/fs2/IGSMV4G/GSM-Dialer-Capture-Intelligence-Device.PDF
Can arm/disarm via HA and never had any false alarm triggers.
Good luck with that one!

Hi - I have an NX4 with 3 zones and 3 motion sensors. If I follow your guide, would I be able to get events from the motion sensors onto HA even though the alarm is not activated? I was thinking of using the built in security alarm motion sensors to trigger lights at night through HA.

That is how I use my system, ion addition to a traditional alarm system, all of my sensors are used as inputs for logic in my automations.

Absolutely, using appdaemon. I’ve integrated that if it doesn’t detect any motion from the living rooms sensors for 1 hour and the TV is on to switch the TV off.