OpenHab2 and Linear NGD00Z-4 Garage Door Controller

zwave
z-wave
linear
Tags: #<Tag:0x00007f0155cc7240> #<Tag:0x00007f0155cc7010> #<Tag:0x00007f0155cc6ea8>

(cporourke) #42

@5iver you seem to be the guy to ask!

I’ve attempted to get this working but I seem to be running into an issue I don’t know how to fix. This is the readout I’m getting from the log:

16:56:16.599 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Garage_Door_Position' received command 0
16:56:18.972 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:56:28.971 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:56:38.970 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:56:48.410 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:56:48.971 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:56:58.978 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:57:08.986 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:57:18.990 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:57:28.990 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:57:38.992 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:57:48.484 [INFO ] [marthome.event.ItemStateChangedEvent] - zwave_serial_zstick_967a3cd9_serial_ack changed from 244 to 245
16:57:48.486 [INFO ] [marthome.event.ItemStateChangedEvent] - zwave_serial_zstick_967a3cd9_serial_sof changed from 485 to 486
16:57:48.524 [INFO ] [marthome.event.ItemStateChangedEvent] - zwave_serial_zstick_967a3cd9_serial_sof changed from 486 to 487
16:57:48.610 [INFO ] [marthome.event.ItemStateChangedEvent] - zwave_serial_zstick_967a3cd9_serial_sof changed from 487 to 488
16:57:48.731 [INFO ] [marthome.event.ItemStateChangedEvent] - zwave_serial_zstick_967a3cd9_serial_sof changed from 488 to 489
16:57:48.995 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:57:50.614 [INFO ] [marthome.event.ItemStateChangedEvent] - zwave_serial_zstick_967a3cd9_serial_sof changed from 489 to 490
16:57:58.997 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:58:08.999 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:58:19.004 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:58:29.004 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:58:39.010 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:58:49.024 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:58:59.014 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:59:09.024 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:59:19.031 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:59:29.037 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:59:39.038 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:59:49.043 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException
16:59:59.052 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/e2fa01c1-df2a-4423-a0a8-fc11ab67f7df/lights
java.lang.ClassCastException

Any help you can provide would be great!


(Scott Rushworth) #43

Questions to get started:

  • Are you using the test zwave binding from here?
  • Has the opener been securely included? (look in Habmin> Configuration> Things> Opener> Attributes> Using Security?.. it should be a green checkmark)
  • Do you get events in the log when you manually trigger the garage door? (From the log above, it looks like you do not have debugging turned on for the binding. Enter log:set DEBUG org.openhab.binding.zwave in the Karaf console.)

(cporourke) #44

Thanks for the quick response! I’ve started on trying the test binding. Unfortunately, the garage controller and one of my lamps have quit communicating with the controller since the change. I’m trying to fight that battle and then I’ll move forward. If I can get these issues fixed I’ll report back with my current status.


(cporourke) #45

So after hours of laboring…I finally have the test zwave binding working and the opener securely included. I ended up having to uninstall the opener, bring it next to my linux box with the z-stick plugged in and do the inclusion through habmin in order to get security to work. Your three simple questions led me down a rabbit hole that taught me a ton today. Thanks for the start!

I’ve stopped here for the night and I’ll pick up again tomorrow and provide a further update with my findings. Thanks again!


(cporourke) #46

After updating to the newest test binding, obtaining secure inclusion, turning on debugging, and chasing down only one error (which was being caused by the ghost of a forgotten node), the garage door now works flawlessly! Thanks again @5iver for the direction…it was all I needed!


(Scott Rushworth) #47

:vulcan_salute:


(Scott Rushworth) #48

@chris, I haven’t gotten a reply from @ashgupta. Should I just clean these out of the db?

http://www.cd-jackson.com/index.php/zwave/zwave-device-database/zwave-device-list/devicesummary/11


OH2 Z-Wave refactoring and testing... and SECURITY
(Chris Jackson) #49

Yep - I think it’s best. Thanks.

I’ll update your access in the database to demi-god so you can delete stuff (be careful! :wink: ).


(Scott Rushworth) #50

That made me nervous… but the alarm CC is now removed from the db entry for the NGD00Z. TY!


(shawnmix) #51

@5iver - you mentioned in the other thread (Security ZWave Binding thread) about using Lambdas now for this device. Care to elaborate or share some of what you have going on? I’m working on re-tooling some rules and simplifying some things. I have a feeling this may be useful to do with this one since I have a bunch of rules to handle things like syncing the state of the switch vs a virtual switch and the barrier position numbers.


(Scott Rushworth) #52

Sure thing! The door is controlled through the Switch item, which gets updated if the garage door is manually opened or closed. [EDIT: added handling of OPENING, STOPPED, and CLOSING states.]

ITEMS

Switch  GarageAttached_Door	                        "Garage Door (Attached) [MAP(garagedoor.map):%s]"	                <garagedoor>	(gGarageAttached,gLock,gGarageDoor)
Number	GarageAttached_Door_Position	            "Garage Door (Attached) [MAP(garagedoor.map):%s]"                   <garagedoor>	(gGarageAttached,gGarageDoor)           {channel="zwave:device:55555:node177:barrier_state"}

LAMBDA and RULE

import org.eclipse.xtext.xbase.lib.Functions

val Functions$Function2<GenericItem, String, Boolean> barrierStateParser = [
    inputItem,
    inputItemState |
    
    val actionItem = gGarageDoor.members.findFirst[item | item.name == (if (inputItem.name.contains("_Position")) inputItem.name.replace("_Position","") else (inputItem.name + "_Position"))]
    logDebug("Rules", "Lock: Garage door events: Start: input item state [{}]=[{}], initial action item state [{}]=[{}]",inputItem.name,inputItemState,actionItem.name,actionItem.state.toString)
    switch (inputItemState) {
        case "255",//open
        case "254",//opening
        case "253",//stopped
        case "252" : {//closing
            if (actionItem.state != OFF) {
                actionItem.postUpdate(OFF)
                logDebug("Rules", "Lock: Garage door events: update switch after barrier_state change [{}]=OFF",actionItem.name)
            }
        }
        case "0" : {//closed
            if (actionItem.state != ON) {
                actionItem.postUpdate(ON)
                logDebug("Rules", "Lock: Garage door events: update switch after barrier_state change [{}]=ON",actionItem.name)
            }
        }
        case "ON" : {
            actionItem.sendCommand(0)
            logDebug("Rules", "Lock: Garage door events: update barrier_state after switch state change [{}]=0",actionItem.name)
        }
        case "OFF" : {
            actionItem.sendCommand(255)
            logDebug("Rules", "Lock: Garage door events: update barrier_state after switch state change [{}]=255",actionItem.name)
        }
    }
    true
]

rule "Lock: Update garage door item states"
when
    Item GarageAttached_Door received command
    or
    Item GarageDetached_Door received command
    or
    Item GarageAttached_Door_Position changed
    or
    Item GarageDetached_Door_Position changed
then
    barrierStateParser.apply(triggeringItem as GenericItem,(if (triggeringItem.name.contains("Position")) triggeringItem.state.toString else receivedCommand.toString))//,proxyItems.get(triggeringItem.name))
end

MAP

0=CLOSED
ON=CLOSED
252=CLOSING
253=STOPPED
254=OPENING
255=OPEN
OFF=OPEN
-=Unknown
NULL=Unknown

Here is a similar example that I use for my door locks:


OH2 Z-Wave refactoring and testing... and SECURITY
Can't connect IRIS Garage Door Controller to openHABianpi
Can't connect IRIS Garage Door Controller to openHABianpi
(shawnmix) #53

Nice!! Ok I think I recall seeing you share the one for the YRD lock that I have too. :wink: This looks quite similar.


(Scott Rushworth) #54

I made a few untested updates :roll_eyes:


(Branden Smale) #55

@chris, @5iver

I have recently done a clean install on a pi3…

My NGD-00Z is now securely included, but the only channel that is showing is the barrier-state. No other channels are available. Has this been seen anywhere else?


(Scott Rushworth) #56

That is the only channel currently available. The other channels shouldn’t have been there… mostly ALARM CC, which is not supported by the opener.


(Branden Smale) #57

Didnt realize it changed, my bad…i see you have added a lamda, do you use oh2? does the lamda go in a rules file?


(Scott Rushworth) #58

Yes, currently 2.3.0 snapshot 1181.

Yes. There are plenty of posts with details on the use of lambdas, if you need it, but basically put it after any global variables.


(Branden Smale) #59

thanks scott


(Branden Smale) #60

i have no clue why i have such issues with this darn thing. cannot communicate, but it is securely included.


(Scott Rushworth) #61

Is it not reporting or not taking commands, or both? I think the association will get set after discovery, but you could manually set it to be sure. What do you see in the log?