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

Simple Lights on/off scene help


Question

Posted

I've set up one block scene to turn on a light when the motion sensor is activated but am having trouble with the one to turn it off.
I've set up a separate scene to turn off the lights but want it to go off after 5mins but I keep getting a message saying to many instances, don't know what I'm doing wrong and if I enter a value in the seconds box it just seems to not like it?
 

any ideas please?

Recommended Posts

  • 0
Posted

I've set up one block scene to turn on a light when the motion sensor is activated but am having trouble with the one to turn it off.

I've set up a separate scene to turn off the lights but want it to go off after 5mins but I keep getting a message saying to many instances, don't know what I'm doing wrong and if I enter a value in the seconds box it just seems to not like it?

 

any ideas please?

Hi
This works fine

Please login or register to see this attachment.

Så=then
But uses a lot of resources, it is much better to use the association function, I have made mine on and it works perfectly.
  • 0
Posted

You can refer to below scene I posted in Polish forum. It will turn on the lights after movement is detected and will turn it off only if there has been no movement for 10 minutes. Movement in between will reset the counter. It should be pretty straightforward to modify and adjust to your needs.

 

Please login or register to see this link.

  • Thanks 1
  • 0
Posted

Hello

 

can we have that in english please ???

  • 0
Posted

Search the forum for "too many instances.." There is solutions.

  • 0
  • Inquirer
  • Posted

    So a simple thing where a motion sensor turns on a light and then turns it off when there is no movement is actually quite difficult to do??

    Or I could just buy a motion sensor for the light for £40.00 and use that.

    • 0
    Posted

    The solution I use now, to prevent "too many instances.." with magic blocks for programming is:

     

    1. Make a Global Variable in the Panels -->  Variables Panel (for example Dev_Light_Room) with a value 0.

     

    2. Add a time-trigger scene (disable triggering variables option):

    Interval Based (red) From 00:00, every 1 Minutes, To 23:59

    And

    # Dev_Light_Room, >, 0

    then

    # Dev_Light_Room, -=, 1

     

    3. Make a Turn Light On scene:

    Sensordevice (blue), ==, Breached, 0s (you can set more dependencies here)

    Then

    #Dev_Light_Room, =, 5 (minutes that must stay lights on when breached)

    Lightingdevice (blue), =, Turn On, 0s

     

    4. Make a Turn Light Off scene (enable Triggering variables option):

    # Dev_Light_Room, ==, 0

    then

    Lightingdevice (blue), =, Turn Off

     

    Set for all scenes de Max. Running instances on 2.

     

    It's probably not the most elegant solution but it is working (for now).

     

    Explanation: When a sensor is breached it sets a time in the variable. De time will subtract 1 every minute until it reaches 0 then the light will switch off.

     

    The hope Fibaro will implement 'kill first scene' option in the next update.

    Please login or register to see this image.

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

    • 0
  • Inquirer
  • Posted

    Thanks, they seem to have removed the instances and its working now.

    • 0
    Guest Goswin
    Posted

    Okay, tested your solution Lambik and everything works fine... But ... if I use the original switch to turn on the light, the light will never go out (unless I use the switch again). Would it be possible to create an addition that the light will be turned off after 60sec inactivity (of the movement sensor)?

    Thanks for a reply.

    • 0
    Posted

    The solution I use now, to prevent "too many instances.." with magic blocks for programming is:

     

    ...

     

    The hope Fibaro will implement 'kill first scene' option in the next update.

    Please login or register to see this image.

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

     

    Thanks Lambik, that's exatcly what I was looking for after getting the "max running instances" issue...

    The only "problem" here is that the countdown timer is not in sync with the event so you must accept a tollerance of +/- 59seconds (which is fine in my case).

    I agree for an option to kill previous instances of a scene in conjunction with the new "max running instances" one, that's a big flaw from Fibaro (where can we report that?).

     

     

    Okay, tested your solution Lambik and everything works fine... But ... if I use the original switch to turn on the light, the light will never go out (unless I use the switch again). Would it be possible to create an addition that the light will be turned off after 60sec inactivity (of the movement sensor)?

    Thanks for a reply.

     

    That's easy: just set Dev_Light_Room when your sensor is turned off (instead than in the motion event).

    If you need different values for motion and manual switch (5min for motion and 1min for manual), simply add another variable with another timeout scene.

    • 0
    Guest aj84
    Posted

    Is this solution still the preferred way?  I've been plagued by these messages since I got the HCL and HC2 and really want it resolved.

     

    In my case, I won't bother posting my scene but it's identical to 

    Please login or register to see this link.

     

    • 0
    Posted

    I used the scene of @trash.

    I (tried) to translated it as best as I could to English.

    But I also added Time Of Day based dimming, I hope @trash doesn't mind ;-).

    At daytime no lights, in the evening 60% lights and during dawn, night and dusk 20% lights.

    The lights turn on after sensing motion and turn off after 2 minutes unless new motion is sensed.

    Then the counter starts back at 2 minutes. These two minutes can be changed to your likes.

    The same for the dimming levels.

    I use, like most of us, a Global Variable called TimeOfDay. This is controlled by a scene that defines dawn, morning, afternoon, dusk, evening and night.

    The moment of starting night is depending on the day. In the weekend that's later then on weekdays.

    I hope to help some members with this code...

     

    Cheers,

     

    TRicky

     

    --[[
    %% autostart
    %% properties
    896 value
    %% globals
    --]]

    -- Autolights created by Trash of Poland on 01-2016
    -- Altered by TRicky on 02-2017
    -- Motion sensor turns the light on for 2 minutes.
    -- Any movement while light(s) on sets the counter back to 2 minutes.
    -- No movement during 2 minutes shuts down the light(s).

     

    local Counter = 1;              -- Counter
    local TimeLightOn = 2*60;       -- Time to keep the Light(s) On. Change to you like.
    local TimeLastMotion;           -- Time when last motion sensored
    local MotionSensorID = 896;     -- Motion Sensor
    local ControlledLightID = 730;  -- Controlled Light(s)
    local Dimlevel;                 -- Actual dimming level, depending on the TimeOfDay
    local DimLevelZero = 0;         -- Putting the light(s) out; dimmed to 0%
    local DimLevelLow = 20;         -- Light(s) dimmed to 20%
    local DimLevelHigh = 60;        -- Light(s) dimmed to 60%
    local DayTime = fibaro:getGlobalValue("TimeOfDay");  -- Global Variable
    local startSource = fibaro:getSourceTrigger();

     

    function AutoLight() 
      local CurrentTime = os.time();
      TimeLastMotion = fibaro:getModificationTime(MotionSensorID, "value");

      fibaro:debug("Light Counter: " .. Counter);
      Counter=Counter+1;

      fibaro:debug("Time since last detected movement: " .. CurrentTime - TimeLastMotion .. " seconds.");
      
      if ( (CurrentTime - TimeLastMotion) <= TimeLightOn ) then 
        setTimeout(AutoLight, 10000);
      else
        fibaro:call(ControlledLightID, "setValue", DimLevelZero);
        fibaro:debug('Ending Scene Light(s) Hal Midden');
        fibaro:debug('Putting light(s) out at '.. DimLevelZero ..'%');
      end
    end

    fibaro:debug('Starting Scene Lights Hal Midden');

    if ( fibaro.countScenes() == 1 ) then
      if ( ( tonumber(fibaro:getValue(MotionSensorID, "value")) > 0 ) or startSource["type"] == "other" )
        then
          if (DayTime=="Dawn" or DayTime=="Night" or DayTime=="Dusk") then DimLevel = DimLevelLow
          elseif (DayTime=="Evening") then DimLevel = DimLevelHigh
          else 
            fibaro:debug("Motion detected but scene aborted because it's " ..DayTime)
            fibaro:abort ();
          end

          fibaro:call(ControlledLightID, "setValue", DimLevel);
          fibaro:debug("Light(s) On, Current Dim Level is: "..DimLevel.."%");
          AutoLight();
        end
    else
      fibaro:debug("Current amount of running scene’s: " .. fibaro.countScenes());  
    end
     

    • Thanks 1
    • 0
    Posted
    On 2017/2/7 at 7:03 AM, TRicky said:

    我使用@trash的场景

    我(试过)把它尽可能翻译成英语。

    但我也添加了基于时间的调光,我希望@trash  不介意;-)

    在白天没有灯光,在晚上60%的灯光和黎明时,夜间和黄昏20%的灯光。

    灯光在感测运动后开启,2分钟后关闭,除非感测到新的运动。

    然后计数器在2分钟后开始。这两分钟可以改成你喜欢的。

    同样的调光水平。

    我使用,像我们大多数人一样,称为TimeOfDay的全局变量。这是由定义黎明,上午,下午,黄昏,傍晚和夜晚的场景控制的。

    开始的夜晚的时刻取决于一天。在周末晚些时候,然后是平日。

    我希望帮助一些成员这个代码...

     

    干杯,

     

    TRicky

     

    - [[
    %% autostart
    %% properties
    896 value
    %% globals
    - ]]

    - 波兰Trash的01-2016创建的汽车灯
    - 改变由TRicky 02-2017
    - 运动传感器打开灯2分钟。
    - 任何移动,当光线打开时,将计数器设置为2分钟。
    - 在2分钟内没有移动,关闭灯。

     

    本地计数器= 1; - 计数器
    本地TimeLightOn = 2 * 60; - 保持灯亮的时间。改变你喜欢。
    本地TimeLastMotion; - 最后一个运动传感
    局部MotionSensorID = 896 时的时间; - 运动传感器
    本地ControlledLightID = 730; - 受控光
    本地Dimlevel; - 实际调光级别,取决于TimeOfDay
    local DimLevelZero = 0; - 把灯放出来; dimmed to 0%
    local DimLevelLow = 20; - 光线调暗到20%
    local DimLevelHigh = 60; - Light(s)dimmed to 60%
    local DayTime = fibaro:getGlobalValue(“TimeOfDay”); - 全局变量
    local startSource = fibaro:getSourceTrigger();

     

    function AutoLight() 
      local CurrentTime = os.time();
      TimeLastMotion = fibaro:getModificationTime(MotionSensorID,“value”);

      fibaro:debug(“Light Counter:”.. Counter);
      计数器=计数器+ 1;

      fibaro:debug(“从上次检测到的运动以来的时间:”.. CurrentTime - TimeLastMotion ..“秒”。
      
      if((CurrentTime-TimeLastMotion)<= TimeLightOn)then 
        setTimeout(AutoLight,10000);
      else
        fibaro:call(ControlledLightID,“setValue”,DimLevelZero);
        fibaro:debug('Ending Scene Light(s)Hal Midden');
        fibaro:debug('Putting light(s)out at'.. DimLevelZero ..'%');
      年底
    结束

    fibaro:debug('Starting Scene Lights Hal Midden');

    if(fibaro.countScenes()== 1)then
      if((tonumber(fibaro:getValue(MotionSensorID,“value”))> 0)或startSource [“type”] ==“other”)
        then
          if “Dawn”或DayTime ==“Night”或DayTime ==“Dusk”)然后DimLevel = DimLevelLow
          elseif(DayTime ==“Evening”)then DimLevel = DimLevelHigh
          else 
            fibaro:debug(“Motion detected but scene aborted because it's”。 .DayTime)
            fibaro:abort();
          结束

          fibaro:call(ControlledLightID,“setValue”,DimLevel);
          fibaro:debug(“Light(s)On,Current Dim Level is:”..DimLevel ..“%”);
          AutoLight();
        end
    else
      fibaro:debug(“Current amount of running scene's:”.. fibaro.countScenes());  
    结束
     

    good  job

    • 0
    Posted

    My Chinese is better as I thought....... :mrgreen:

    • 0
    Posted

    I used this scene triggered by a AEON MS4-1 and that works like a charm.

    Now I added this scene to a new room and there the scene is triggered by a Fibaro FGMS-001 Version 3.2.

    Strange enough, at first movement detection, the scene starts running, the light goes on but goes of within 1 second.

    But the scene keeps on running normally till the predefined 2 minutes.

     

    When I start the scene for the first time it works well but after that it behaves like written above.

    Does someone have a clue???

    • 0
    Posted
    On 1/25/2016 at 10:56 PM, Lambik said:

    The solution I use now, to prevent "too many instances.." with magic blocks for programming is:

     

    1. Make a Global Variable in the Panels -->  Variables Panel (for example Dev_Light_Room) with a value 0.

     

    2. Add a time-trigger scene (disable triggering variables option):

    Interval Based (red) From 00:00, every 1 Minutes, To 23:59

    And

    # Dev_Light_Room, >, 0

    then

    # Dev_Light_Room, -=, 1

     

    3. Make a Turn Light On scene:

    Sensordevice (blue), ==, Breached, 0s (you can set more dependencies here)

    Then

    #Dev_Light_Room, =, 5 (minutes that must stay lights on when breached)

    Lightingdevice (blue), =, Turn On, 0s

     

    4. Make a Turn Light Off scene (enable Triggering variables option):

    # Dev_Light_Room, ==, 0

    then

    Lightingdevice (blue), =, Turn Off

     

    Set for all scenes de Max. Running instances on 2.

     

    It's probably not the most elegant solution but it is working (for now).

     

    Explanation: When a sensor is breached it sets a time in the variable. De time will subtract 1 every minute until it reaches 0 then the light will switch off.

     

    The hope Fibaro will implement 'kill first scene' option in the next update.

    Please login or register to see this image.

    /uploads/emoticons/default_icon_curve.gif" />

     

    Tested this option out and it seems to work well with block scenes and seems to have resolved the max running instances issue which was annoying.

     

    My only issue is that I am locked into a set countdown period of e.g. 5 minutes per this example.

     

    What I would ideally like to have happen is the 5 minutes to be reset if further motion is detected - any suggestions?

    • 0
    Posted
    13 minutes ago, eddiem74 said:

     

    Tested this option out and it seems to work well with block scenes and seems to have resolved the max running instances issue which was annoying.

     

    My only issue is that I am locked into a set countdown period of e.g. 5 minutes per this example.

     

    What I would ideally like to have happen is the 5 minutes to be reset if further motion is detected - any suggestions?

     

    D'oh ignore this...I had included lux level in scene so once lights were turn on the count was not reset as lux level was higher than triggering value...removed it for a test just using motion and it reset variable each time.

    • 0
    Posted
    On 17-2-2017 at 11:06 PM, TRicky said:

    I used this scene triggered by a AEON MS4-1 and that works like a charm.

    Now I added this scene to a new room and there the scene is triggered by a Fibaro FGMS-001 Version 3.2.

    Strange enough, at first movement detection, the scene starts running, the light goes on but goes off within 1 second.

    But the scene keeps on running normally till the predefined 2 minutes.

     

    When I start the scene for the first time it works well but after that it behaves like written above.

    Does someone have a clue???

    Nobody has a clue to solve this strange behavior?  :-(

    • 0
    Posted

    The simplest way to get an FMGS-001to turn on ligth is to use association. This will work even when the HC is down.

     

    • 0
    Posted

    @pjvik, that's true but it's also the least advanced way. I wan't to set the dimming levels of the light.

    Otherwise I could have bought a PIR without brains and no HC2.

    If the scene works with motion sensors from AEON (MS 4, 5 and 6), it should work with Fibaro's own motion sensor too....

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