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

sunset and sunrise scene


Question

Posted (edited)

Hello,
I have a motion sensor downstairs and one upstairs. I use them to turn on the stair lights for 30 seconds
The problem is I can only make it work in a time interval (block scene) but the time interval is irrelevant every other season because the day and night are changing all the time
I Try to use sunset and sunrise function but it got me nowhere.

Someone helped me with a LUA scene but that didn't work either. It's like Fibaro cannot understand that I want the light to be triggered by motion sensors only in this interval: 20 minutes after sunset and 20 minutes before sunrise. 

Here is the LUA script I have but is not working. It triggers the light all day long.

  

 

DECLARATIONS (Conditions/Triggers)

 

{
  conditions = { {
      conditions = { {
          id = 291,
          isTrigger = true,
          operator = "==",
          property = "value",
          type = "device",
          value = true
        }, {
          id = 395,
          isTrigger = true,
          operator = "==",
          property = "value",
          type = "device",
          value = true
        } },
      operator = "any"
    }, {
      conditions = { {
          isTrigger = false,
          operator = ">=",
          property = "sunset",
          type = "date",
          value = 30
        }, {
          isTrigger = false,
          operator = ">=",
          property = "sunrise",
          type = "date",
          value = -20
        } },
      operator = "any"
    } },
  operator = "all"
}

 

==========================================

ACTIONS

 

hub.call(55, 'setValue', 20)
hub.setTimeout(20000, function()
hub.call(55, 'turnOff')
end)

 

==========================================

 

 

Please help me fix this!

 

Thak you!

 

 

Please login or register to see this attachment.

Please login or register to see this attachment.

 

Edited by Razvanv
Typos

2 answers to this question

Recommended Posts

  • 0
Posted

You could work with variables: Define (a) AfterSunset and set via a scene to „True“ at Sunset plus 20 min, then set to „False“ at any time later you want. The same applies to (b) BeforeSunrise. Then use the the True/False settings in your scene to switch lights on/off.  Hope I understood your request correctly and it helps.

  • 0
Posted

As mentioned above I use Sunrise and Sunset to set a variable for day and night and then use that variable in a lot of scenes. I also use Sunset as a trigger in block scene and then a delay to turn off

 

 

 

 

Please login or register to see this attachment.

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