Conditional scene for sun screen, help wanted


i’m trying to make a conditional scene to retract my sunscreen when the wind is blowing to hard.
I created a scene with the windsensor as a triger and that wordks perfect.

Only now the vera want’s to close the sunscreen all the time when the wind is above the set value.
even when the sunscreen is alreadu retracted (statu=0). i’m using a fibaro micro module to control the windscreen.

so i want to make the scene conditional, that means if the fibaro controiller (device#17) has status “0” i don’t want the scene to run.

i created a code for this based on information i found, but when i test the luup code it fails.

Can anyone help create the right code wich i can use, any help will be highly appreciated.

this is the code i got sofar

local lul_tmp = luup.variable_get("urn:schemas-micasaverde-com:device:WindowCovering:1", "Status", 17) if (lul_tmp == "0") then return false else return true end

check your service ID


hover over the Status variable and it will return the right service ID as attached

i changed the code to

local lul_tmp = luup.variable_get("urn:upnp-org:serviceId:SwitchPower:1", "Status", 17) if (lul_tmp == "0") then return false else return true end

when i test the code it says message sent.

but it looks like it has no effect on the scene

are the last three lines ok ?

The script will cancel the scene if lul_tmp == “0”

That is what you want, right?

I don’t think your Service ID is right, still. Verify the way I told you by hovering over Status on the device. It probably says:


No colon, yeah?

status is a number 0 or 1

If (lul_tmp == 0) then

you are right again.

this is the right one

local lul_tmp = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", 17) if (lul_tmp == "0") then return false else return true end

at first it didn’t work properly, because i had to reload to get working after status change.
i added the luup code to the scene.

now i removed the code from the scene and added it to the trigger.
now it’s working perfectly !!

Thank you very much for your support and guiding me in the right way.

Regards, Sjoerd

happy to help, we were all there once.

One thing to keep in mind is when you use the “Test Lua Code” bit Vera is’t really debugging like you may be accustomed.