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
Ilja 0
Hello!
I try to start learning Lua to create Nice Scene!
I can do 3 Different Scenes in Graphic to realize my idea.
But i wish do ONE with LUA Programing..
I don't have any errors, if i press button PLAY all is fine, But it work only once.
Can you please look my code and tel what i must do that this scene will be Loop.
THANKS, FOR HELP!
ILJA.
local startSource = fibaro:getSourceTrigger();
-- Set All Outside Light to 1 % - Not Veranda Becose veranda is ON by user
if (
fibaro:getGlobalValue("DayLight_Status") == "Dark" and
fibaro:getGlobalValue("Day_Status") == "Night" and
fibaro:getGlobalValue("Outside_Front") == "OFF" and
fibaro:getGlobalValue("Outside_Light") ~= "Night" and
fibaro:getGlobalValue("VerandaLight") == "On" ) then
fibaro:call(227, "setValue", "1");
fibaro:call(228, "setValue", "1");
fibaro:call(229, "setValue", "1");
-- Set All Outside Light to 1 % Becouse is to late and we save energy:)
elseif (
fibaro:getGlobalValue("DayLight_Status") == "Dark" and
fibaro:getGlobalValue("Day_Status") == "Night" and
fibaro:getGlobalValue("Outside_Front") == "OFF" and
fibaro:getGlobalValue("Outside_Light") ~= "Night" and
fibaro:getGlobalValue("VerandaLight") == "Off" ) then
fibaro:call(226, "setValue", "1");
fibaro:call(227, "setValue", "1");
fibaro:call(228, "setValue", "1");
fibaro:call(229, "setValue", "1");
fibaro:setGlobal("Outside_Light", "Night");
-- Set All Outside Light to 8 % Evening light.
elseif (
fibaro:getGlobalValue("DayLight_Status") == "Dark" and
fibaro:getGlobalValue("Day_Status") == "Day" and
fibaro:getGlobalValue("Outside_Front") == "OFF" and
fibaro:getGlobalValue("Outside_Light") ~= "Evening" )
then
fibaro:call(226, "setValue", "8");
fibaro:call(227, "setValue", "8");
fibaro:call(228, "setValue", "8");
fibaro:call(229, "setValue", "8");
fibaro:setGlobal("Outside_Light", "Evening");
end
Link to comment
Share on other sites
7 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.