Jump to content

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


  • 0

No running instances


Question

Posted

I converted a few "block"schemes into LUA through the system.

Now I have a few scenes without running instances so they does not start. hat is wrong? Any guidance in the right direction will be highly appriciated.

In the debug window nil

 

--[[
%% autostart
%% properties
%% weather
126 value
%% events
%% globals
--]]

timeNow                     = os.date("%H:%M")
local EveningStart          = os.date("%H:%M", os.time()-5*60)
local EveningTime           = "17:00"       
local StopHour              = "23:30"
local sourceTrigger = fibaro:getSourceTrigger();
local startSource = fibaro:getSourceTrigger();
function tempFunc()
local currentDate = os.date("*t");
local startSource = fibaro:getSourceTrigger();
--if (sourceTrigger["type"] == "autostart") then
--tempFunc()--
local GordijnVoorzijde     =  48
local GordijnVOpritijde    =  50
local GordijnFietsenzijde  =  52
local KeukenkastjePlint    =  20
local SpotKastLinks        =  10
local GordijnAchter        =  44
local GordijnZkantachter   =  46
local SpotBeeld            =  32
local LichtsterkteBuiten   = 126

if timeNow > EveningStart and timeNow < EveningTime then
    if (
 ( ((currentDate.wday == 1 or currentDate.wday == 2 or currentDate.wday == 5) and os.date("%H:%M", os.time()-18*60) == fibaro:getValue(1, "sunsetHour")) )
or
 ( ((currentDate.wday == 3 or currentDate.wday == 6) and os.date("%H:%M", os.time()-21*60) == fibaro:getValue(1, "sunsetHour")) )
or
 ( ((currentDate.wday == 4 or currentDate.wday == 7) and os.date("%H:%M", os.time()-25*60) == fibaro:getValue(1, "sunsetHour")) )
)
 or
 
( tonumber(fibaro:getValue(LichtsensorBuiten, "value")) < 25 )
 
 
then
    fibaro:call(GordijnVOpritijde, "Close");
    fibaro:debug("GordijnVOpritijde Close  ")
    
    fibaro:call(KeukenkastjePlint, "turnOn");
    fibaro:debug("KeukenkastjePlint Light On  ")
    
    setTimeout(function()
        fibaro:call(GordijnVoorzijde, "Close");
    end, 8000)
    fibaro:debug("GordijnVoorzijde Close  after 8 seconds")
    
    setTimeout(function()
        fibaro:call(SpotKastLinks, "turnOn");
    end, 15000)
    fibaro:debug("SpotKastLinks Light On after 15 seconds ")
    
    setTimeout(function()
        fibaro:call(GordijnFietsenzijde, "Close");
    end, 20000)
    fibaro:debug(" GordijnFietsenzijde Close after 20 seconds")
    
    setTimeout(function()
        fibaro:call(GordijnAchter, "Close");
    end, 28000)
    fibaro:debug("GordijnAchter Closed after 28 seconds ")
    
    setTimeout(function()
        fibaro:call(GordijnZkantachter, "Close");
    end, 34000)
    fibaro:debug("GordijnZkantachter Close after 34 seconds  ")
    
    setTimeout(function()
        fibaro:call(SpotBeeld, "turnOn");
    end, 300000)
    fibaro:debug("SpotBeeld  Light On after 30 seconds")
    
    setTimeout(function()
        fibaro:call(Vlagverlichting, "turnOn");
    end, 2700000)
    fibaro:debug("Vlagverlichting Light On after 27 seconds  ")
 
       
elseif timeNow > EveningTime and timeNow < StopHour
and ( tonumber(fibaro:getValue(172, "value")) > 7 )
     
  then    fibaro:call(GordijnVOpritijde, "Close");
    fibaro:debug("GordijnVOpritijde Close  ")
    
    fibaro:call(KeukenkastjePlint, "turnOn");
    fibaro:debug("KeukenkastjePlint Light On  ")
    
    setTimeout(function()
        fibaro:call(GordijnVoorzijde, "Close");
    end, 8000)
    fibaro:debug("GordijnVoorzijde Close  after 8 seconds")
    
    setTimeout(function()
        fibaro:call(SpotKastLinks, "turnOn");
    end, 15000)
    fibaro:debug("SpotKastLinks Light On after 15 seconds ")
    
    setTimeout(function()
        fibaro:call(GordijnFietsenzijde, "close");
    end, 20000)
    fibaro:debug(" GordijnFietsenzijde Close after 20 seconds")
    
    setTimeout(function()
        fibaro:call(GordijnAchter, "Close");
    end, 28000)
    fibaro:debug("GordijnAchter Closed after 28 seconds ")
    
    setTimeout(function()
        fibaro:call(GordijnZkantachter, "Close");
    end, 34000)
    fibaro:debug("GordijnZkantachter Close after 34 seconds  ")
    
    setTimeout(function()
        fibaro:call(SpotBeeld, "turnOn");
    end, 300000)
    fibaro:debug("SpotBeeld  Light On after 30 seconds")
    
    setTimeout(function()
        fibaro:call(Vlagverlichting, "turnOn");
    end, 2700000)
    fibaro:debug("Vlagverlichting Light On after 27 seconds  ")
end

setTimeout(tempFunc, 60*1000)
end
  end
fibaro:debug()

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...