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

Help needed with Light scene (Dim, then Off - trigger by SAFE motion sensor


Question

Posted

Hi.

 

Need some help with a scene as I've tried 2 separate scenes with a motion-safe trigger but the triggers overlap and the light group only dims and never turns off. Then I tried a single motion-safe trigger of a dim AND off after 300s, then this one just skips the dim and turns straight off.

 

Basically I have 2 lights that I want dim, if there is not activity in the room after 5min, and then switch off if no further activity after 5min. These lights are currently set to turn on when motion triggered.

 

Any help would be greatly appreciated!

10 answers to this question

Recommended Posts

  • 0
Posted

Can you post the scene you already have?

  • 0
  • Inquirer
  • Posted

    Sorry my scene is using blocks so I could not copy as image so here goes:

     

    Dim: Motion Sensor=Safe(300s) AND Evening TIme variable=Active AND Light Group=On THEN Light Group=OFF(value 20)

     

    Off: Light Group=20 AND Motion Sensor=Safe(300s) AND Evening Time variable=active) THEN Light Group=OFF(Value 0)

     

    p.s. The Evening Time variable is set to turn active after sunset (7.08pm) and turn inactive in the morning at 7am.

     

    Hope this is clear enough. Thanks in advance for any help!

    • 0
  • Inquirer
  • Posted

    Anyone? Please? Even if someone can teach me how to post a screenshot of my scene's blocks

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    • 0
    Posted

    Do you have a HC2? If so could you convert the scene to lua (go to scene, advanced tab, below you will find the button) and paste the code here?

    • 0
    Guest wjohn
    Posted

    Have you tried "Magic Scenes"?

     

    I am not sure when they were introduced.... 

     

    i have two very simple magic scenes set up,  Motion detect and turn a light on,  and then turn it off when the Motion Detector is Not Tripped.

    • 0
  • Inquirer
  • Posted

    Thanks boerremk!

     

    Here is the scene to dim my living lights:

     

    --[[
    %% autostart
    %% properties
    82 value
    35 value
    36 value
    %% events
    %% globals
    Evening_Time
    --]]
     
    local startSource = fibaro:getSourceTrigger();
    if(startSource["type"] == "other") then
    setTimeout(function()
    fibaro:call(35, "turnOff");
    fibaro:call(36, "turnOff");
    end, 20000)
    else
    if (( tonumber(fibaro:getValue(35, "value")) > 0 ) and ( tonumber(fibaro:getValue(36, "value")) > 0 ) and ( tonumber(fibaro:getValue(82, "value")) == 0 )) then
    local delayedCheck0 = false;
    if ( tonumber(fibaro:getValue(35, "value")) > 0 ) then
    delayedCheck0 = true;
    end
    local delayedCheck1 = false;
    if ( tonumber(fibaro:getValue(36, "value")) > 0 ) then
    delayedCheck1 = true;
    end
    setTimeout(function()
    local delayedCheck2 = false;
    local tempDeviceState2, deviceLastModification2 = fibaro:get(82, "value");
    if (( tonumber(fibaro:getValue(82, "value")) == 0 ) and (os.time() - deviceLastModification2) >= 300) then
    delayedCheck2 = true;
    end
     
    local startSource = fibaro:getSourceTrigger();
    if (
     ( delayedCheck0 == true  and  fibaro:getGlobalValue("Evening_Time") == "Active"  and  delayedCheck1 == true  and  delayedCheck2 == true )
    or
    startSource["type"] == "other"
    )
    then
    setTimeout(function()
    fibaro:call(35, "turnOff");
    fibaro:call(36, "turnOff");
    end, 20000)
    end
    end, 300000)
    end
    end
    • 0
  • Inquirer
  • Posted

    Here is the scene that turns off my living rooms lights:

     

    --[[
    %% autostart
    %% properties
    35 value
    36 value
    82 value
    %% events
    %% globals
    Evening_Time
    --]]
     
    local startSource = fibaro:getSourceTrigger();
    if(startSource["type"] == "other") then
    fibaro:call(35, "turnOff");
    fibaro:call(36, "turnOff");
    else
    if (( tonumber(fibaro:getValue(35, "value")) == 0 ) and ( tonumber(fibaro:getValue(36, "value")) == 0 ) and ( tonumber(fibaro:getValue(82, "value")) == 0 )) then
    setTimeout(function()
    local delayedCheck0 = false;
    local tempDeviceState0, deviceLastModification0 = fibaro:get(35, "value");
    if (( tonumber(fibaro:getValue(35, "value")) == 0 ) and (os.time() - deviceLastModification0) >= 20) then
    delayedCheck0 = true;
    end
    local delayedCheck1 = false;
    local tempDeviceState1, deviceLastModification1 = fibaro:get(36, "value");
    if (( tonumber(fibaro:getValue(36, "value")) == 0 ) and (os.time() - deviceLastModification1) >= 20) then
    delayedCheck1 = true;
    end
    setTimeout(function()
    local delayedCheck2 = false;
    local tempDeviceState2, deviceLastModification2 = fibaro:get(82, "value");
    if (( tonumber(fibaro:getValue(82, "value")) == 0 ) and (os.time() - deviceLastModification2) >= 600) then
    delayedCheck2 = true;
    end
     
    local startSource = fibaro:getSourceTrigger();
    if (
     ( delayedCheck0 == true  and  delayedCheck1 == true  and  delayedCheck2 == true  and  fibaro:getGlobalValue("Evening_Time") == "Active" )
    or
    startSource["type"] == "other"
    )
    then
    fibaro:call(35, "turnOff");
    fibaro:call(36, "turnOff");
    end
    end, 600000)
    end, 20000)
    end
    end
    • 0
  • Inquirer
  • Posted

    Anyone? Any help is greatly appreciated...

    • 0
    Posted

    I don't see in your scene any commands to dim lights, only to turn them off. Anyway, here is one scene in LUA that should turn on lights if global variable Evening_Time is active and it is triggered by motion sensor with ID = 82. Then it will loop every second and keep checking that motion sensor and if there is detected movement it will reset countdown. If there is no movement any more then when countdown reach half time (dimtime = 300) then lights will be dimmed (level = 30). But if there is movement detected again then countdown will be reseted, and lights will again became more bright (level = 90). if there is no movement for 10 minutes then lights will be turned off and scene will be stopped.

    Please login or register to see this code.

    I haven't test this code which is actually taken from my more complex code to control my living room lights.

     

    In my case I have one scene which is triggered by lux sensor and during day it will turn lights on if we are at home, if lights are set to automatic mode and if there is not enough light like bellow 70 lux, and turn off lights if there is more than 200 lux. This scene is active after sunrise and until sunset (+/- 30min can be set with VD).

     

    After sunset and until sunrise I have another scene which is triggered by motion sensor and it turns on lights when movement is detected but brightness of the lights depends on some global variables like are we awake or sleep, do we watch TV or guests are in our house. During summer we spent more time in our garden than in living room and then indoor lights can be even more dimmed  not to attract insects like flies and mosquitos inside the house.

    Please login or register to see this image.

    /emoticons/default_wink.png" alt=";)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    • 0
    Posted

    Hi.

     

    Need some help with a scene as I've tried 2 separate scenes with a motion-safe trigger but the triggers overlap and the light group only dims and never turns off. Then I tried a single motion-safe trigger of a dim AND off after 300s, then this one just skips the dim and turns straight off.

     

    Basically I have 2 lights that I want dim, if there is not activity in the room after 5min, and then switch off if no further activity after 5min. These lights are currently set to turn on when motion triggered.

     

    Any help would be greatly appreciated!

    Since your trigger is the time slot, may I suggest to use VD main loop for that with very simple code - assuming you turn on light to full when triggered.

    Please login or register to see this code.

    Please change motionSensor, Light1 and Light2 to your real IDs. 

    Please change dimming value according to your needs.

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