Mios binding with Yale Z-wave lock

I am in the process of completely having OpenHAB take over all the functions I had setup in Vera. I am trying to get
it to work with my Yale Z-Wave lock. I can open and close the lock in OpenHAB. In Vera I was able to disarm my Vista 20P alarm by entering my code in my Yale Z-Wave lock using PLEG. I would like to get that to work in OpenHAB if possible. I used the OpenHAB Item file generator to create my Item file. In OpenHAB I can view the status of the alarm and all the sensors, but I haven’t figured out how to arm and disarm it in OpenHAB. Any help would be appreciated.

OH 2? If so please add the openhab2 tag to the post.

That being said, the zwave binding only has very preliminary and experimental support for locks and does not (and probably will not in the near future) fully support the security command class so this might not be supported. @chris can confirm.

@MikeH,
If you’re still using MiOS/Vera for the Z-Wave operation, and the MiOS Item Generator was run to build your openHAB Items file, then you should see changes in the openHAB event.log file as you activate the Z-Wave Lock.

This data will be bridged over from Vera automatically via the MiOS Binding.

I only have an older/pre-production Kwikset Z-Wave (still on Vera) so I don’t get lock notifications on manual Locking/Unlocking. I’m limited (by the device) to remotely locking/unlocking it… but I can do that part from within openHAB Rules (etc).

I’m guessing that the Yale is providing additional information (again, this should come over the MiOS Binding to openHAB)

Failing that, post your MiOS/Vera rule (as custom PLEG, native Lua or a Screenshot of the MiOS Rule UI), and I’ll work it out from that.

Hi guessed,

Here is what the log file looks like when I open and close the Yale deadbolt:

 [.o.b.mios.internal.MiosBinding] - internalReceiveCommand: itemName 'FrontDoorDeadBolt', command 'OFF'
 [b.m.internal.MiosUnitConnector] - callDevice: Need to remote-invoke Device 'unit:home,device:21/service      /urn:micasaverde-com:serviceId:DoorLock1/Status' action 'OFF' and current state 'OFF')
 [t.i.s.MapTransformationService] - transformation resulted in 'urn:micasaverde-  com:serviceId:DoorLock1/SetTarget(newTargetValue=0)'
 [b.m.internal.MiosUnitConnector] - callDevice: decoded as serviceName 'urn:micasaverde-com:serviceId:DoorLock1'  serviceAction 'SetTarget' serviceParam 'newTargetValue' serviceValue '0'
 [b.m.internal.MiosUnitConnector] - callMios: Would like to fire off the URL 'http://192.168.0.23:3480 /data_request?id=action&DeviceNum=21&serviceId=urn%3Amicasaverde-com%3AserviceId%3ADoorLock1& action=SetTarget&newTargetValue=0'
 [b.m.internal.MiosUnitConnector] - processResponse: success! loadTime=1454428559, dataVersion=428578792 devices(3) scenes(0) rooms(0) sections(0)
 [b.m.internal.MiosUnitConnector] - run: URI Built was 'http://192.168.0.23:3480/data_request?id=status2& LoadTime=1454428559&DataVersion=428578792&Timeout=40&MinimumDelay=0' loop '3'
 [b.m.internal.MiosUnitConnector] - processResponse: success! loadTime=1454428559, dataVersion=428578795  devices(3) scenes(0) rooms(0) sections(0)
 [b.m.internal.MiosUnitConnector] - run: URI Built was 'http://192.168.0.23:3480/data_request?id=status2& LoadTime=1454428559&DataVersion=428578795&Timeout=40&MinimumDelay=0' loop '4'

 [.o.b.mios.internal.MiosBinding] - internalReceiveCommand: itemName 'FrontDoorDeadBolt', command 'ON'
 [b.m.internal.MiosUnitConnector] - callDevice: Need to remote-invoke Device 'unit:home,device:21/service /urn:micasaverde-com:serviceId:DoorLock1/Status' action 'ON' and current state 'ON')
 [t.i.s.MapTransformationService] - transformation resulted in 'urn:micasaverde- com:serviceId:DoorLock1/SetTarget(newTargetValue=1)'
 [b.m.internal.MiosUnitConnector] - callDevice: decoded as serviceName 'urn:micasaverde-com:serviceId:DoorLock1' serviceAction 'SetTarget' serviceParam 'newTargetValue' serviceValue '1'
 [b.m.internal.MiosUnitConnector] - callMios: Would like to fire off the URL 'http://192.168.0.23:3480/data_request?id=action&DeviceNum=21&serviceId=urn%3Amicasaverde-com%3AserviceId%3ADoorLock1&  action=SetTarget&newTargetValue=1'
 [b.m.internal.MiosUnitConnector] - processResponse: success! loadTime=1454428559, dataVersion=428578802  devices(3) scenes(0) rooms(0) sections(0)
 [b.m.internal.MiosUnitConnector] - run: URI Built was 'http://192.168.0.23:3480/data_request?id=status2&  LoadTime=1454428559&DataVersion=428578802&Timeout=40&MinimumDelay=0' loop '8'
 [b.m.internal.MiosUnitConnector] - processResponse: success! loadTime=1454428559, dataVersion=428578805 devices(3) scenes(0) rooms(0) sections(0)
 [b.m.internal.MiosUnitConnector] - run: URI Built was 'http://192.168.0.23:3480/data_request?id=status2& LoadTime=1454428559&DataVersion=428578805&Timeout=40&MinimumDelay=0' loop '9'

from the log snippet, it looks like you’re initiating the Lock/Unlock event on openHAB (a Script, or potentially from a UI), and that information is being sent over to MiOS.

For this scenario, where lock/unlock is initiated from MiOS, it’s roughly doing the right thing.

BUT, there are odd “spaces” in the log entries that I’m not expecting to see

eg. This line

[b.m.internal.MiosUnitConnector] - callMios: Would like to fire off the URL ‘http://192.168.0.23:3480/data_request?id=action&DeviceNum=21&serviceId=urn%3Amicasaverde-com%3AserviceId%3ADoorLock1& action=SetTarget&newTargetValue=1’`

has a space between “&” and “action”, which should not be there. What’s more odd is on the line a few up, there’s a different spacing (for the initial Unlock)

Can you paste the contents of your miosLockCommand.map file here along with the [generated] Item definition you have for FrontDoorDeadBolt?

The former should look like this (char for char):

ON=urn:micasaverde-com:serviceId:DoorLock1/SetTarget(newTargetValue=1)
OFF=urn:micasaverde-com:serviceId:DoorLock1/SetTarget(newTargetValue=0)

Now, from the description you had above, it’s a different problem. It sounded like you wanted to “trigger” something in openHAB (alarm activation) based upon the Keypad being used on the Lock itself (not on any openHAB UI).

In this case, I’d need to see the log snippet when you’re activating/deactivating the Lock via it’s manual Keypad. That’ll send Z-Wave commands to Vera/MiOS, and in turn these will be delivered to openHAB via the MiOS Binding, and will look totally different.

For this, we need the event.log and, only as a fallback, the openhab.log (as you’ve provided above)

Can you tell me where the event.log is. Do you change something in logback.xml to create it?
I’m not having any problem opening or closing the lock. I found out how to by playing with lines in the Item file generated by your MiOS Item Generator. I was looking for a different line in my Items file that would disarm my vista 20p alarm system when the correct code was entered into my Yale deadbolt. In Vera I have totally removed all scenes and disabled all the plegs except the one for the Yale dead bolt. I guess its no big deal if Vera is still handling it directly but I was wondering if there was a way in OpenHAB.
The miosLockCommand.map lines are"
ON=urn:micasaverde-com:serviceId:DoorLock1/SetTarget(newTargetValue=1)
OFF=urn:micasaverde-com:serviceId:DoorLock1/SetTarget(newTargetValue=0)

Item definitions are:
Switch FrontDoorDeadBolt “Front Door Dead Bolt” (GDevices,GSecurityAccess) {mios=“unit:home,device:21/service/DoorLock1/Status”}

The event.log file is in the same directory as the openhab.log. The logback.xml can be tweaked to turn it of, tweak it (etc) but that not too common.

IIRC, Vera/MiOS sends different codes/information when the Lock is activated from it’s Keypad. These will be in addition to the change in ON/OFF (Open/Closed) states, but they’re sent via different variables hanging off the same MiOS Device. These will show up as other Items changing values when the lock is manually activated (… but I’m going from memory from a few yrs back on that particular behavior as my Kwikset doesn’t have that)

This family of settings rings a bell, and only the newer MiOS Item Generator (from github) has the fixes necessary to sync these correctly… there are a few others as well:

String   GarageDeadboltSLUserCode "User Code [%d]" {mios="unit:house,device:189/service/urn:micasaverde-com:serviceId:DoorLock1/sl_UserCode"}
Number   GarageDeadboltSLUserCode_userid "User Code (ID) [%d]" {mios="unit:house,device:189/service/DoorLock1/sl_UserCode,in:REGEX(UserID=\"(.+)\" UserName=\".*\")"}
String   GarageDeadboltSLUserCode_username "User Code (Name) [%s]" {mios="unit:house,device:189/service/DoorLock1/sl_UserCode,in:REGEX(UserID=\".+\" UserName=\"(.*)\")"}