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


Question

Posted

Hi, I am new to Fibaro and LUA and am trying to get my head around this too many instances warning. I have a background in PHP coding so I understand the basics of LUA. I have seen you can add a bit of code to abort when there are too many instances but that is impossible to use with the HC lite due to lack of LUA in the device. I have produced a scene which I thought would not suffer from the dreaded "too many instances" (see attached) The table lamp going on should prevent another instance being started until trigFrontMotNight and the table lamp have both returned to off and 0 respectively. So can someone please tell my why I am getting this. Am I reading the instance thing wrong. Please explain. Many thanks.

Please login or register to see this attachment.

14 answers to this question

Recommended Posts

  • 0
Posted

You didn't take picture of the above trigger part so it is not clear what triggers are ticked, but check what is ticked to trigger this scene and remove lamp from triggering scene because any change of state of the lamp will trigger new instance, only code will not be executed if variable trigFrontMotNight is zero. Actually this scene once executed it will continue to trigger recursively itself as long as trigFrontMotNight is 1 due to delay to turn on and off of the light.

 

So the question is what you really want to do with this light? How you change value of trigFrontMotNight?

 

Can you please post complete screenshot of the scene?

  • 0
Posted

Hi,

 

Just hijacking the post since I have the same issue, however my scene is quite simple, see attachments.

 

I know I have only one instance running, don't need more. Is that a bad setup? Basically I want the heating to switch on and off when I go or leave home automatically. Pretty basic rule (in my opinion) so not sure why HC2 is telling me I have too many. Any ideas?

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

  • 0
Posted

I have a similar graphical scene like Campbell and have the same issue that the HC2 says there are too many instances. I don't understand what i happening or what is wrong.

  • 0
Posted

You need to know the trigger just like Sankotronic said.

 

Can you also paste the complete scene, including the trigger(s) (part above the blocks)?

  • 0
Posted (edited)

Without posting screenshot of the scene, but complete so that also triggers are in the picture above block scene nobody can really help you, we can only guess just like you.

 

and as you can see in this scene Veliko svjetlo (Big lamp) status is used to trigger this scene and in very this scene status of that lamp is changed what will trigger another, and another instance of the same scene as lon as global variable Darkness is equal to 1! NOT GOOD!!

 

In next picture triggering device is disabled (not ticked) and scene will be triggered only by global variable Darkness when value change, and when that value is 1 and big lamp is off then big lamp will turn on after 5 seconds, then scene will idle for 360 seconds and then turn off the light.

 

So if you want help with BLOCK SCENES then please, please, please remember to put in the picture also TRIGGERS and then and ONLY then others can understand your scene and help you!

Edited by Sankotronic
Attachment quota filled up / deleting older stuff sorry :-(
  • 0
Posted

Everyday I learn something new, attached the full scene now, right? That what you mean? With only that scene I get the too many instances too from time to time

Please login or register to see this attachment.

  • 0
Posted (edited)

Everyday I learn something new, attached the full scene now, right? That what you mean? With only that scene I get the too many instances too from time to time

I didn't yet play with geofencing, but from your scene it looks like it is running in loop since there is no triggers available. But I know that my scenes more frequently give me "too many instances" when I set max. running instances to 1 and when I put it back on default 2 this warning stop. So try first to put it on default value and see what happens. Just to mention that my scenes are in LUA and have code to check and stop any additional instances of the scene and yet giving warning "too many instances" every time they run when max. running instances was set to 1:

Please login or register to see this code.

Edited by Sankotronic
  • 0
Posted

 

 

I didn't yet play with geofencing, but from your scene it looks like it is running in loop since there is no triggers available

Yes, this is something I noticed, when I create the scene the trigger GPS gets ticked. Then when I save it, it disappears and no longer is ticked.

I edit it, add a new GPS trigger and then it appears again, just to save it and disappear again!

  • 0
Posted

Yes, this is something I noticed, when I create the scene the trigger GPS gets ticked. Then when I save it, it disappears and no longer is ticked.

I edit it, add a new GPS trigger and then it appears again, just to save it and disappear again!

 

Hello,

 

GPS used in scenes

Please login or register to see this link.

 

Also, if the scene is kind of important for you make sure you checked the box "Do not allow alarm to stop scene while alarm is running".

  • 0
  • Inquirer
  • Posted

    Hi all, many thanks for all the replies. I wanted to solve this problem in the easiest way without using the code to abort in LUA which cannot be done in the HC lite. I think I have a solution and will document it soon. I have one wish from the guys at fibaro though that would make life a little easier. In blocks you can use the timer to delay a device from turning on. Could you add that functionality to variables changing state ie variableA changes to 1 after 30S. It would make life a lot easier in HC lite where you can't use LUA to get you out of trouble on complicated scenes. Either that make a countdown timer available in the trigger timer section ie After 30 seconds then do this. 

    • 0
  • Inquirer
  • Posted

    Hi all, After a few hours of frustration, I have thrown the towel in. I feel I can't achieve what I need using blocks as they stand at the moment. As I mentioned I use PHP and I have some experience of PLC programing but this has beaten me. There needs to be more functions available to the user and timers available before this can be a truly amazing product that could sell in the millions. But because of the lack of these functions and decent documentation I fear Fibaro will miss the boat. To get a system running properly in the way the glamorous promotional videos say would take a programmer to do in LUA. I feel this is why so many people have moaned and dumped their systems in favor of others.  I don't want to cast doom and gloom on Fibaro as, fundamentally it's a fantastic product with so many possibilities. I will also continue to promote it and support it for my brother who plans to sell it from his Security/Gadget company. Now to my issue.

     

    What I wanted to do is quite simple and yes it can be achieved and does work. However it does so bringing up the "dreaded too many scenes" message. Some would say so what, it's just information or It can be dealt with by adding a little bit of code in LUA. Sorry but this is unacceptable when you are selling a product as "simple to install". If the only way of getting rid of the messages is a little bit of code you are effectively saying that the brick programming does not work. In business if it doesn't work you have to fix it quickly before people go elsewhere. 

     

    I wanted to do the following:

    1. Use a motion sensor to trigger a lamp.

    2. I want that lamp to delay turning on for 15 seconds. 

    3. After that I want the lamp to stay on for 15 seconds then switch off.

    4. I want the cycle to be reset then be available for future triggers.

     

    As a result I tried many permutations but this highlights the problems.

     

    In scene 1 I have a PIR (testSwitch1) and a variable (sceneOne) which should have 2 functions. to trigger the lights in the next scene and to prevent this scene from re-triggering another instance.

     

    Scene 2 sees the variable (sceneOne) set the next three blocks. Now logically you would think that these (testLight on and off and reset of sceneOne to 0) would trigger in turn. However they don't. They all start at the same time. The result is scene 1 can be re-triggered causing the unwanted "too many scenes" . If it was possible to put a timer on the variable (sceneOne) changing state then the problem would go away.

     

    Before people jump in again saying LUA coding can fix this I REPEAT not by the customer with no programming experience.

     

    So come on Fibaro. You have a world beating product in your grasp that could sell millions with a little tweaking in the core program don't miss this opportunity. 

     

    I would dearly like to see the following:

     

    1.A count down timer in the time functions

    2.A timer function on variables

    3.A WHILE function as well as IF.

     

    I also have some other issues but will post them in the correct place in the forum

     

    Thank you for reading and for the help already given by the die hard Fibaro enthusiasts .

     

     

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    • Like 1
    • 0
  • Inquirer
  • Posted

    Hi, just an addition to the above here is what the variable does in the LUA code. and Yes it stops the dreaded "too many instances" so please Fibaro how about it?

     

      --[[

    %% properties
    %% events
    %% globals
    sceneOne
    --]]
     
    local startSource = fibaro:getSourceTrigger();
    if (
     ( tonumber(fibaro:getGlobalValue("sceneOne")) == tonumber("1") )
    or
    startSource["type"] == "other"
    )
    then
      setTimeout(function()
            fibaro:setGlobal("sceneOne", "0");
        end, 30001)
       setTimeout(function()
           fibaro:call(112, "turnOn");
       end, 15000)
       setTimeout(function()
           fibaro:call(112, "turnOff");
        end, 30000)
    end
     
     
    Simples!
     
    Thanks for reading.
    • 0
    Posted

    Hi all, After a few hours of frustration, I have thrown the towel in. I feel I can't achieve what I need using blocks as they stand at the moment. As I mentioned I use PHP and I have some experience of PLC programing but this has beaten me. There needs to be more functions available to the user and timers available before this can be a truly amazing product that could sell in the millions. But because of the lack of these functions and decent documentation I fear Fibaro will miss the boat. To get a system running properly in the way the glamorous promotional videos say would take a programmer to do in LUA. I feel this is why so many people have moaned and dumped their systems in favor of others.  I don't want to cast doom and gloom on Fibaro as, fundamentally it's a fantastic product with so many possibilities. I will also continue to promote it and support it for my brother who plans to sell it from his Security/Gadget company. Now to my issue.

     

    What I wanted to do is quite simple and yes it can be achieved and does work. However it does so bringing up the "dreaded too many scenes" message. Some would say so what, it's just information or It can be dealt with by adding a little bit of code in LUA. Sorry but this is unacceptable when you are selling a product as "simple to install". If the only way of getting rid of the messages is a little bit of code you are effectively saying that the brick programming does not work. In business if it doesn't work you have to fix it quickly before people go elsewhere. 

     

    I wanted to do the following:

    1. Use a motion sensor to trigger a lamp.

    2. I want that lamp to delay turning on for 15 seconds. 

    3. After that I want the lamp to stay on for 15 seconds then switch off.

    4. I want the cycle to be reset then be available for future triggers.

     

    As a result I tried many permutations but this highlights the problems.

     

    In scene 1 I have a PIR (testSwitch1) and a variable (sceneOne) which should have 2 functions. to trigger the lights in the next scene and to prevent this scene from re-triggering another instance.

     

    Scene 2 sees the variable (sceneOne) set the next three blocks. Now logically you would think that these (testLight on and off and reset of sceneOne to 0) would trigger in turn. However they don't. They all start at the same time. The result is scene 1 can be re-triggered causing the unwanted "too many scenes" . If it was possible to put a timer on the variable (sceneOne) changing state then the problem would go away.

     

    Before people jump in again saying LUA coding can fix this I REPEAT not by the customer with no programming experience.

     

    So come on Fibaro. You have a world beating product in your grasp that could sell millions with a little tweaking in the core program don't miss this opportunity. 

     

    I would dearly like to see the following:

     

    1.A count down timer in the time functions

    2.A timer function on variables

    3.A WHILE function as well as IF.

     

    I also have some other issues but will post them in the correct place in the forum

     

    Thank you for reading and for the help already given by the die hard Fibaro enthusiasts .

     

     

    Hi, just an addition to the above here is what the variable does in the LUA code. and Yes it stops the dreaded "too many instances" so please Fibaro how about it?

     

      --[[

    %% properties
    %% events
    %% globals
    sceneOne
    --]]
     
    local startSource = fibaro:getSourceTrigger();
    if (
     ( tonumber(fibaro:getGlobalValue("sceneOne")) == tonumber("1") )
    or
    startSource["type"] == "other"
    )
    then
      setTimeout(function()
            fibaro:setGlobal("sceneOne", "0");
        end, 30001)
       setTimeout(function()
           fibaro:call(112, "turnOn");
       end, 15000)
       setTimeout(function()
           fibaro:call(112, "turnOff");
        end, 30000)
    end
     
     
    Simples!
     
    Thanks for reading.

     

     

    Hello,

     

    I try to get my head around what you try to achieve.

    You posted two scenes, but I think there is one more with the "testSwitch1". Can you post it as well?

    From what I understand, your scenes trigger one another. Scene 1 ends and scene 2 starts, and scene 2 ends, and scene 1 starts, and so on. This can cause too many instances as there is no break from executing the scenes (they are in a sort of a loop). These scenes are executed over and over again - this is what I image when looking at the scenes. Moreover, you did not include the triggering devices as @Sankotronic asked.

    What PIR do you have? And why do you not use it in the scene directly?

    • 0
    Posted

    Create a virtual device with countscene and the id pointing at your vd label. You can then analyse how many scenes are active. I did this yesterday I also have a scene in fact three of them that can run up to 10 instances and it's completely unavoidable!

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