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

Trigger lights between a range of times


amatt
 Share

Question

I have a Home center Lite. My motion sensor to turn on my lights if it is between a certain lux in the room and if motion it detected. I have it set to not turn on the lights if it detects 0 lux in the room. This can be good for sleeping but what if it gets dark at 6pm with 0 lux in the room but I'm not ready for bed and want the lights to trigger with motion.

 

Does anyone know of a solution to only run my scene i created between a certain range of times during the day? thanks for the help

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Sorry I can't help you, but I'm bumping this topic to hopefully someone else has a solution for it.

Link to comment
Share on other sites

  • 0

I'd use global variable like isDay and switch it in specified times (e.g. 7:00am - isDay = 1; 8:00pm - isDay = 0) and add it to the condition.

  • Like 1
Link to comment
Share on other sites

  • 0

I have this in Lua but use a similar approach as rozum

I use a global variable called TOD_Light and switch it between day and night using lux levels - this is done In one scene and I then leverage this global variable in multiple other scenes

Link to comment
Share on other sites

  • 0

Ah yes I guess that can be used by amatt.

I now see I meant it differently than amatt: I want to turn off light at a random time between 23:00 and 23:59 when I'm on holiday. I guess it needs to be done with math.random Lua function.

Link to comment
Share on other sites

  • 0

Ah yes I guess that can be used by amatt.

I now see I meant it differently than amatt: I want to turn off light at a random time between 23:00 and 23:59 when I'm on holiday. I guess it needs to be done with math.random Lua function.

 

You need HC2 (lua) for this. Let the math.random each morning generate random time (global variable - minutes) between 0-59 and compare times as triggers.

Link to comment
Share on other sites

  • 0

I have HC2 so that's not a problem, but i'm not familiar with the math.random function. I'm going to see if I can make it work.

 

Edit:

Ah I found it already:

 

Let a scene create a random number on a specific time:

Please login or register to see this code.

Then, create another scene with the following code:

Please login or register to see this code.

Edit2:

Seems it generates the same number everytime. I think I've seen it here sometime, gonna search for it.

Maybe this is usefull for you too amatt.

 

Edit3:

Right, added one extra thing. Thanks to petergebruers :

Please login or register to see this link.

Please login or register to see this code.

Link to comment
Share on other sites

  • 0
  • Inquirer
  • rozum, i followed your suggestion. When setting the active to 1 and the inactive to 0. With 1 being day time (when i wake up) and 0 being the inactive time (when i go to sleep) [see screenshots]. I created a scene when a specific time (9:30) then active = 1 and i created another scene when a specific time (22:00) then inactive = 0 [see screenshots]. I created another scene to trigger the lights come on when motion is triggered in the room [see screenshots]. 

     

    What am i doing wrong?

     

     

    Please login or register to see this link.

     

    Please login or register to see this link.

     

    Please login or register to see this link.

     

    Please login or register to see this link.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 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

    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.

     Share

    ×
    ×
    • Create New...