I am trying to disable a scene that runs in the morning, mon-fri if my Google calendar has a holiday event. My Luup code is pretty simple, but doesn’t have the desired effect. Can someone please tell me what I am doing wrong?
-- Holiday switch to disable wakeup lights
local SS_SID = "urn:micasaverde-com:serviceId:SecuritySensor1" -- Security Sensor Service ID
local armed = luup.variable_get (SS_SID, "Armed", 24)
if (armed == "1") then
luup.variable_set("urn:upnp-org:serviceId:VContainer1","Variable3","Holiday",25)
return false
else
luup.variable_set("urn:upnp-org:serviceId:VContainer1","Variable3","Work Day",25)
return true
end
I wonder if just misunderstand how this is suppose to work. I am thinking that if I have a scene that is turns on lights based on a time schedule AND it is has Luup code, if the code returns false, the scene will be overridden and not turn on the lights. If it returns true the lights will turn on. Or, am I all messed up on this?
Thanks.
Your code also looks good. I don’t use the Google calendar plug-in, but does it toggle the [tt]Tripped[/tt] state perhaps (rather than [tt]Armed[/tt])?
Thank you, I think you are correct. Trying it in Test Code with returns commented out, “Tripped” populated the variable container correctly where as “Armed” did not. I will test fully later but I think that is it. Again, thank you very much.
Thank you, I think you are correct. Trying it in Test Code with returns commented out, “Tripped” populated the variable container correctly where as “Armed” did not. I will test fully later but I think that is it. Again, thank you very much.
Regards,
Chris[/quote]
Chris –
I’m trying to do the same thing… and having the same problem. Did you get it to work?
Thanks in advance for any help you can provide.
Don
Best Home Automation shopping experience. Shop at Ezlo!