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
Can some one point me in the right direction? I wrote my first code today simple on/off lights scene. It showed no errors and debug was showing it was running. All devices numbers were correct so I sat back and waited for the lights to come on and.....nothing lol! Does anyone know where I went wrong? Thanks
--[[
%% autostart
%% properties
%% globals
--]]
if (fibaro:countScenes() > 1) then
fibaro:abort()
end
while true do
local currentDate = os.date("*t");
local theTime = (string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min))
fibaro:debug(theTime)
if (theTime == "06:00") then
fibaro:call(96, "turnOn")
fibaro:call(100,"turnOn");--turn table lamps on at 6am--
elseif (theTime == "06:30") then
fibaro:call(108, "turnOn"); --turn outside light on at 6.30am--
elseif (theTime == "07.30")
then fibaro:call (96, "turnOff")
fibaro:call (100, "turnOff")
--turn table lamps off @ 7.30am--
elseif (theTime == "8.00")
then fibaro:call (108, "turnOff") --turn outside light off at 8.00am--
--evening on/off--
elseif (theTime == "17.00")
then fibaro:call (96, "turnOn")
fibaro:call (100, "turnOn")--turn lamps on at 5pm--
elseif (theTime == "17.45")
then fibaro:call (108, "turnOn") -- turn outside light on at 5.45pm--
elseif (theTime == "23.00")
then fibaro:call (100, "turnOff")
fibaro:call (96, "turnOff")--turn off table lamps at 11pm--
elseif (theTime == "23.30")
then fibaro:call (108, "turnOff")--turn outside light off at 11.30pm--
end
fibaro:sleep(60 * 1000)
end
2 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.