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

Hi @Mark_VG,

You do a reboot and after the reboot some channels are not getting online? On what system is your OH installation?

I will check.

Also FYI all the current changes on the binding have been accepted for the 3.1.0 milestone.

@jossuar shamefully no, but if you point me in the right direction i will try to figure it out.
I will do a further test with a shorter cable (directly plugged into the nx584 i have a usb exterder currently so i want to take that out fo the equation.

Hi

Yes, I run on a Windows 10 Setup. If I reboot the system or restart the OpenHab service some of the Channels do not go Online unless the Binding is restarted.

Great - thanks

So these fixes will be in the 3.1.0-M3 milestone - I see this is due at the end of the week. Might give it a few days before upgrading.
Cheers
Mark

Hi @alexkarageorgis,

see below. The default password for openhab is habopen

[11:38:17] openhabian@openHABianPi:~$ ssh openhab@localhost -p 8101
Password authentication
Password:

                          __  _____    ____
  ____  ____  ___  ____  / / / /   |  / __ )
 / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  |
/ /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ /
\____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/
    /_/                        2.5.4
                               Release Build

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown openHAB.

openhab> log:set DEBUG org.openhab.binding.caddx
openhab> log:tail
1 Like

hi @jossuar i used usb 3 and a direct connection (not via a usb hub ) and disccovery worked.
Now all i need to understand is how to arm disarm and status check :slight_smile:

I guess because i have openhab 3 the issues that @Mark_VG is facing will be similar so i will wait for the new version.

@Mark_VG i am very jealous of your dashboard. what can i do to get something similar?

Hi

As I mentioned I have been toying with a Widget. However I am battling to get my mind round how to make this possible with all the different combinations available in a Caddx Alarm system.

We are happy to assist with specific questions as far as possible.

My suggestion would be to look at the discovered things, link items to the channels you are interested in and take it from there. The Binding documentations gives a pretty decent start to viewing the current status.

I used the KeyPad Widget from Yannick at:

I am happy to share my rules etc if that will help.

Mark

1 Like

@Mark_VG im very grateful.

i will install the widget for sure and start toying. and look at the documentation although i am still catching up in terms of understanding what exactly i am reading :slight_smile:

Quick question

1.if you feel like saving me some time. i have played around and added a few partitions and zones to get a feeling. I realize now i only need a zone + the bypass switch and the partition status. all the rest are good to know but i dont need them for now. what is the intelligent fast way of removing items and points. Is it deleting the thing (which may? remove itemes and points?) I dont mind keeping things in my case but i have added too much in model and items which means deleting one by one. What is the smart way?

  1. as if to a child how do I arm a partition :slight_smile: (eventually i want to speak to alexa and arm a partition in stay or with specific bypasses. - that is how i have it setup now in Vera (mios)

Hi @alexkarageorgis

  1. From what I have seen, deleting a Thing does not delete any Items etc. You can delete a Thing and recreate it and the linked items will come back - so it appears there is no cleanup. Depending on how far you are with your setup (I am beyond this point) you could do a clean install? Otherwise I guess manually remove the items you do not need from Settings, Things, Channels, Linked - Unlink & Remove Item.

  2. As I said - this more more complex and depends a lot on how your system is set up… My system has the required BYPASS zones configured on the panel - so no need to manually do that. You will need a Page or a Sitemap with the relevant Switch Items to be able to “Press the Button”. You will have to customize the rule to match your system.

My STAY rule is as follows:

rule "Partition 1 Arm in STAY"
when
    Item Partition1_Stay  received command ON
then
if (Partition1_ReadyToArm.state == OFF) {
    logWarn("actions", "Ready to ARM is OFF")
        Alarm_Feedback.postUpdate("Ready to ARM is OFF")
            createTimer(now.plusSeconds(5), [
            Alarm_Feedback.postUpdate("")
        ])
}
else if (Partition1_Armed.state == ON) {
    logWarn("actions", "Alarm is already ARMED")
    Alarm_Feedback.postUpdate("Alarm is already ARMED")
            createTimer(now.plusSeconds(5), [
            Alarm_Feedback.postUpdate("")
        ])
}
else {
    val actions = getActions("caddx","caddx:partition:<REDACT>:partition1")
    if (null === actions) {
        logWarn("actions", "Actions not found, check thing ID for bridge")
        return
    }
    logWarn("actions", "Ready to ARM is ON ")
    actions.stay()
}
end
1 Like

@Mark_VG so unlinking a channel is important? prior to deleting?

Can’t say with 100% certainty. But from My experience you can delete a Thing - the linked items will remain… and if you recreate (using the same name?) the linking comes back. So for a “clean” setup I think it would be best.

Hi @alexkarageorgis,

It should be possible to use the alarm keypad as an input device.

The api has support for communication with the NX-148 keypad. You can display a message on the keypad and receive the button presses. E.g. When you enter the house and disarm the alarm you could have a rule to display a menu on the keypad LCD form where the user could select a scene for the house (open the blinds, turn on the lights if it is night, etc).
The terminal time is the time the message should be displayed on the keypad before it reverts back to the default display.

This is a feature which i haven’t tested at all. :frowning: I do not have a NX-148 keypad. The above is what i have inferred from the manual.

1 Like

Wow, that sounds very interesting… Can you give more of an idea of how you see that working? I have an NX-148 keypad and will take a look at this as well.

BTW. I See 3.1.0-M3 is out and there is no mention of the latest fixes.

automower	Enhancements	8802	Add planner, calendar and command channels
chromecast	Enhancements	10245	Added play URL actions to chromecast binding
daikin	Enhancements	9602	add energy usage day & week

Hopefully an oversight…

Thanks as always
Mark

As I have written above, this info is what i have inferred from the NX-584 protocol manual. I also don’t know if this feature is correctly implemented by the binding.

The sequence should be as follows:

  • First a keypad thing should be defined. For this you have to specify the keypad address. The keypad address depends on the partition for which it is defined and if it is the 1st, 2nd, etc. You can get more info from the NX-8E manual Location 212 – PROGRAMMING THE LCD KEYPAD ADDRESS
  • Then a rule has to be defined for e.g. when the “partition_armed” channel changes value to OFF.
  • The rule has to execute the following actions on the keypad: enterTerminalMode for e.g. 60 sec, then sendKeypadTextMessage to display a message. e.g. Press 1 for blinds, Press 2 for lights, etc.
  • When the user presses the respective button on the keypad the keypad_key_pressed channel on the keypad should fire and a rule should catch it.

As i said it is pure speculation.

The last two merged Pull Requests have the 3.1 tag. I suppose they will not be merged in a milestone release, like previous PRs in the list below.
https://github.com/openhab/openhab-addons/pulls?q=is%3Apr+is%3Aclosed+caddx+

Thanks @jossuar

Pity about your fixes only going ion to 3.1. Will continue with the manual version till then.

I have managed to create the Keypad thing and got it online - have to restart the binding to bring it online.

UID: caddx:keypad:<REDACT>:Caddx_Alarm_Keypad
label: Caddx Alarm Keypad
thingTypeUID: caddx:keypad
configuration:
  keypadAddress: 192
  terminalModeSeconds: 60
bridgeUID: caddx:bridge:<REDACT>

The Keypad Thing lets you define the “Terminal Mode Seconds” which I have set to 60.

I have created the following rule:

rule "Keypad Message Test"
when
    Item Testing_Switch received command ON
then
    val actions = getActions("caddx","caddx:partition:<REDACT>:partition1")
    if (null === actions) {
        logWarn("actions", "Actions not found, check thing ID for bridge")
        return
    }
    logWarn("actions", "Sending Text")
    actions.enterTerminalMode(60)
    logWarn("actions", "Entered Terminal Mode")    
    actions.sendKeypadTextMessage(0, "Test Message from Mark")       
end

But get the error:

22:40:01.013 [WARN ] [org.openhab.core.model.script.actions] - Sending Text
22:40:01.074 [ERROR] [.internal.handler.ScriptActionHandler] - Script execution of rule with UID 'keypad_message-1' failed: class org.openhab.binding.caddx.internal.action.CaddxPartitionActions cannot be cast to class org.openhab.binding.caddx.internal.action.CaddxKeypadActions (org.openhab.binding.caddx.internal.action.CaddxPartitionActions and org.openhab.binding.caddx.internal.action.CaddxKeypadActions are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @1a26bf2f) in keypad_message

So guessing something wrong with my syntax? Seems to be failing on actions.enterTerminalMode(60). I have tried with actions.enterTerminalMode() as well.

My panel_keypad_terminal_mode_request shows as ON.

Any ideas on what I may be doing wrong?

Thanks
Mark

Hi @Mark_VG,

on the getActions call you should specify the keypad and not the partition.

Thanks @jossuar

That was it… Don’t think I would have spotted that anytime soon. Have fixed that up. Also had to change the sendKeypadTextMessage - the position has to be a string too.

So my rule is now:

rule "Keypad Message Test"
when
    Item Testing_Switch received command ON
then
    val actions = getActions("caddx","caddx:keypad:e59e4935:Caddx_Alarm_Keypad")
    if (null === actions) {
        logWarn("actions", "Actions not found, check thing ID for bridge")
        return
    }
    logWarn("actions", "Entering Terminal Mode")
    actions.enterTerminalMode(120)
    logWarn("actions", "Entered Terminal Mode")  
    logWarn("actions", "Sending Message")  
    actions.sendKeypadTextMessage("0","Test Message from Mark")       
end

This results in the following on Keypad

Which only lasts about 60 seconds - so guessing the time comes from the settings on the Thing.

Tried a few combinations for the String - but always the same result.

EDIT (Added Logs from DEBUG):

10:59:49.203 [WARN ] [org.openhab.core.model.script.actions] - Entering Terminal Mode
10:59:49.207 [DEBUG] [x.internal.handler.ThingHandlerKeypad] - Address: 192, Seconds: 0
10:59:49.208 [TRACE] [x.internal.handler.CaddxBridgeHandler] - sendCommand(): Attempting to send Command: command - keypad_terminal_mode_request - data: 192,15
10:59:49.209 [WARN ] [org.openhab.core.model.script.actions] - Entered Terminal Mode
10:59:49.210 [WARN ] [org.openhab.core.model.script.actions] - Sending Message
10:59:49.211 [DEBUG] [x.internal.handler.ThingHandlerKeypad] - Text to be displayed on the keypad has not the correct length
10:59:49.211 [WARN ] [org.openhab.core.model.script.actions] - Message Sent
10:59:49.408 [TRACE] [ding.caddx.internal.CaddxCommunicator] - CaddxCommunicator.run(): Nothing expected, Nothing received we continue
10:59:49.408 [TRACE] [ding.caddx.internal.CaddxCommunicator] - CaddxCommunicator.run() Outgoing message: 44
10:59:49.408 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - ->: Keypad Terminal Mode Request
10:59:49.408 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - ->: 7E 03 2C C0 0F FE 21
10:59:49.548 [TRACE] [ding.caddx.internal.CaddxCommunicator] - Data receiving from the serial port
10:59:49.548 [TRACE] [ding.caddx.internal.CaddxCommunicator] - CaddxCommunicator.handleAsciiProtocol() Got start byte
10:59:49.548 [TRACE] [ding.caddx.internal.CaddxCommunicator] - CaddxCommunicator.handleAsciiProtocol() Got message length 3
10:59:49.579 [TRACE] [ding.caddx.internal.CaddxCommunicator] - Data receiving from the serial port
10:59:49.579 [TRACE] [ding.caddx.internal.CaddxCommunicator] - CaddxCommunicator.handleAsciiProtocol() Got start byte
10:59:49.579 [TRACE] [ding.caddx.internal.CaddxCommunicator] - CaddxCommunicator.handleAsciiProtocol() Got message length 3
10:59:49.579 [TRACE] [ding.caddx.internal.CaddxCommunicator] - Offering received message
10:59:49.579 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - <-: Positive Acknowledge
10:59:49.579 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - <-: 7E 01 1D 1E 1F
10:59:49.579 [TRACE] [ding.caddx.internal.CaddxCommunicator] - CaddxCommunicator.run() Message expected. Message received
10:59:49.579 [TRACE] [dx.internal.handler.ThingHandlerPanel] - caddxEventReceived(): Event Received - org.openhab.binding.caddx.internal.CaddxEvent[source=Message: 1d Positive Acknowledge
        Message number: 1d - 29 - ↔
].
10:59:49.579 [TRACE] [ding.caddx.internal.CaddxCommunicator] - CaddxCommunicator.handleAsciiProtocol() Got message 29
10:59:49.600 [TRACE] [ding.caddx.internal.CaddxCommunicator] - Data receiving from the serial port

So even though I am sending a 60 seconds to the terminal mode the binding is not seeing that and the message has to be a specific length (tried sending 32 characters)?

Any suggestions?
Mark

Hi @Mark_VG ,

The messages should be 8 characters long.
Try the following:

actions.sendKeypadTextMessage("0","Test Mes") 
actions.sendKeypadTextMessage("8","sage    ") 

Hi

With this rule:

rule "Keypad Message Test"
when
    Item Testing_Switch received command ON
then
    val actions = getActions("caddx","caddx:keypad:e59e4935:Caddx_Alarm_Keypad")
    if (null === actions) {
        logWarn("actions", "Actions not found, check thing ID for bridge")
        return
    }
    logWarn("actions", "Entering Terminal Mode")
    actions.enterTerminalMode ()
    logWarn("actions", "Entered Terminal Mode")  
    logWarn("actions", "Sending Message")  
    actions.sendKeypadTextMessage("0","Test Mes") 
    actions.sendKeypadTextMessage("8","sage    ") 
    logWarn("actions", "Message Sent")     
end

This is what I get now:

15:15:13.983 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'Testing_Switch' changed from ON to OFF
15:15:16.765 [INFO ] [openhab.event.ItemCommandEvent       ] - Item 'Testing_Switch' received command ON
15:15:16.765 [WARN ] [org.openhab.core.model.script.actions] - Entering Terminal Mode
15:15:16.765 [DEBUG] [x.internal.handler.ThingHandlerKeypad] - Address: 192, Seconds: 0
15:15:16.781 [WARN ] [org.openhab.core.model.script.actions] - Entered Terminal Mode
15:15:16.781 [WARN ] [org.openhab.core.model.script.actions] - Sending Message
15:15:16.781 [ERROR] [.internal.handler.ScriptActionHandler] - Script execution of rule with UID 'keypad_message-1' failed: d != java.lang.String in keypad_message
15:15:16.781 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'Testing_Switch' changed from OFF to ON
15:15:18.655 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - ->: Keypad Terminal Mode Request
15:15:18.655 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - ->: 7E 03 2C C0 0F FE 21
15:15:18.832 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - <-: Positive Acknowledge
15:15:18.832 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - <-: 7E 01 1D 1E 1F

Also not sure how to set the Terminal Mode time?

Thanks
Mark

I don’t like the following line.

And also from the log excerpt I do not see if the

logWarn("actions", "Message Sent")   

has been executed or the rule has been aborted.

Changed rule with more logging:

rule "Keypad Message Test"
when
    Item Testing_Switch received command ON
then
    val actions = getActions("caddx","caddx:keypad:e59e4935:Caddx_Alarm_Keypad")
    if (null === actions) {
        logWarn("actions", "Actions not found, check thing ID for bridge")
        return
    }
    logWarn("actions", "Entering Terminal Mode")
    actions.enterTerminalMode (120)
    logWarn("actions", "Entered Terminal Mode")  
    logWarn("actions", "Sending Message")  
    actions.sendKeypadTextMessage("0","Test Mes") 
    logWarn("actions", "Message1 Sent")
    actions.sendKeypadTextMessage("8","sage    ")
    logWarn("actions", "Message2 Sent") 
 
end

Logs as follows:


17:50:16.585 [INFO ] [openhab.event.ItemCommandEvent       ] - Item 'Testing_Switch' received command ON
17:50:16.585 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'Testing_Switch' changed from OFF to ON
17:50:16.616 [WARN ] [org.openhab.core.model.script.actions] - Entering Terminal Mode
17:50:16.616 [DEBUG] [x.internal.handler.ThingHandlerKeypad] - Address: 192, Seconds: 0
17:50:16.616 [WARN ] [org.openhab.core.model.script.actions] - Entered Terminal Mode
17:50:16.616 [WARN ] [org.openhab.core.model.script.actions] - Sending Message
17:50:16.616 [ERROR] [.internal.handler.ScriptActionHandler] - Script execution of rule with UID 'keypad_message-1' failed: d != java.lang.String in keypad_message
17:50:16.940 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - <-: Zone Status Message [Zone: 21]
17:50:16.940 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - <-: 7E 08 84 14 08 58 13 F0 00 02 07 04
17:50:16.940 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - ->: Positive Acknowledge
17:50:16.940 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - ->: 7E 01 1D 1E 1F
17:50:16.940 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'PIR_Cottage_Bedroom_21' changed from OPEN to CLOSED
17:50:17.002 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - <-: Zones Snapshot Message
17:50:17.002 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - <-: 7E 0A 85 01 80 10 80 00 00 00 00 00 A1 26
17:50:17.002 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - ->: Positive Acknowledge
17:50:17.002 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - ->: 7E 01 1D 1E 1F
17:50:20.008 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - ->: Keypad Terminal Mode Request
17:50:20.008 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - ->: 7E 03 2C C0 0F FE 21
17:50:20.211 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - <-: Positive Acknowledge
17:50:20.211 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - <-: 7E 01 1D 1E 1F

Rule gets aborted before executing command.