Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team

Question
dw89 8
Hi Guys,
Probably easy to you guys but I'm a bit new to scenes and could do with some help:
1) What does 'Active' Scene checkbox do? Does it mean that the first trigger bit of code runs automatically?
So far I've unchecked the Active box and when I did the test on something simple and pressed 'run' it looks like it bypassed the IF statement and just executed the commands e.g. turn off this turn off that. Could someone explain what does what quickly for me? I looked in the manual and couldn't find it and I've not found a post which explains so far.
2) I wrote this basic LUA just to check if something's on first before wasting time shutting it off but I keep getting an error saying '= expected before tonumber' or something like that. Makes no sense to me so I commented that out and then it's doing it near _luxValue! Arrgh. What's wrong please?
--[[
%% properties
%% globals
--]]
-- Random vars
-- Random vars
local _id1 = 9;
local _luxValue = fibaro:getValue(_id1, "value");
-- Plant Room vars
local _id2 = 13;
local _isLabgearOn = fibaro:getValue(_id2, "value");
local _id3 = 47;
local _isMatrixOn = fibaro:getValue(_id3, "value");
local _id4 = 48;
local _isNetmonOn = fibaro:getValue(_id4, "value");
local _id5 = 50;
local _isPOEOn = fibaro:getValue(_id5, "value");
local _id6 = 49;
local _isNetgearSwOn = fibaro:getValue(_id6, "value");
-- Ground FLoor vars
local _id7 = 53;
local _isKuroOn = fibaro:getValue(_id7, "value");
local _id8 = 54;
local _is875On = fibaro:getValue(_id8, "value");
--local _id9 := 9;
--local _isSubOn := fibaro:getValue(_id9, "value");
-- Basement Lounge vars
local _id10 = 4;
local _isTVOn = fibaro:getValue(_id10, "value");
local _id11 = 11;
local _isAVROn = fibaro:getValue(_id11, "value");
local _id12 = 41;
local _isPowerStripOn = fibaro:getValue(_id12, "value");
local _id13 = 19;
local _isLoungePCOn = fibaro:getValue(_id13, "value");
--end set locals
local startSource = fibaro:getSourceTrigger();
IF (_luxValue) <= "130"
OR startSource["type"] == "other"
THEN
--IF tonumber(_luxValue) <= 130 THEN
-- if its less than this it is night time
IF _isLabgearOn == TRUE THEN
fibaro:call(_id2, "turnOff");
fibaro:sleep(500);
END
IF _isMatrixOn == TRUE THEN
fibaro:call(_id3, "turnOff");
fibaro:sleep(500);
END
IF _isNetmonOn == TRUE THEN
fibaro:call(_id4, "turnOff");
fibaro:sleep(500);
END
IF _isPOEOn == TRUE THEN
fibaro:call(_id5, "turnOff");
fibaro:sleep(500);
END
IF _isNetgearSwOn == TRUE THEN
fibaro:call(_id6, "turnOff");
fibaro:sleep(500);
END
IF _isKuroOn == TRUE THEN
fibaro:call(_id7, "turnOff");
fibaro:sleep(500);
END
IF _is875On == TRUE THEN
fibaro:call(_id8, "turnOff");
fibaro:sleep(500);
END
--IF _isSubOn == TRUE THEN
-- fibaro:call(_id9, "turnOff");
-- fibaro:sleep(500);
--END
IF _isTVOn == TRUE THEN
fibaro:call(_id10, "turnOff");
fibaro:sleep(500);
END
IF _isAVROn == TRUE THEN
fibaro:call(_id11, "turnOff");
fibaro:sleep(500);
END
IF _isPowerStripOn == TRUE THEN
fibaro:call(_id12, "turnOff");
fibaro:sleep(500);
END
IF _isLoungePCOn == TRUE THEN
fibaro:call(_id13, "turnOff");
fibaro:sleep(500);
END
ELSEIF
fibaro:log("Value is: " .. isPowerStripOn ..);
fibaro:log("Value is: " .. isLabgearOn ..);
fibaro.log("Scene will not run as day time")
END
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.