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

New Scene help please


jaclarkaus

Question

Created a command to turn on a light at a certain time, then turn off sometimes later (in this example 3 minutes for testing)

The scene won't start at the time, but if I click 'run' the light turns on, then off at the right interval.

Not sure what's wrong.

Do you need to 'run' for it to start, or should it start at the selected time? If so, not sure why it turns on the light when I press 'run'

Please login or register to see this attachment.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0
Guest Lode

Did you mark "Start when Home Center 2 starts" in the general screen from your scene ?

Link to comment
Share on other sites

  • 0
Guest Lode

Can you convert it to lua and post it ?

I made exactly the same scene and it works.

Link to comment
Share on other sites

  • 0
  • Inquirer
  • % autostart

    %% properties

    %% globals

    --]]

    local sourceTrigger = fibaro:getSourceTrigger();

    if (sourceTrigger["type"] == "autostart") then

    while true do

    local currentDate = os.date("*t");

    local startSource = fibaro:getSourceTrigger();

    if (

    ( ((currentDate.wday == 1 or currentDate.wday == 2 or currentDate.wday == 3 or currentDate.wday == 4 or currentDate.wday == 5 or currentDate.wday == 6 or currentDate.wday == 7) and string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) == "12:03") )

    )

    then

    fibaro:call(4, "turnOn");

    fibaro:sleep(30000);

    fibaro:call(4, "turnOff");

    end

    fibaro:sleep(60*1000);

    end

    else

    local currentDate = os.date("*t");

    local startSource = fibaro:getSourceTrigger();

    if (

    startSource["type"] == "other"

    )

    then

    fibaro:call(4, "turnOn");

    fibaro:sleep(30000);

    fibaro:call(4, "turnOff");

    end

    end

    Link to comment
    Share on other sites

    • 0
    % autostart

    %% properties

    %% globals

    --]]

    Try this

    [[--

    %% autostart

    %% properties

    %% globals

    --]]

    I hope it helps you further.

    Link to comment
    Share on other sites

    • 0
    Guest Lode

    Think he forgot to copy that....

    Can't see what could be wrong here

    Please login or register to see this image.

    /emoticons/default_icon_curve.gif" alt=":-/" />

    Try to delete the scene and build it again.....

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