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
Guest David R
Hello I am completely new to Fibaro and LUA and was wondering how to do an all off switch at the front door. At the minute I have it as a relay s2 activating a scene if its either switched on or off with a momentary switch. I made the scene using blocks as I am still just started out learning LUA but here it is in LUA.
%% properties
76 value
%% globals
--]]
local startSource = fibaro:getSourceTrigger();
if (
( tonumber(fibaro:getValue(76, "value")) > 0 ) --if turned on--
or
( tonumber(fibaro:getValue(76, "value")) == 0 ) --or if turned off--
or
startSource["type"] == "other"
)
then
setTimeout(function()
fibaro:call(62, "turnOff");
end, 2000)
setTimeout(function()
fibaro:call(60, "turnOff");
end, 4000)
setTimeout(function()
fibaro:call(49, "turnOff");
fibaro:call(70, "turnOff");
end, 6000)
setTimeout(function()
fibaro:call(58, "turnOff");
end, 8000)
setTimeout(function()
fibaro:call(56, "turnOff");
fibaro:call(64, "turnOff");
fibaro:call(66, "turnOff");
end, 10000)
setTimeout(function()
fibaro:call(51, "turnOff");
end, 12000)
setTimeout(function()
fibaro:call(14, "turnOff");
end, 14000)
setTimeout(function()
fibaro:call(9, "turnOff");
fibaro:call(11, "turnOff");
fibaro:call(16, "turnOff");
end, 16000)
setTimeout(function()
fibaro:call(6, "turnOff");
fibaro:call(19, "turnOff");
fibaro:call(36, "turnOff");
fibaro:call(40, "turnOff");
end, 18000)
setTimeout(function()
fibaro:call(44, "turnOff");
end, 24000)
end
Is there a better way to do this so I don't have to have on or off? Just activate scene. Remember im completely new so go easy and everybody has to learn somewhere
Please login or register to see this image.
/emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />Thanks
6 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.