I’m going on, and it works (kind of)!
So unfortunately, it does not work with the information coming from the Vera itself, but coming from the MiniKeypad.
So what i did:
My MiniKeyPad has the ID:81.
I added this code to the startup lua code:
– Set up variable-watch for “KeyPad” Home/Away/Night/Vacation
luup.variable_watch(“TriggerScene”, “urn:micasaverde-com:serviceId:DoorLock1”,“Status”, 81)
– Process variable-watch callback for Root Device. Run scene XX
function TriggerScene()
luup.call_action(“urn:micasaverde-com:serviceId:HomeAutomationGateway1”, “RunScene”, {SceneNum = XX}, 0)
end
To make it work, you need to restart the Vera, i did it with this (instead of unplug/plug it):
http://ip_address:3480/data_request?id=reload
In my scene XX i added my luup code.
I’m working on some if/then in this luup code to run different things:
As i want to receive a message when the Home button is pressed, and a different when the Away is pressed, i need to check the variable of the Status:
local EtatClavier = 81
local SV_Id = “urn:micasaverde-com:serviceId:DoorLock1”
local EtatSwitch = luup.variable_get(SV_Id,“Status”,EtatClavier)
if (EtatSwitch == “1”) then
local httpStatusCode, content=luup.inet.wget(‘https://smsapi.free-mobile.fr/sendmsg?user=XX&pass=XX=Alarme+activee’)
elseif (EtatSwitch == “0”) then
local httpStatusCode, content=luup.inet.wget(‘https://smsapi.free-mobile.fr/sendmsg?user=XX&pass=XX&msg=Alarme+desactivee’)
end
Hope it will help someone!
BUT: if you use the Vera Web interface, or the android application, this NOT works, as the Status of the KeyPad does NOT change.