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

How to create a scene that only works at night


Question

Guest Eduardo
Posted

Hello there.

I have a universal sensor with a regular motion sensor at my garage. And I would like to create a scene to turn the lights on my garage only at night when have movement and after 120s without movement the lights turn off. I was trying to do this with the sunset clock on fibaro, but not managed to get it working....

Can anyone help.

Regards

Eduardo

7 answers to this question

Recommended Posts

  • 1
Posted
Hello there.

I have a universal sensor with a regular motion sensor at my garage. And I would like to create a scene to turn the lights on my garage only at night when have movement and after 120s without movement the lights turn off. I was trying to do this with the sunset clock on fibaro, but not managed to get it working....

Can anyone help.

Regards

Eduardo

Eduardo,

1) Create a variable called 'Night' or whatever name that suits you.

2) Create a scene that sets the variable to "1" at sunset and a second scene resetting it to "0" at sunrise. Don"t forget to switch on the "Start with HC2"-option on the general tabpage.

3) Now create your scene for your garagelights and make sure that you have as one of your conditions that the variable "Night" = "1" AND the motionsensor is activated and then the lights are switched on.

  • 0
Posted

I think you could use this code:

Please login or register to see this link.

  • 0
Guest Eduardo
  • Inquirer
  • Posted

    Tks Ace02!!

    Thats almost what i need.

    But I need something that uses the sunset and sunrise time from fibaro, because here in Brasil we have daylight saving time and in the summer the lights turn on when still bright. And I don´t have a Lux sensor just movement....

    • 0
    Posted

    AS far as i know the code has both.. I am using this with sunrise and sunset.. And if You read the comments in the code, it tells how to "disable" the Lux sensor..

    Think it would work the way You want..

    • 0
    Guest Eduardo
  • Inquirer
  • Posted

    Sorry I´m very newbie in Lua, but do you think it will work with the universal sensor attached to a regular movement sensor??

    • 0
    Guest David R
  • Inquirer
  • Posted

    Hi Frank how is this done. I have had Fibaro a week and Im still trying to learn it

    Thanks

    • 0
    Guest Eduardo
  • Inquirer
  • Posted

    Hello Frank.

    I´ve tried this but no luck either. Now I chagend the universal sensor for a 4in1 aeon labs, and put the scene with the lux level...and now its working

    [ Added: 2014-10-25, 15:30 ]

    This is the scene that I tried, but doesn´t work.

    --[[

    %% autostart

    %% properties

    %% globals

    --]]

    local sourceTrigger = fibaro:getSourceTrigger();

    function tempFunc()

    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 os.date("%H:%M", os.time()+20*60) == fibaro:getValue(1, "sunsetHour")) )

    )

    then

    fibaro:setGlobal("night", "1");

    end

    setTimeout(tempFunc, 60*1000)

    end

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

    tempFunc()

    else

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

    local startSource = fibaro:getSourceTrigger();

    if (

    startSource["type"] == "other"

    )

    then

    fibaro:setGlobal("night", "1");

    end

    end

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