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

Hi Jossuar,

Yes, the dipswitches are all right, according to the manual (I didn’t mention the incorrect overview in your post :slight_smile: ). When it was not, also the alarm panel itself doesn’t work properly either


The 3rd card has only 8 zone’s as max (dip4) but I changed it.

Now it’s time for rigourus countermeasures. Wil disable soms expander card what you suggest. Must find some time to do that.

Thanks for your support so far. I’ll let you know.

Johan.

Just a note. dip4 is not for disabling the upper 8 zones, it is dip6 which is unpopulated.

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