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!!!
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:
- Remove the KB DATA wire to the NX584E only, leave your NX584E powered with the other COM and POS wires still connected
- Via keypad (which now functions), enter the panel into program mode *8
- Enter your master code, default is 9713. (Suggest you change this at some point!!)
- Enter [9]-[1]-[5]-[#]-[Exit]-[Exit], and wait 12 seconds. (this performs the enrolment process)
- 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.
At this point you’re receiving data from the NX584 yeah!
We still need to confirm if you can transmit to the panel.
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.