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
Sjakie 156
Hi Guys,
I am doing something wrong but can not detect what!
Can somebody please correct my scene?
The GV is created
Error message
Thanks in advance
Please login or register to see this image.
/monthly_2019_03/image.png.497709486e748ace74c7a3dba712d0c9.png" alt="image.png.497709486e748ace74c7a3dba712d0c9.png" />--[[
%% autostart
%% properties
%% globals
--]]
local sourceTrigger = fibaro:getSourceTrigger();
if (sourceTrigger["type"] == "autostart") then
local debug = true;
-- check script instance count in memory
if (tonumber(fibaro:countScenes()) > 1) then
if debug then fibaro:debug("Script already running."); end
fibaro:abort();
end
if debug then fibaro:debug("HC2 start script at " .. os.date()); end
while true do
local ochtendgloren = (os.time()+50*60) == fibaro:getValue(1, "sunriseHour")
local avondrood = (os.time()-50*60) == fibaro:getValue(1, "sunsetHour")
local currentTime = os.date("%H:%M");
local TimeOfDay = fibaro:getGlobal("TijdStip");
if ( ochtendgloren <= currentTime and currentTime < avondrood and TijdStip ~= "Ochtendgloren" )
then
fibaro:setGlobal("TijdStip", "Ochtendgloren");
if debug then fibaro:debug("Ochtendgloren"); end
elseif ( avondrood <= currentTime and currentTime < ochtendgloren and TijdStip ~= "Avondrood" )
then
fibaro:setGlobal("TijdStip", "Avondrood");
if debug then fibaro:debug("Avondrood"); end
end
fibaro:sleep(60*1000);
end
else
fibaro:debug("Script can only be run via autostart");
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.