Schlage BE469 - Zwave binding with security - missing features

@5iver Thanks for the tip on your updated post :+1: I may add add in an ‘unjammed’ notification to my setup. I also want to reorganise my notifications using Items to relay as it looks like you are doing so I may roll this feature into that larger update when/if I get some time!

As for the EVENT 6 issue you point out, I remember reading your post on this in the main thread.
I think the return at the end of my ‘BURGLAR’ case statement will mean I am not relying on the silent exception to save me from being robbed, will it not?

1.Thanks so much for your help so far, do i put the lambada and rule in the
rules folder?
2.The undefined areas means i need to configure them in openhab2 and then
they will be associated in the lambada/rule?
3. How are you doing the sms and what does that mean “
presenceMessage.append(” Scott’s code") if (Scott.state == OFF) { "

Not sure which to use your example mcquerty or scotts, i am a newbie and was looking for a setup where i just have to copy in my lock name ect… which do u guys recommend.

When I first read your lambda, my brain must have completely disregarded the returns. My post was completely in error… sorry for that!

Put the lambda and rules into the same rules file, and save it to the rules folder.

Not sure what you are asking or I’d try to help!

Our phone service has an smtp to sms gateway. I have the mail Action installed and have a rule that triggers on a String item (SMS_Notification) change, and then sends an email to our phones with the state of the string. I do something similar with Kodi and audio notifications. The rest of that is a StringBuilder that I am building for use in a log or notification. The Scott.state == OFF is checking my presence, and then updating it since my lock code was used. Owntracks works well for us, but this adds some redundancy to prevent the alarms from going off.

No problem! Thanks for your concern and for all your help getting me this far!

As @5iver mentioned above, it is not clear what you are asking here. If you are referring to the areas in my rule where I define the state as UNDEF then -
UNDEF is a Type in the OpenHAB that, to my knowledge at least, is a valid state for any Item regardless of the Item type (Switch, Dimmer, String, etc.).
Because I am overly concerned with small details I didn’t like to set the State of my lock to either ON (locked) or OFF (unlocked) if the lock reported ‘jammed’ because it is not possible to know for sure if it is actually ‘jammed’ locked or ‘jammed’ open. (Note: one could make a pretty decent guess based on the previous state and the fact that it is very likely still in the previous state if it got jammed, but) I decided to go with UNDEF to define this third ‘unknown’ state.

Long story short - if UNDEF confuses you, don’t use it - it’s not essential :slight_smile:

Hi thanks for clarification about the rule/lambada, can you guys write this up so that a newb can understand it please, I have items for lock and alarm raw, I also made a lock.map just like yours, but i get confused from post#27 the items and the transform or is the info from that post just a diff way to get status info for the lock than yours.

what does this error mean?
2017-11-05 19:49:52.089 [WARN ] [rm.AbstractFileTransformationService] - Could not transform ‘-’ with the file ‘lock.map’ : Target value not found in map for ‘-’

The state of an item is not always known by the system, especially during startup. So it is possible that the item you are trying to transform has an ‘undefined’ value. OH shows this as a ‘-’ character.
to avoid that error in the log, just add another line to your lock.map:
-=unknown

As for your other question it is not clear to me what you are asking. Could you rephrase with a problem statement and what you were expecting vs what is happening and I’m sure we can help you out.

Ok. What i would like is

  1. for the lock to report its status no matter what way its been opened or closed.
  2. to be able to tell what code/user unlocked the door( it seems like i can see this already in the event log after adding alarm_raw channel) but want to be able to see it on a site map or as an item that i cant link to imperihome service.
  3. To be able to use the info of who opened the door so i can use it in some rules.
    Know so far i have manually created the items
witch		Lock_EntranceFront_Proxy			"Front Door Lock Proxy  [MAP(lock.map):%s]"
Switch 	Lock_EntranceFront 					        "Front Door Lock [MAP(lock.map):%s]" 					        <lock>		    (gUS_EntranceFront,gLock,gSleep_Security) 	            {channel="zwave:device:zwave:node20:lock_door"}
String 	Lock_EntranceFront_Alarm_Raw	        "Front Door Lock: Alarm Raw [%s]" 			                <shield>	    (gUS_EntranceFront) 					                {channel="zwave:device:zwave:node20:alarm_raw"}
Number		Lock_EntranceFront_Alarm			"Front Door Lock Alarm [MAP(lock_alarm.map):%s]"			<lock>			(gLock_Status)		{channel="zwave:device:zwave:node20:alarm_number"}


```php
sitemap lock
{
Text label="Lock Control" icon="lock" {
				Frame label="Front Door Lock" {
					Switch item=Lock_EntranceFront  mappings=[ON=Lock, OFF=Unlocked]
					Text item=Lock_EntranceFront_Proxy
					Text item=Lock_EntranceFront_BatteryLevel
  }	
 }
}
lock_alarm.map
1=Locked manually
2=Unlocked manually
3=Locked Remotely
4=Unlocked Remotely
5=Locked with keypad
6=Unlocked with keypad
9=Auto lock
11=Jammed

lock.map
ON=Closed
OFF=Opened
-=unknown`


and the rule you posted all i did was change instances of lock1 to the name of my lock.
 the final results looks like the one posted by chris in post#27 but it stillnot reflecting a change in the site map, but i do see the change in the event logs.
I really appreciate the help as i trying to learn little by little.

I’m not really an expert on this but if you are seeing what you expect in the events.log and it is only your sitemap that is not updating then there may be a different problem unrelated to the lock scenario.

I have found that the sitemap will sometimes stop updating even if the an event is shown in the events.log file. Usually refreshing the sitemap pages will show the new status.

Not sure if I have understood correctly, but as I say, if events.log is showing the events as you would expect it may be worth searching the forum for issues regarding the sitemap not updating. Unfortunately I don’t have a answer for you on that one.

Last question lol.
so what is the difference between what you have done in terms of your rule and post# 27 as far as the part goes, site map and transform ect. and how are you receiving the info/report from whats happening with the lock

Ok I think I figured it out by playing around with your rule amd settings.

Now that you figured it out, it may help other for you to post your settings and rules.

I couldn’t get anything returned from the alarm.state, so I had to use the alarm_raw.state and use a JSON transformation on it like:

var Number event = new Integer(transform(“JSONPATH”,"$.event", zwave_device_15e8fca79dd_node25_alarm_raw.state.toString))

in the rule in the first line.

I added this line to my Rules now I get an error in the openhab log:
no viable alternative at input ‘â’
[578,50]: missing ‘)’ at ‘JSONPATH’
[578,71]: mismatched input ‘,’ expecting ‘end’

I figured that problem out by adding a needed space before $.event. Now I get:
Error executing the transformation ‘JSONPATH’: Invalid path ‘$.event’ in ‘zwave:device:8fe51373:node41:alarm_raw’

Here you looked here…

Although, based on the version of the ALARM/NOTIFICATION CC your lock is using, this may need to be adapted. Can you provide an example value of alarm_raw?

Here is the string in the event log:
{“notification”:“ACCESS_CONTROL__MANUAL_UNLOCK”,“type”:“ACCESS_CONTROL”,“event”:“2”,“status”:“255”}
Here is how I’m trying to get the event numberin my rule:
var Number lockevent = new Integer(transform(“JSONPATH”, “$.event”, “zwave:device:8fe51373:node41:alarm_raw”))
And here is the error I’m getting in the openhab log:
Error executing the transformation ‘JSONPATH’: Invalid path ‘$.event’ in ‘zwave:device:8fe51373:node41:alarm_raw’
I’m trying to get the event number from the string and set it to a var so I can update my lock status.

You can’t access channels directly in rules like you are trying to do. You will need to create an item and link it to the alarm_raw channel. Then you can use that item’s state in your rule, like this…

var Number lockevent = Integer::parseInt(transform("JSONPATH", "$.event", Lock_EntranceFront_Alarm_Raw.state.toString))

The error you are getting is because the string you are feeding the JSONPATH transform, “zwave:device:8fe51373:node41:alarm_raw”, does not contain an “event” element. But it’s also not in JSON format :wink:.

Created Item: String Lock_MF_Dining_Alarm “Front Lock Alarm” {channel=“zwave:device:8fe51373:node41:alarm_raw”}
And Updated Rule:
var Number lockevent = Integer::parseInt(transform(“JSONPATH”, “$.event”, “Lock_MF_Dining_Alarm.state.toString”))
I still have errors in the log:
2018-02-03 21:19:17.403 [ERROR] [ore.transform.actions.Transformation] - Error executing the transformation ‘JSONPATH’: Invalid path ‘$.event’ in ‘Lock_MF_Dining_Alarm.state.toString’
2018-02-03 21:19:17.404 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Front Lock Update lock states after alarm events’: For input string: “Lock_MF_Dining_Alarm.state.toString”