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

Just out of curiosity, what module numbers are enrolled on the below drop down on your installation?

Hi
I have installed the latest version of th eBinding. Configured for the correct serial port etc (Windows 10).
Caddx Bridge shows “Online” if I use ASCII.

However when I try autodiscover nothing is found.

If I manually add things (Zone/Partition) they show Offline for ages and sometimes come ONLINE.

New to OpenHab etc, so not sure if I am missing something.

Fairly sure panel is configured correctly as I previously used HomeSeer with Rien du Preez addon.

Thanks
Mark

Hi
Hoping @jossuar ossuar will be able to help as I have now made progress and have my system working for informational purpoases but would liek to be able to send commands to the panel - which I am having no success with.

I have set a rule as follows:

rule "Chime when STAY Pressed"
when
    Item Partition1_Stay  received command ON
then
if (Partition1_ReadyToArm.state == ON) {
    logWarn("actions", "Ready to ARM is ON")
}
else {
    val actions = getActions("caddx","caddx:zone:thebridge:partition1")
    if (null === actions) {
        logWarn("actions", "Actions not found, check thing ID for bridge")
        return
    }
    logWarn("actions", "Ready to ARM is ON")
    actions.chime()
}
end

Using

caddx.things as folows:

Bridge caddx:bridge:thebridge  "Bridge"                   [ protocol="Ascii", serialPort="COM1", baudrate=9600 ] {
    Thing partition partition1 "Main House Alarm"         [ partitionNumber=1 ]
    Thing zone      zone1      "MAG Front Door 01"        [ zoneNumber=1 ]
    Thing zone      zone2      "MAG Kitchen Door 02"      [ zoneNumber=2 ]
    Thing zone      zone3      "PIR Kitchen 03"           [ zoneNumber=3 ]
    Thing zone      zone4      "PIR Lounge 04"            [ zoneNumber=4 ]
    Thing zone      zone5      "PIR Garage 05"            [ zoneNumber=5 ]
    Thing zone      zone6      "PIR Main Bedroom 06"      [ zoneNumber=6 ]
    Thing zone      zone17     "PIR Dining Room 17"       [ zoneNumber=17 ]
    Thing zone      zone23     "PIR Passage 23"           [ zoneNumber=23 ]

caddx.items as follows:

Group:Contact:OR(OPEN,CLOSED)  MotionSensors1   "Motion Sensors [%s]"   <motion>
Group:Contact:OR(OPEN,CLOSED)  Windows1         "Doors [%s]"            <door>

Group:Contact:OR(OPEN,CLOSED)  MotionSensors2   "Motion Sensors [%s]"   <motion>
Group:Contact:OR(OPEN,CLOSED)  Windows2         "Doors [%s]"            <door>

Group:Contact:OR(OPEN,CLOSED)  MotionSensors3   "Motion Sensors [%s]"   <motion>
Group:Contact:OR(OPEN,CLOSED)  Windows3         "Doors [%s]"            <door>

Group:Contact:OR(OPEN,CLOSED)  MotionSensors4   "Motion Sensors [%s]"   <motion>
Group:Contact:OR(OPEN,CLOSED)  Windows4         "Doors [%s]"            <door>

Contact   MAG_Front_Door_01     "MAG Front Door 01 [%s]"	<door>       (Windows1)  	{ channel="caddx:zone:thebridge:zone1:zone_faulted" }
Contact   MAG_Kitchen_Door_02   "MAG Kitchen Door 02 [%s]"      <door>       (Windows1)          { channel="caddx:zone:thebridge:zone2:zone_faulted" }
Contact   PIR_Kitchen_03        "PIR Kitchen 03 [%s]"           <motion>       (MotionSensors1)  { channel="caddx:zone:thebridge:zone3:zone_faulted" }
Contact   PIR_Lounge_04         "PIR Lounge 04 [%s]"            <motion>       (MotionSensors1)  { channel="caddx:zone:thebridge:zone4:zone_faulted" }
Contact   PIR_Garage_05         "PIR Garage 05 [%s]"            <motion>       (MotionSensors1)  { channel="caddx:zone:thebridge:zone5:zone_faulted" }
Contact   PIR_Main_Bedroom_06   "PIR Main Bedroom 06 [%s]"      <motion>       (MotionSensors1)  { channel="caddx:zone:thebridge:zone6:zone_faulted" }
Contact   PIR_Diningroom_17     "PIR Diningroom 17 [%s]"        <motion>       (MotionSensors1)  { channel="caddx:zone:thebridge:zone17:zone_faulted" }
Contact   PIR_Passage_23        "PIR Passage 23 [%s]"           <motion>       (MotionSensors1)  { channel="caddx:zone:thebridge:zone23:zone_faulted" }

Switch    Partition1_Armed      "Armed [%s]"            <house>   { channel="caddx:partition:thebridge:partition1:partition_armed" }
Switch    Partition1_EntryGuard "Entry Guard [%s]"      <house>   { channel="caddx:partition:thebridge:partition1:partition_entryguard" }
Switch    Partition1_ReadyToArm "Ready to Arm [%s]"     <house>   { channel="caddx:partition:thebridge:partition1:partition_ready_to_arm" }
Switch    Partition1_PreviousAlarm "Previous Alarm [%s]"     <house>   { channel="caddx:partition:thebridge:partition1:partition_partition_previous_alarm" }
Switch    Partition1_Stay       "Arm is STAY [%s]"      <house>   { autoupdate="false" }

and .sitemap:

sitemap alarm label="Alarm at 59" {
    Frame label="Main House" {
    Text item=Partition1_Armed
    Text item=Partition1_EntryGuard
    Text item=Partition1_ReadyToArm
//    Text item=Partition1_PreviousAlarm
//    Switch item=Partition1_Armed
//    Switch item=Partition1_EntryGuard
     Switch item=Partition1_Stay mappings=[ON="STAY"]

    Text item=MotionSensors1
        Text label="Motion Sensors (detailed)" {
            Text item=PIR_Kitchen_03
            Text item=PIR_Lounge_04
            Text item=PIR_Garage_05
	    Text item=PIR_Main_Bedroom_06
	    Text item=PIR_Diningroom_17
	    Text item=PIR_Passage_23
        }

    Text item=Windows1
        Text label="Windows (detailed)" {
            Text item=MAG_Front_Door_01
            Text item=MAG_Kitchen_Door_02
        }
    }

I am however now able to get the rule to send any command to the panel as the getActions() returns NULL

2020-09-16 17:21:22.621 [WARN ] [lipse.smarthome.model.script.actions] - Actions not found, check thing ID for bridge

I assume this is because I am using the incorrect thing?

Tried to follow the examples at https://github.com/jossuar/openhab2-addons/tree/caddx_actions/bundles/org.openhab.binding.caddx#rule-actions however the rule examaple does not tie in with the .things and .items in the article.

Would appreciate any guidance as to what I am doing wrong and hwo I go about sending commands such as stay(), exit(), disarm(String pin) to a specific partition.

Many Thanks
Mark

Mark, I think your issue lies with this statement. If you wish to call an action on a partition thing, try this instead:

val actions = getActions("caddx","caddx:partition:thebridge:partition1")

@manjestic Thank you. Tried that but still get the same error:

 2020-09-17 06:03:54.646 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'caddx.rules'
2020-09-17 06:03:56.646 [WARN ] [lipse.smarthome.model.script.actions] - Actions not found, check thing ID for bridge

@jossuar, @manjestic So I have no redone my entire config using the discovered things and linked items etc. Have my interface back up and running fully - updating Zone faults, Ready to Arm, Armed, Entry Guard etc.

Have tried the rule again however edited to use the eaxt same syntax as the exapmple provided other than using my Bridge ID:

rule "Arm in STAY"
when
    Item Partition1_Stay  received command ON
then
if (Partition1_ReadyToArm.state == OFF) {
    logWarn("actions", "Ready to ARM is OFF")
}
else {
    val actions = getActions("caddx","caddx:zone:e59e4935:zone5")
    if (null === actions) {
        logWarn("actions", "Actions not found, check thing ID for bridge")
        return
    }
    logWarn("actions", "Ready to ARM is ON" + actions)
    actions.chime()
}
end

However still no result from getActions()

2020-09-17 11:47:42.458 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'caddx.rules'
2020-09-17 11:48:10.474 [WARN ] [lipse.smarthome.model.script.actions] - Actions not found, check thing ID for bridge

ANY ides would be greatly appreciated.

Mark

Hi @Mark_VG,

did you manually install the binding from the link in the 1st post above or do you use the binding which is bundled with the openhab distribution?

@jossuar Hi. I added the file from the link above to the addons folder - but seemed to be the same version as I had.

New to this - can you tell me how to make sure I am running the downloaded one?

On what OS you running openhab?
What openhab version? [openahb-cli info]
Did you install the binding from the PaperUI?

Running on Windows 10
INFO:

Karaf
Karaf version 4.2.7
Karaf home C:\openHAB2\runtime
Karaf base C:\openHAB2\userdata
OSGi Framework org.eclipse.osgi-3.12.100.v20180210-1608

JVM
Java Virtual Machine OpenJDK 64-Bit Server VM version 25.265-b11
Version 1.8.0_265
Vendor Azul Systems, Inc.
Pid 6956
Uptime 1 hour 49 minutes
Process CPU time 2 minutes
Process CPU load 0.25
System CPU load 0.50
Open file descriptors -1
Max file descriptors -1
Total compile time 1 minute
Threads
Live threads 138
Daemon threads 74
Peak 181
Total started 2223
Memory
Current heap size 54,092 kbytes
Maximum heap size 466,432 kbytes
Committed heap size 179,712 kbytes
Pending objects 0
Garbage collector Name = ‘PS Scavenge’, Collections = 72, Time = 1.650 seconds
Garbage collector Name = ‘PS MarkSweep’, Collections = 4, Time = 1.162 seconds
Classes
Current classes loaded 16,085
Total classes loaded 16,218
Total classes unloaded 133
Operating system
Name Windows 10 version 10.0
Architecture amd64
Processors 2

I did initially install the Binding from Paper UI, but then saw there was a version on your post and added that to the addons folder.

Not sure how to activate it though - was concerned about losing all my setting if I uninstalled from PaperUI?

Got this a well:

openhab> bundle:list -s |grep caddx
213 x Active x 80 x 2.5.8 x org.openhab.binding.caddx
228 x Active x 80 x 2.5.8.202009061514 x org.openhab.binding.caddx
openhab>

@jossuar THANK YOU…
It turns out I was running TWO versions at the same time. I uninstalled the Paper UI version using:

bundle:uninstall 213

So now:
openhab> bundle:list -s |grep caddx
228 x Active x 80 x 2.5.8.202009061514 x org.openhab.binding.caddx

And my keypad just chimed… So now on to the next step - ARMING and DISARMING :slight_smile:

Perfect. :slight_smile:

@jossuar Thanks you once again for a great Binding. Have managed to get a decent system running - now just adding some noce to haves - maybe you can give some advice?

I have looked at the Channels etc, but don’t seem to see anything that can tell me what Zone last triggered a Partition - these seem to be switches ( partition_previous_alarm and partition_alarm_memory).

Is there anything I can use to get that information?

Do you know of anyway to prompt for the PIN when doing a DISARM? Don’t like th eidea of the PIN being hardcoded. Don’t seem to find an easy way to have a Popup to enter pin in Basic UI - bearing in mind I have zero coding knowledge.

Thanks again.

Hi @Mark_VG,

I suppose you will be able to see it from the log panel messages. The panel exposes all the info from the panel. Many of the channels i don’t know what they are exactly. Feel free to experiment and share your findings. :slight_smile:

I also thought of that and I’m thinking of writing a custom widget for the habpanel.

@jossuar Thank you. Will give it a bash. Would love to see a widget but have not looked at Hab Panel yet. Seemed easier to start with Basic Ui.

Hi. @jossuar So I decided to try an use the details at Input field for number/free text for openHAB UIs to input my PIN number. Have got the input part working just fine (minor formatting isue with Basic UI when switching between Mobile and Browser.

I am however having issues passing by PIN number to the alarm system. My Rule is:

rule "Partion 1 DISARM"

when

    Item Partition1_Disarm  received command ON

then

if (Partition1_Armed.state == ON) {

    logWarn("actions", "Alarm is not armed")

}

else {

    val actions = getActions("caddx","caddx:partition:e59e4935:partition1")

    if (null === actions) {

        logWarn("actions", "Actions not found, check thing ID for bridge")

        return

    }

    logWarn("actions", "Ready to ARM is ON ")

//var EnteredPin = "1234"

var EnteredPin = ScriptServiceUtil.getItemRegistry.getItem("Pin_Number")

//val String EnteredPin = ScriptServiceUtil.getItemRegistry.getItem("Pin_Number")

            logInfo("", "EnteredPin " + EnteredPin.state )

    actions.disarm(EnteredPin.state)

}

end

And when I activate I get the following in the logs:

07:38:31.950 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'Partition1_Disarm' received command ON
07:38:31.950 [WARN ] [clipse.smarthome.model.script.actions] - Ready to ARM is ON 
07:38:31.950 [INFO ] [org.eclipse.smarthome.model.script.  ] - EnteredPin 1234
07:38:31.950 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Partion 1 DISARM': An error occurred during the script execution: Could not invoke method: org.openhab.binding.caddx.internal.action.CaddxPartitionActions.disarm(org.eclipse.smarthome.core.thing.binding.ThingActions,java.lang.String) on instance: null

Variable seems to be getting correct value but not passing correctly.

Any advice?

Thanks
Mark

EDIT: Found my error:

var EnteredPin = ScriptServiceUtil.getItemRegistry.getItem("Pin_Number")

            logInfo("", "EnteredPin " + EnteredPin.state.toString)

         

    actions.disarm(EnteredPin.state.toString)

Hi @Mark_VG,

its good that you have it working.
can you please edit your post above and add code fences in the post?
It will be more readable for others. Thanks.

1 Like

Hi @ jossuar

I have made some great progress with the Caddx sytem and have even implemented a keypad type solution for the PIN number to DISARM with. Added a bit or error checking for Arming etc. to ensure smooth operation.

Used the following:

I am now struggling with getting STATUS information from the Panel to be able to see logs and Alarm Memory.

The Log Files seems to offer functionality by using the Panel_LogMessage. Most recent seems to be in Panel_LogMessage10, that entry moves to Panel_LogMessage9, etc as events occur.

The issue seems to be that some entries are “Unknown log event type received”. The only one I seemed to get correctly is the Auto-Test. Do you think they could be some issue with the Binding - the logs display correctly on the LCD Keypad using *90

Restults as follows:

Alarm Log (*90 [Master])
Close	98
01/10	13:53	P3	*
Open	1
01/10	13:49	P3	*
Auto test
01/10	13:00
Open 1
01/10	6:09	P3	*
Bypass Rest	6
01/10	6:09	P1	*
Bypass Rest	23
01/10	6:09	P1	*
Open	1
01/10	6:09	P1	*
Bypass Rest	21
01/10	5:20	P4	*
Open	3
01/10	5:20	P4	*

Log Extract from OpenHab:

2020-10-01 13:00:46.105 [vent.ItemStateChangedEvent] - Panel_LogMessage10 changed from Unknown log event type received to 01-10 13:00 Auto-test
2020-10-01 13:49:53.839 [vent.ItemStateChangedEvent] - Panel_LogMessage10 changed from 01-10 13:00 Auto-test to Unknown log event type received
2020-10-01 13:49:57.261 [vent.ItemStateChangedEvent] - Panel_LogMessage9 changed from NULL to 01-10 13:00 Auto-test
2020-10-01 13:49:57.370 [vent.ItemStateChangedEvent] - Panel_LogMessage8 changed from NULL to Unknown log event type received
2020-10-01 13:49:57.464 [vent.ItemStateChangedEvent] - Panel_LogMessage7 changed from NULL to Unknown log event type received
2020-10-01 13:49:57.558 [vent.ItemStateChangedEvent] - Panel_LogMessage6 changed from NULL to Unknown log event type received
2020-10-01 13:49:57.667 [vent.ItemStateChangedEvent] - Panel_LogMessage5 changed from NULL to Unknown log event type received
2020-10-01 13:49:57.761 [vent.ItemStateChangedEvent] - Panel_LogMessage4 changed from NULL to Unknown log event type received
2020-10-01 13:49:57.870 [vent.ItemStateChangedEvent] - Panel_LogMessage3 changed from NULL to Unknown log event type received
2020-10-01 13:49:57.964 [vent.ItemStateChangedEvent] - Panel_LogMessage2 changed from NULL to Unknown log event type received

I am using the following Sitemap entries to display the Information from the binding:

sitemap default label="HOME"
{
    Frame {  
	Default item=Panel_LogMessage10 label="Panel_LogMessage10"
	Default item=Panel_LogMessage1 label="Panel_LogMessage1"
	Default item=Panel_LogMessage2 label="Panel_LogMessage2"
	Default item=Panel_LogMessage3 label="Panel_LogMessage3"
	Default item=Panel_LogMessage4 label="Panel_LogMessage4"
	Default item=Panel_LogMessage5 label="Panel_LogMessage5"
	Default item=Panel_LogMessage6 label="Panel_LogMessage6"
	Default item=Panel_LogMessage7 label="Panel_LogMessage7"
	Default item=Panel_LogMessage8 label="Panel_LogMessage8"
	Default item=Panel_LogMessage9 label="Panel_LogMessage9"

	Default item=Panel_FirmwareVersion label="Panel_FirmwareVersion"
	Default item=Panel_PartitionStatusMessage label="Panel_PartitionStatusMessage"	
	Default item=Panel_PartitionsSnapshotMessage label="Panel_PartitionsSnapshotMessage"		
	Default item=Panel_SystemStatusMessage label="Panel_SystemStatusMessage"
	Default item=Panel_ZoneStatusMessage label="Panel_ZoneStatusMessage"
	Default item=Panel_ZonesSnapshotMessage label="Panel_ZonesSnapshotMessage"
	}
}

I also can’t seem to find an option to View the Alarm Memory using the Binding (This would be a Partition specific string I would suspect). There are no STRING values available - only SWITCHES.

The information is retrieved using *3 in each Partition. I have checked and the correct information for each Partition is displayed using the LCD Keypad.

Any assistance will be greatly appreciated.

I plan to share my setup once completed.

Thanks
Mark

Hi @Mark_VG,

The API has a mapping of event numbers to descriptions which has been implemented in the binding. Obviously this mapping is not complete. I would need the debug log and the messages displayed so that i can amend this mapping.
Last time i checked I did get in my installation “Zone bypass” and “Zone restore” events. Maybe a bug has crept in. I have to check it. Can you send me a debug log and the respective messages from the panel?

There is currently no such string. I suppose it can be constructed from the flags. For each zone you have zone_partition1, zone_partition2, … zone_partition8 and zone_alarm_memory flags.
To check i would need a debug log of the last ZoneStatusMessage which has the Alarm Memory bit set and also can you send me what is displayed on the keypad. I’m currently remote working away from home and do not have physical access to my panel to check by myself.

Another question. What openhab version are you running?