I am trying to unlock a door using Luup code in a scene and need some help.
I have tried this code and in the GUI it turns on the Unlocked button but the door remains locked.
luup.variable_set(“urn:micasaverde-com:serviceId:DoorLock1”,“Status”,“0”,145)
The internal implementation for the SetTarget function will attempt to unlock the door, and if it’s successful it will set Status to 0, updating the GUI.
Thanks futzle for you help but that still doesn’t work. I don’t get any error when saving the scene but activating it does nothing. The door lock icon does not turn green indicating a received command.
Thanks mcvflorin. (In my defence, I was messing about with JavaScript this morning. Lua syntax just doesn’t stick with me. Square brackets and quotes, or neither. One day I’ll remember.)
Thanks mcvflorin, that works. Now I can finally simplify the need to send a 10 second delayed unlock command to my Schlage locks after I enter a valid door code and my virtual “WeAreHome” flag is set. I don’t know of any other way of turning off the “after 5 seconds re-lock the door” factory setting.
function unlockdelay()
luup.call_action(“urn:micasaverde-com:serviceId:DoorLock1”, “SetTarget”, { newTargetValue = “0” }, 145)
end