Hi. Can anyone help?
I have 2 pieces of code (virtual switch & push notification) below and need to stitch them together.
The idea is to turn off push notifications if a virtual switch is set to ‘off’.
At the moment I’ve got the push notification code in the Luup Event section of the trigger and on it’s own works well.
So the questions are how do I merge the code and where does it go?
Thanks
run = luup.variable_get(“urn:upnp-org:serviceId:VSwitch1”,“Status”,#319)
if(run==“1”)then
return true
else
return false
end
local http = require(“socket.http”)
http.request{url = “http://www.homewave.dreamhosters.com/push/push.php?pushdevice=********************&message=Perimeter%20PIR%20Broken”}