Processing extra info from door lock status using $args?


#1

1) Give a description of the problem
I’m trying to build a piston to set a virtual switch for when a door is truly secured. i.e. it is shut & the handle has been lifted up to engage the multi-point lock (UK style). I had this piston working previously under ST but didn’t migrate the lock until recently.

I can’t seem to access the extra info that I can see in the Hubitat logs that would let me determine that the lock was manually lifted. The hubitat logs show this as:

“AlarmReport(alarmLevel:1, alarmType:21,”

2) What is the expected behaviour?
Parse extra info coming from Hubitat to let me look for the “alarmType” being “21”, I can then also add extra conditions such as when a door sensor is closed etc.

3) What is happening/not happening?
I’ve tried parsing $args in my piston but I only get Null results

**4) Post a Green Snapshot of the piston!

5) Attach logs after turning logging level to Full
31/03/2023, 16:21:13 +459ms
+3ms ╔Received event [Front Door Lock].lock/physical = locked with a delay of 25ms, canQueue: true, calledMyself: false
+11ms ║RunTime initialize > 10 LockT > 1ms > r9T > 2ms > pistonT > 0ms (first state access 4 m:7 4 6)
+13ms ║Runtime (6023 bytes) initialized in 2ms (v0.3.114.20230222_HE)
+14ms ║╔Execution stage started
+21ms ║║Comparison (enum) locked changes_to (string) locked = true (0ms)
+23ms ║║Condition #2 evaluated true (6ms)
+26ms ║║Condition group #1 evaluated true (condition changed) (8ms)
+33ms ║║Executed virtual command setVariable (1ms)
+36ms ║║Null expression
+39ms ║║Executed virtual command log (2ms)
+462ms ║║Executed device command [Hall Echo].speak(Front door secured) (415ms)
+467ms ║╚Execution stage complete. (452ms)
+471ms ╚Event processed successfully (468ms)

Logs from Hubitat device:
infoFront Door Lock was locked manually [physical][21]
debugalarmv2.AlarmReport: AlarmReport(alarmLevel:1, alarmType:21, eventParameter:[], numberOfEventParameters:0, zensorNetSourceNodeId:0, zwaveAlarmEvent:0, zwaveAlarmStatus:0, zwaveAlarmType:0)

Any help much appreciated to point me back in the right direction! thank you :slight_smile:


#2

If you look at the device in the HE device page, you should be able to see everything HE knows about the device & its status. A screen shot of this would be useful.

Within WC you should then be able to set a variable as follows
set variable {data} = {{([lock :attribute])}}


#3

Thanks, okay so I can see


It looks like the string I’m after is part of the “zwtCommandsMd” string if I parse it right


#4

Hmm further reading looks like HE doesn’t allow access to the State Variables, without support for it in the driver.


#5

I found that when I was looking at a sonos device. What do you see under the current states section? The sonos device had some of the data in bath sections and I was able to extract what I needed.


#6

it might be possible to parse the data from the $currentEventDescription. That is what appears in the HE logs.

Try logging that after locking the door and see what string you get. It should be this line:

Which you could get creative with expressions to isolate the 21.


#7

Thank you, the description parsing was helpful and I’ve also found a community driver that I can start to modify to customise the messages I can send up to WebCore.

Next mini issue is when the door is already “locked” and I lift the handle the lock generates a new event but WebCore won’t process it as the device doesn’t change state. Looking at modifying the handler to toggle the state so that WebCore gets the new value correctly.

Thanks for the help :slight_smile: