Accessing Device Handler data WebCoRE



1) Give a description of the problem
I can’t access data from the device handler

2) What is the expected behaviour?
Access data from my device handler

3) What is happening/not happening?
I don’t know how to access the data

**4) Post a Green Snapshot of the piston![image|45x37]
I have no code yet

5) Attach logs after turning logging level to Full
Here is the data from live logging:
7:35:36 PM: info [DTH] parse() - returning result=[[name:lock, value:unlocked, isStateChange:true, descriptionText:Unlocked by “Sue”, data:[codeId:1, usedCode:1, codeName:Sue, method:keypad, lockName:Front Door], linkText:Front Door, displayed:true]]

If a solution is found for your question then please mark the post as the solution.


Which data exactly are you after?

An example is if you’re interested in descriptionText. In an Expression field you can use [device name: descriptionText]


In the case of the lock event I want to know if the lock was locked manually, from and application or from the screen. In the case of an unlocking event, I want to know how the door was unlocked. If was unlocked by a code, I want to know the code and the user name associated with the code. Otherwise I want to know if it was unlocked manually or via the app.


Is there a way to access a variable that I see defined in the log?


If it’s listed in the device attributes then there’s a good chance you can access it… in the format I showed up top: [deviceName:attribute]


OK! So it has to be in the attribute list for me to access it. That’s too bad. I guess I have to modify the device handler to create the additional attributes.


Have you investigated the contents of the $args variable? If the device handler adds ‘data’ to an event, I believe it ends up in there e.g. $args.usedCode. It’ll probably be device handler dependent to some degree.



Just to add that used.Code would probably be the index and not the actual code used.