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

@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?

Hi @jossuar . Thanks for the reply.

I am currently running 2.5.8 Release Build.

I have enabled OpenHab debug logging as per article I found. I presume you would liek me to PM you the logs (openhab.log and events.log)? I will have to manually retrieve entries off the panel - unless there is a better/easier way?

Not 100% sure how to get you the relevant information.

Thanks
mark

Hi @Mark_VG,

You are running on windows.
First try the following to access the console:

On the console enter the following:

log:set DEBUG org.openhab.binding.caddx

When you take an action that changes a log message e.g. Auto Test, Bypass a zone, Restore a zone, Arming,… you will see DEBUG entries in openhab.log like the following:

> 19:03:03.540 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - <-: Log Event Message [Event: 16]
> 19:03:03.542 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - <-: 7E 0A 8A 10 B9 A9 61 00 07 19 16 35 D4 EA
> 19:03:03.544 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - ->: Positive Acknowledge
> 19:03:03.545 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - ->: 7E 01 1D 1E 1F
> 19:03:03.589 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - <-: Log Event Message [Event: 17]
> 19:03:03.591 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - <-: 7E 0A 8A 11 B9 82 1C 00 07 19 16 35 69 42
> 19:03:03.593 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - ->: Positive Acknowledge
> 19:03:03.595 [DEBUG] [ding.caddx.internal.CaddxCommunicator] - ->: 7E 01 1D 1E 1F

I’m interested in the byte sequences of the Log Event Message entries and the corresponding info on the panel. (The last 10 entries)

Hi @jossuar

Thanks you. I have PM’d you the logs etc. Hope its what you need.

Mark

Thanks,
i will have a look during the next days.

Hi @Mark_VG,

I’m curious about your panel model and firmware version.
The Log event message is according to the manual 10 bytes long, but your panel sends 17 bytes. Fortunately the 10 first bytes are the same as far as i can tell.
Also are you located in the US, Europe or elsewhere?

Please check with the following binding and the log messages should be displayed.
https://github.com/jossuar/openhab2-addons/releases/download/v1.3.0/org.openhab.binding.caddx-2.5.9-SNAPSHOT.jar
Delete the old file from the addons folder and add Add the above version. Openhab should automatically in the next few seconds notice the change and restart the binding.

Thanks for the info and the testing.

Hi @jossuar

Thanks so much for getting back to me so quickly. I will download the new version and give it a try and feedback.

I am is South Africa and the Panel Details are: NZ-8-ZA-TK and from the binding the Firmware Version is 5.38

I have a copy of the Installation Manual and could send you a scan of any info that might help?. Just not sure where to look.
Cheers
Mark

EDIT: The logs now seems to display correctly - only weird this is there is now a special character after the Firmware Version? - 5.38�

EDIT 2: The special character resolved after restarting the OpenHab services on Windows… Also battled with the new version till then. Seems to hold the older bindings etc till the service is restarted. Was getting all sorts of errors with sending commands etc. Will have to remember to restart after any upgrades etc.

Hi @Mark_VG,

Yes you need to restart due to the binding missing the actions workaround: https://github.com/openhab/openhab-addons/issues/8116.

I did not implement it because all new contributions will be first against version 3.0, for which the workaround will not be needed. (i think)

Hi @jossuar

Just wanted to thank you again for the great work. I have been very happy with what I have been able to achieve with your assistance and the community in a short while. Had been really frustrated with my previous solution - especially since the plugin was no longer supported.

With your latest build I am now able to see the log entries. I have also upgraded openHAB to 2.5.9 with no issues.

My current challenges (for which any feedback/advise would be appreciated are:

  1. To be able to see the “Triggered Alarm” information such as:
    a) Triggered Partition
    b) Triggering Zones
    c) Time of event (though not sure this is available as I do not see on *3 on Keypad

    I have looked at the status messages etc, but these all seem to be switches and not messages back - so not sure where to get the information

  2. Display an alarm event similar to above and also send notification. I presume the notification would involve the openHAB cloud connector which I have not looked as as yet.

  3. Find a reliable and usable User Interface for use on PC as well as Mobile Device. Both my sitemap and HABpanel attempts have shortcomings. The SiteMap/Basic UI seems most functional - though limited to 2 columns and on mobile have to set the browser to use “Desktop” mode each time. My HABpanel attempt looks great on PC and then terrible on mobile - so no happy medium so far.

  4. Integrate with Google Assistant - though concerned about security etc.

I have managed to implement two different keypad solutions (BasicUI and HABpanel) using the following:

HABpanel:

BasicUI:

So these look like this:
BasicUI:

HABPanel:

As I mentioned - any and all suggestion will be greatly appreciated.

Mark

Have a look at the following design pattern:

I suppose you could put all the zones in a group and iterate the members to find which zones have the Alarm Memory flag set. From this info you could build a string for display.

Hi @jossuar

Appreciate the suggestion. Have had a read through and looked feasible. However I still am not getting any results.

For testing I have Partition 3, which has a single Zone connected (Zone 18). This Partition has recent alarm activity (*3 on Keypad gives Zone 18).

I have created items for Partition 3 Alarm Memory as well as Zone 18 Alarm Memory (PIRCEILING) and displayed them. Both are switches which are OFF. Did the same test with Partition 2, which also has recent alarm when checked with *3, however both the Partition and Zone Alarm Memories are OFF.

IS there not a possibility that maybe some of these switch items should be STRING maybe? (See that under a Zone there is a Name item - would expect this to be a STRING possibly?)

EDIT: This is a STRING and is now displaying the correct name

My sitemap looks like this:

    Frame label="Testing" {
    Default item=BXSIDEBEDROOM_AlarmMemory label="BXSIDEBEDROOM_AlarmMemory"
    Default item=Partition2_AlarmMemory label="Partition2_AlarmMemory"
    Default item=VXCOTTAGE_AlarmMemory label="VXCOTTAGE_AlarmMemory"
    Default item=Partition3_AlarmMemory label="Partition3_AlarmMemory"
    Default item=PIRCEILING_AlarmMemory label="PIRCEILING_AlarmMemory"
    Default item=PIRCEILING_Name label="PIRCEILING_Name [%s]"
    } 

All of these are displayed as SWITCHES which are OFF.

Any other suggestions?

Thanks
Mark

Hi @Mark_VG,

add also the zone_faulted channel. If i remember correctly, without it, the thing does not get online and the rest of the channels do not get updated.

Hi @jossuar

Thanks. I am already using the Zone Faulted channel and can see any activity on a Zone etc. So doing a walktest around the house and monitoring on OpenHab with e Caddx Binding works well.

Mark

Hi@jossuar

Also just wanted to check that I am still using the correct Binding version:

openhab> bundle:list -s|grep caddx
238 x Active x  80 x 2.5.9.202010052003      x org.openhab.binding.caddx
openhab>

I am trying to silence an alarm using the following:

import org.eclipse.smarthome.model.script.ScriptServiceUtil

rule "Silence Alarm"
when
    Item Silence_Alarm  received command ON
then
if (Pin_Number.state.toString == "" ) {
    logWarn("actions", "Please enter PIN")
            Alarm_Feedback.postUpdate("Please enter PIN")
            createTimer(now.plusSeconds(5), [
            Alarm_Feedback.postUpdate("")
        ])
}
else
{
    val actions = getActions("caddx","caddx:panel:e59e4935:panel")
    if (null === actions) {
        logWarn("actions", "Actions not found, check thing ID for bridge")
        return
    }
    var EnteredPin = ScriptServiceUtil.getItemRegistry.getItem("Pin_Number")
            logInfo("", "EnteredPin " + EnteredPin.state.toString)
       
    actions.turnOffAnySounderOrAlarm(EnteredPin.state.toString)
    Pin_Number.postUpdate("")
}
end

But get the following error when using the panel level:

14:35:33.837 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Silence Alarm': Instance is not a CaddxPartitionActions class.

I managed to get the function to work on the Partition Level though.

Thanks
mark