New Binding for Caddx alarm panels [NX584, NX8e, ...]

Tags: #<Tag:0x00007faed9c66a30> #<Tag:0x00007faed9c668f0> #<Tag:0x00007faed9c667b0>

Hi,

i’m developing a binding for the Caddx alarm panel.
Download jar
Source code [caddx branch]

The binding supports discovery, status updates from the panel, sending of commands to the panel and exposes almost all the information/commands from the panel.
For the binding to work the panel has to communicate in binary protocol.

The binding is modeled after the dscalarm binding.
The readme file is not yet ready, it is mostly cut and paste from dscalarm. :slight_smile:

Please note the binding is still in a very alpha state.
If someone wants to give it a try, i will be happy about any info, comment, suggestion.

3 Likes

Hi,
thanks a lot for this work.
I have added the jar file to the addons folder and I can see the binding via the paper UI.
But it s not clear to me how to take it from here. There were no things discovered. I tried adding a thing via the Paper UI, but nor by searching, nor by adding manually it was possible. I have the nxgipd repository running successfully, so my usb setup is ok.
Or I can add things and items via config files but then I will need some guidance in which channel(s) are available or what should be the syntax for those.

I have been experimenting with openhab for a few weeks now. I want to move all my automation logic from openremote into openhab. Integration with my caddx alarm is the only barrier left.
So it would be really great if this binding could work. Thanks for your assistance.

On the Inbox in PaperUI, press the Scan button [top right on the screen].

The discovery process enumerates the Serial ports and tries various baudrates to discover the correct one. After this process is finished the discovered bridge should be in the Inbox.

Once you add the bridge, then also all the partitions,zones get discovered.

I have tried as you suggested, but unfortunately, the bridge is not discovered.
I have added the bridge manually from the paper UI. But also that does not result in discovery of any other things.
I installed openhab op a Rpi via the openhabian image about one month ago.
Here is some output from the log:
After adding the jar file:

2019-07-18 22:24:33.982 [WARN ] [shd.server.session.ServerSessionImpl] - exceptionCaught(ServerSessionImpl[openhab@/127.0.0.1:60122])[state=Opened] InterruptedByTimeoutException: null

Not sure whether this warning is really related to the caddx binding, but I suppose so since timing is really close.
While running the scan in the inbox:

2019-07-18 22:32:40.324 [ERROR] [ing.caddx.internal.CaddxCommunicator] - CaddxCommunicator.run() InterruptedException /dev/ttyUSB0
2019-07-18 22:32:46.755 [ERROR] [ing.caddx.internal.CaddxCommunicator] - CaddxCommunicator.run() TimeoutException caught.
2019-07-18 22:32:47.755 [ERROR] [ing.caddx.internal.CaddxCommunicator] - CaddxCommunicator.run() InterruptedException /dev/ttyUSB0
2019-07-18 22:32:54.133 [ERROR] [ing.caddx.internal.CaddxCommunicator] - CaddxCommunicator.run() TimeoutException caught.
2019-07-18 22:32:55.132 [ERROR] [ing.caddx.internal.CaddxCommunicator] - CaddxCommunicator.run() InterruptedException /dev/ttyUSB0
2019-07-18 22:32:58.271 [ERROR] [ing.caddx.internal.CaddxCommunicator] - CaddxCommunicator.run() TimeoutException caught.
2019-07-18 22:32:59.270 [ERROR] [ing.caddx.internal.CaddxCommunicator] - CaddxCommunicator.run() InterruptedException /dev/ttyUSB0
2019-07-18 22:33:06.602 [ERROR] [ing.caddx.internal.CaddxCommunicator] - CaddxCommunicator.run() TimeoutException caught.
2019-07-18 22:33:07.601 [ERROR] [ing.caddx.internal.CaddxCommunicator] - CaddxCommunicator.run() InterruptedException /dev/ttyUSB0

And after manually adding the bridge, it goes to timeout again.

2019-07-18 22:43:57.229 [hingStatusInfoChangedEvent] - 'caddx:bridge:f79ac9b4' changed from UNINITIALIZED to INITIALIZING
==> /var/log/openhab2/openhab.log <==
2019-07-18 22:43:57.268 [INFO ] [.internal.handler.CaddxBridgeHandler] - starting interface at port /dev/ttyUSB0 with baudrate 9600
==> /var/log/openhab2/events.log <==
2019-07-18 22:43:57.271 [hingStatusInfoChangedEvent] - 'caddx:bridge:f79ac9b4' changed from INITIALIZING to OFFLINE
==> /var/log/openhab2/openhab.log <==
2019-07-18 22:44:03.296 [ERROR] [ing.caddx.internal.CaddxCommunicator] - CaddxCommunicator.run() TimeoutException caught.

When I SHH into the Rpi I can read the output from the alarm, so that should not be the problem.

[23:04:51] openhabian@openHABianPi:~$ cat /dev/ttyUSB0

9860000000108599
0860000000400100805199
098600000000400100805199
098600000000400100805199

Have you got any more hints? Options I can try? Thanks for your help!

What is the model of your panel?
I see ASCII data. The binding works with the binary protocol.
Below is a screen dump from the DL900 software of my NX8E config.

The ASCII box is unchecked.

That did the trick indeed. Thanks! Immediately after the setting was changed, the inbox contained some items.
General question: there are many channels available. It’s not clear to me what each of them means (or can do). Is there a way I can figure out? Most of them will create an item type switch by default. Is that on purpose? I just want to be sure to understand and use the full potential here;)
More concrete question; Is there a way to determine if a partition is armed in “away” vs “stay” mode?

For each zone and partition most of the information received from the panel is exposed as channels. For the zones there are zone_type and zone_condition flags for the partitions there are partition_condition flags. All of them create a Switch because they all are just a bit of information On or Off.

You can see all of them in the protocol .pdf. Just google for “nx584 communication protocol”.
Have a look in the .pdf under 04h Zone Status Message and 06h Partition Status Message.

With the version you have there is no way to determine how the partition is armed. As far as i can tell it is only exposed via the 07h Partitions Snapshot Message which is not yet fully handled.

Currently i do not have a stable .jar.
I added support for the retrieval of the panel log messages and the ASCII protocol. (Both features are not yet tested at all)
I will also add the handling of message 07h and release a new .jar after doing some initial tests.

Also some info about the required panel configuration.
You should have at least the following check boxes checked to receive status information:

  • Interface Configuration
  • Zone name request (it is on my TODO list)
  • Zone status request
  • Zone snapshot request
  • Partition status request
  • Partitions snapshot request
  • System status request
  • Log event request.

And the following to send commands to the panel:

  • Primary KP function w/o PIN
  • Secondary KP function
  • Zone bypass toggle

Once i have a new version ready, i will reply here.

Hello,
Do you think the NX-595E would be supported?

I do not own the NX-595E.
From a quick Google search there is a github project which exposes the information via a REST interface. I suppose something could be written to support it.

I was going through the docs. Can you check the value of the “partition_entryguard” channel? This should be the flag that denotes the stay mode. (I’m currently away from home and cannot check)

Idd, that channel indicates whether it’s armed in steady mode.
I would be happy to test your new version. Zone names would be a great feature.
Any plans to make this an “official” binding?

I don’t understand. Is this the channel you were looking for, or not?

Of course.

The following items still need to be finished:

  • Alarm Panel Log handling
  • Documentation
  • Testing

For the panel log handling i don’t know what the binding should expose. I can get from the panel a list with messages but it is not clear to me how a list of strings can be exposed. Maybe for the first version i will add support only for the last message.

Hi @Senna600 you can download the new version of the binding from the following link. Download

Issues:

  • Zone names
    Zone name are retrieved from the panel. Unfortunately the panel only supports English characters. I live in Greece and my keypad supports Greek characters. There is a way to retrieve the zone names directly from the keypad and not through the panel. I don’t know if this affects you. I will look into it next month.

  • Alarm panel log
    For the alarm panel log i decided to retrieve the 10 most recent messages only. If you think it is not enough it is possible to increase it. Just tell me.

  • ASCII communication protocol
    Fully implemented but not tested at all.

Also what configuration do you have on your system?
I have a NX-8E with a NX-1048 keypad and a NX-408 wireless expander.
(@alexxio I also ordered an NX-595E and will have a look into it from next month)

oooOOOOoooo :smiley:
Thank you so much!

The NX-595E has a built in web server to control it directly… I’ve been looking to that Github API project and thanks to it I’ve managed to reproduce some main calls with CURL (also reversing engeneering the javascript of the web page).

Some status calculation are still a little bit “obscure” to me (haven’t got time to dive into it so I just made copy and paste, it uses some array masking) but it works.

When it’s time I can share some code if it can help.

Thank you for your time and effort!