Please help me understand zwave lock inclusion/exclusion and secure install

Tags: #<Tag:0x00007f2fc08ade18>

I will give it a try whe I get home, thanks. Is distace an issue?

Only with some older devices.

I have successfully included the the lock through habmin as described, but it still shows that “Using security” with the red x


What am I missing?

I got it, I don’t think I was excluding it properly because it continued to add the same node5 value each time I included it. Now it reads node6 and has the Using security with the green check. Now to see if I can get my code, or do is it called script here, correct.

I have gotten some of this to work. I can lock and unlock through both HABmin and Control under PaperUI.

I created these items:

Switch Z_Wave_Front_Door_Lock “Front Door Lock” [“Switchable”] { channel=“zwave:device:Zstick:node6:lock_door” }

Number Z_Wave_Front_Door_Lock “Battery [%.0f%%]” { channel=“zwave:device:Zstick:node6:battery-level” }

And a Sitmap:
Switch item=Z_Wave_Front_Door_Lock

It gives a basic ui that looks like this;
image

I can not control the lock from basicUI and the locked unlocked does not seam to change. I have read some posts about map transformation. Is this something I need to do to control the lock or am I missing something else. Please elaborate with the response as I am not understanding what the next steps are.

Sorry for the way the code pasted, I am not sure how others are doing it so nicely.

Switch Z_Wave_Front_Door_Lock “Front Door Lock” [“Switchable”] { channel=“zwave:device:Zstick:node6:lock_door” }

Number Z_Wave_Front_Door_Lock “Battery [%.0f%%]” { channel=“zwave:device:Zstick:node6:battery-level” }

Your items need to have different names.

Switch Z_Wave_Front_Door_Lock “Front Door Lock” [“Switchable”] { channel=“zwave:device:Zstick:node6:lock_door” }

Number Z_Wave_Front_Door_Lock_Battery “Battery [%.0f%%]” { channel=“zwave:device:Zstick:node6:battery-level” }
1 Like

With Chrome there is some white space in the reply header which is where many of the “fences” are hiding. The “item fences” is visible just to left of that white space, but all of the others are not visible (rules, sitemap, javascript, code). You can hover your mouse in that area to find them and to use them. Just click on them even though they are not visible.

1 Like

Thank you for all the responses, I have door lock that I can control for BasicUI but something strange has happened. I seam to have a duplicate lock and not sure how it got there or how to fix it. Both seem to operate the lock but only one updates at a time.


Here are my items

Switch Z_Wave_Front_Door_Lock "Front Door Lock" ["Switchable"] { channel="zwave$
Number Z_Wave_Front_Door_Lock_Battery "Battery [%.0f%%]" <battery> { channel="z$

And here is my sitemap

Switch item=Z_Wave_Front_Door_Lock

Text item=Z_Wave_Front_Door_Lock_Battery label="Front Door"

And my BasicUI

Does it matter that this duplication of the lock and battery show up in HABmin? If so what caused it and how do I fix it?

Do you have Simple Mode enabled? Check in Paper UI under System->Configuration on the Item Linking panel.

Simple mode is enabled, yes.

Simple mode will create items automatically. That explains where those other items are coming from. If you don’t want those items created automatically, you can disable simple mode.

Will having both items in HABmin and only one physical item cause problems? It seams to function fine for now. Is it possible to remove the item that was automatcly populated?

No, it won’t cause a problem.

I don’t know. I’ve never used this feature.

Thank you evrryone for the help. The lock is working as I had hoped!

So… The lock works almost as expected. It does not update openhab when manually locked or unlocked. Looking into it shows that I need to some coding with the Alarm_raw. This also means that I need to use a transform.
I have been following the wright up, but do not fully under stand:

I have used PaperUI to install JSONPATH and MAP Transformation. I am confused by what the: MAP (lock.map) is and what I need to do to create it.
I have create an Item that looks like this

Group:Switch:OR(OFF,ON)    gLock    "Locks [MAP(lock.map):%s]"    <lock>
Group    gLockRaw    "Locks (raw) [%s]"    <lock>
Switch    Z_Wave_Front_Door_Lock    "Lock (Front Entrance) [MAP(lock.map):%s]"    <lock>    (gLock)    {channel="zwave:device:Zstick:node6:lock_door"}
String 	  Z_Wave_Front_Door_Lock_Alarm_Raw    "Lock (Front Entrance): Alarm Raw [%s]"    <shield>    (gLockRaw)    {channel="zwave:device:Zstick:node6:alarm_raw"}

The wright up also talks about an import org.eclipse.smarthome.model.script.ScriptServiceUtil being at the top the rules. Does this mean the to of all the rules or the top of my lock rules? What is this import, why do I need it and how do I get it?
Also I have a list of alrarm_raw events, but I do not know where to place them.

And always, any help or advise is appreciated.

Create a file in your ${OPENHAB_CONF} (depends on how you installed OH) named lock.map and put in the contents from my post.

You don’t need to get it… just import it at the top of the rule file (above all rules).

Those are just for reference. You lock may report something different, so you’ll need to change the lambda.

I typed quick… hopefully this is what you need!

I think I understand. I have copied your rule and added my values to it. It looks like this:

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

rule "Lock: Update lock states after alarm_raw event"
when
    Member of gLockRaw received update
then
    val actionItem = ScriptServiceUtil.getItemRegistry.getItem(triggeringItem.name.toString.replace("_Alarm_Raw",""))
    logInfo("Rules", "Lock: Alarm events: {}=[{}]",actionItem.name,triggeringItem.state.toString)
    val StringBuilder message = new StringBuilder(actionItem.name)
    switch (transform("JSONPATH","$.type",triggeringItem.state.toString)) {
        case "ACCESS_CONTROL" : {
            switch (transform("JSONPATH", "$.event", triggeringItem.state.toString)) {
                case "21", case "18", case "24" : {
                    actionItem.postUpdate(ON)
                    message.append(" updated to ON (locked)")
                }
                case "22", case "19" : {
                    actionItem.postUpdate(OFF)
                    message.append(" updated to OFF (unlocked)")
                }
//                case "6" : {
//                    actionItem.postUpdate(OFF)
//                   message.append(" was unlocked with")
//                    switch (transform("JSONPATH", "$.code", triggeringItem.state.toString)) {
//                        case "1" : {
//                            message.append(" Scott's code")
//                        }
//                        case "2" : {
//                            message.append(" Lisa's code")
//                        }
//                    }
//                }
                case "26", case "17", case "23" : {
                    actionItem.postUpdate(OFF)// jammed could mean unlocked, so I do this for safety... you may want to send an alert here too
                    message.append(" is jammed, so setting lock to OFF (unlocked)")
                }
//                case "26", case "17", case "23" : {
//                    message.append(" keypad is disabled due to too many failed codes")
//                }
                default : {
                    message.append(" unknown door lock Event, ").append(triggeringItem.state.toString)
                }
            }
            if (transform("JSONPATH", "$.event", triggeringItem.previousState(true).state.toString) == "26" && transform("JSONPATH", "$.event", triggeringItem.state.toString) != "26") {
                message.append(" and is no longer jammed")
            }
        }
//        case "BURGLAR" : {
//            //gSiren.sendCommand(ON)
//            message.append(" has detected an intruder")
//        }
        case "POWER_MANAGEMENT" : {
            message.append(" received a Power Management alarm, ").append(triggeringItem.state.toString)
        }
        default : {
            message.append(" received and unknown Type in alarmRawParser, ").append(triggeringItem.state.toString)
        }
    }
    logInfo("Rules", "Lock: Alarm events: {}", message.toString)
end

I turned the code I feel I don’t need into text.

I then created a lock.map under /etc/openhab2/transform, and copied

OFF=Unlocked
ON=Locked
undefined=Unknown
-=Unknown
NULL=Unknown

into it. The lock still ill does not update with manual activation. Any thoughts?

Put the binding into debug mode so we can see what the lock is sending (if anything) when manually operated. Enable debug logging as described in the post below, then operate the lock. If the lock is reporting its status when manually operated, you will see activity in the log file. Report back what you see in the log.

The 914TRL reports different events than the BE469, so you’ll need to adjust the switch/case statements. Here is an example…

Thank you, all of you, for help and patience. I am really trying to understand all of this. I am more of a nuts and bolts kind of guy and this stuff, though very cool, has me feeling over my head.

I looked at doc about turning on the debug. It says to enter the console, which I am guessing is the process of SSH into openhabian. I paste

log:set DEBUG org.openhab.binding.zwave

But get an error -bash: log:set: command not found
So I am guessing I am not something correctly.

I did see that activity seems to be captured in the log viewer anyway. This is what it shows.

2019-06-29 20:57:17.211 [vent.ItemStateChangedEvent] - zwave_serial_zstick_Zstick_serial_sof changed from 3520 to 3521

2019-06-29 20:57:17.244 [vent.ItemStateChangedEvent] - zwave_serial_zstick_Zstick_serial_ack changed from 1273 to 1274

2019-06-29 20:57:17.251 [vent.ItemStateChangedEvent] - zwave_serial_zstick_Zstick_serial_sof changed from 3521 to 3522

2019-06-29 20:57:17.271 [vent.ItemStateChangedEvent] - zwave_serial_zstick_Zstick_serial_sof changed from 3522 to 3523

2019-06-29 20:57:17.291 [vent.ItemStateChangedEvent] - zwave_serial_zstick_Zstick_serial_sof changed from 3523 to 3524

2019-06-29 20:57:17.321 [vent.ItemStateChangedEvent] - zwave_device_Zstick_node6_alarm_number changed from 0 to 21

2019-06-29 20:57:17.326 [vent.ItemStateChangedEvent] - zwave_device_Zstick_node6_alarm_raw changed from {"type":"0","value":"0"} to {"type":"21","value":"1"}

2019-06-29 20:57:31.720 [vent.ItemStateChangedEvent] - zwave_serial_zstick_Zstick_serial_sof changed from 3524 to 3525

2019-06-29 20:57:31.758 [vent.ItemStateChangedEvent] - zwave_serial_zstick_Zstick_serial_ack changed from 1274 to 1275

2019-06-29 20:57:31.762 [vent.ItemStateChangedEvent] - zwave_serial_zstick_Zstick_serial_sof changed from 3525 to 3526

2019-06-29 20:57:31.784 [vent.ItemStateChangedEvent] - zwave_serial_zstick_Zstick_serial_sof changed from 3526 to 3527

2019-06-29 20:57:31.794 [vent.ItemStateChangedEvent] - zwave_serial_zstick_Zstick_serial_sof changed from 3527 to 3528

2019-06-29 20:57:31.831 [vent.ItemStateChangedEvent] - zwave_device_Zstick_node6_alarm_number changed from 21 to 22

2019-06-29 20:57:31.834 [vent.ItemStateChangedEvent] - zwave_device_Zstick_node6_alarm_raw changed from {"type":"21","value":"1"} to {"type":"22","value":"1"}

I am pretty sure I changed the case values correctly for my lock.

switch (transform("JSONPATH","$.type",triggeringItem.state.toString)) {
        case "ACCESS_CONTROL" : {
            switch (transform("JSONPATH", "$.event", triggeringItem.state.toString)) {
                case "18", case "21", case "24" : {
                    actionItem.postUpdate(ON)
                    message.append(" updated to ON (locked)")
                }
                case "19", case "21" : {
                    actionItem.postUpdate(OFF)
                    message.append(" updated to OFF (unlocked)")
                }

Thank you again, and let me know what to do to help