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

Simple Variable Trigger Scenes Not Working - Please Help, Please


JamieSonegoAus

Question

Hey guys,

 

I have some simple LUA Scenes that simply don't work unless I manually click RUN. Any help would be appreciated.

 

Please login or register to see this attachment.

 

Please login or register to see this attachment.

 

 

 

Secondly, this "Goodnight" scene, breifly turns ON the lights, before turning them off??? I also have to manually run it twice before it updates the variable?

 

Please login or register to see this attachment.

 

Please login or register to see this attachment.

 

 

The all lights OFF scene works perfectly by itself.

 

 

I have a feeling I'm missing some basic understanding, thank you for your help.

 

 

Jamie

 

 

 

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Are your scenes activated? see below

 

Please login or register to see this attachment.

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Yes, all activated... Although I just noticed there is nothing listed under the "triggers" on the block page.

     

    Surely someone has made a working scene using LUA? I've found this..

     

     

     

    --[[
    %% autostart
    %% properties
    %% globals
    --]]

    local BeforeSunset = 45
    local AfterSunrise = 45

    while true do
        if (os.date("%H:%M", os.time()+BeforeSunset*60) >= fibaro:getValue(1, "sunsetHour"))
        or (os.date("%H:%M", os.time()-AfterSunrise*60) < fibaro:getValue(1, "sunriseHour"))
          then
        
            fibaro:setGlobal("nightTime", 1);
          else
            fibaro:setGlobal("nightTime", 0);
            
        end
        
        fibaro:sleep(60000);
    end

     

    It looks easy enough to change for what I want, but surely the graphic block scenes I've created should work?

    Link to comment
    Share on other sites

    • 0

    Yes, all activated... Although I just noticed there is nothing listed under the "triggers" on the block page.

     

    Surely someone has made a working scene using LUA? I've found this..

     

     

     

    --[[

    %% autostart

    %% properties

    %% globals

    --]]

    local BeforeSunset = 45

    local AfterSunrise = 45

    while true do

        if (os.date("%H:%M", os.time()+BeforeSunset*60) >= fibaro:getValue(1, "sunsetHour"))

        or (os.date("%H:%M", os.time()-AfterSunrise*60) < fibaro:getValue(1, "sunriseHour"))

          then

        

            fibaro:setGlobal("nightTime", 1);

          else

            fibaro:setGlobal("nightTime", 0);

            

        end

        

        fibaro:sleep(60000);

    end

     

    It looks easy enough to change for what I want, but surely the graphic block scenes I've created should work?

    First of all scene based time triggering doesn't have any triggers, it  just runs in continuous loop.

    If you will convert your block scene to LUA you'll see function tempFunc(), which is executed every minute by calling

    setTimeout(tempFunc, 60*1000)

    Your scene should work and change your Global variable....

    What I can suggest is to convert the scene to LUA and put some message using fibaro:debug() to see what happens.

    Your message should be printed every minute.

    Link to comment
    Share on other sites

    • 0

    This is similar to my issue that i am having on my HCL. if you search "Trigger lights between a range of times" you can find my issue.

     

    in my latest post i said:

     

    "I have tried everything and it still is not working. i even contacted support and they are not helping. This should be a simple scene but it has turned into many sleepless nights "literally". The only time it "kinda" works is when i run the inactive scene manually. but then if someone triggered it at 4:00 am the lights will come on even though i told the active scene to activate at 8:30. any help would be appreciated."

    Link to comment
    Share on other sites

    • 0

    Could you post all your scenes involved in this process.

    For example you have posted scene based on GoodnightScene variable, but where the scene which changes the value to OFF?

    Link to comment
    Share on other sites

    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...