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
SanSuus 0
Hi
I want to make a scene for the bathroom that if I double click the lights will stay on for 30 minutes.This is what I have in Lua but the lights are always switch of earlier than the 30 minutes. What am I doing wrong?
thanks
--[[
%% properties
72 value
%% globals
--]]
if (fibaro:countScenes()>1) then
fibaro:abort();
end
local dimid = 72 -- ID for the dimmer you want to operate
if (tonumber(fibaro:getValue(dimid, "value"))) > 0 then
local timer = 1800;
fibaro:debug("Lights on at level "..timer);
repeat
fibaro:sleep(1000);
timer=timer-1;
fibaro:debug("Countdown, current level = "..timer);
until (timer<1)
--Once the timer has finished and dimlevel reaches 1, the light will be turned off
fibaro:call(dimid, "turnOff");
fibaro:debug("Lights out");
fibaro:killScenes(25);
end
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.