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

Number of instances of scene has been reduced due to exceeding limit.


Question

Posted

I get now since I have updated to 4.058 Beta this message:

 

 To many instances | Scene: Licht BEW
Number of instances of scene has been reduced due to exceeding limit.

 

the scene does not work anymore.

 

--[[
%% properties
620 value
%% globals
--]]
 
-- VARIABLEN Konfiguration (Bewegungsmelder muss oben unter %% properties aufgeführt sein) löst die szene aus
-----------------------------------------------------------------------------------------------------------------------------------------
local scene = 200 -- ID dieser Szene EG Vorzimmer
local motion = 620 -- ID des Bewegungssensors
local licht = 622 -- ID Lichtsensor
local switch = 769 -- ID der Lampe
 
local nachtstart = 1600 --22:00 = 2200
local nachtende = 0100 -- 07:00 = 0700
local starttimer = 60 -- licht an zeit (+ zeit des bewegungssensors - par. 6)
local lichtwert = 1 -- grenze zum nachtmodus (nur ausführen, wenn licht größer als)
-----------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------
---------------------Script-----------------
fibaro:debug("start1")
if (fibaro:countScenes()>1) then
 fibaro:debug("stop scene");
 fibaro:abort();
end
 
-- SCHALTE LICHT EIN & AUS (wenn nicht nacht)
if (tonumber(fibaro:getValue(motion, "value")) > 0 ) and tonumber(fibaro:getValue(licht, "value")) > lichtwert and (tonumber(os.date("%H%M")) >= nachtstart or tonumber(os.date("%H%M")) <= nachtende) then -- hier fehlt noch "und schalter aus"
 fibaro:debug("ausgelöst");
 --led auf wert einstellen
 fibaro:call(switch, "turnOn");
 -- timer start und einstellen
 timer = os.time();
 while os.time() - timer < starttimer do
 fibaro:sleep(1000);
 -- Timer zurücksetzen, wenn neue Bewegung erkannt wird innherhalb der Verzögerungszeit
 if (tonumber(fibaro:getValue(motion, "value"))) > 0 then
 timer = os.time();
 end
end
 -- Schalte Licht aus, wenn Timer vollständig abgelaufen ist
 fibaro:call(switch, "turnOff");
end
fibaro:debug("ende1");
fibaro:killScenes(scene);

 

 

 

Recommended Posts

  • 0
Posted

Okaaaaaaaaaaaaaayyyyyyy!

I understand... Go to the scene... On the "General" page you will find: "Max. running instances:" and the default is 1!

You can set anything up to 10.

I guess you can remove the "countsScenes" incantation at the start of the script, this replaces it.

Problem solved.

  • 0
Posted

I don't believe the limit of 10 instances is working correctly

I cannot get more than one instance of a scene before the error appears in the notifications panel

Cheers

Mike

  • 0
Posted

I've got the same feeling that the counting is wrong... Some of my scenes get this message, but they all start with something like "if fibaro:countScenes()>1 then fibaro:abort() end). But It's possible that I missing something here.

Not all of my scenes have it... I'm still looking for a pattern.

I don't see a problem in the script at the top.

To be continued!

  • 0
Posted

I have a scene with just the three lines

fibaro:debug("start")

fibaro:sleep(5000)

fibaro:debug("end")

Starting it twice causes it to run once and give the notification of too many instances.

Something seems a little wrong I believe

  • 0
Posted

Thanks for sharing. I thought that maybe setTimout would work differently, but it doesn't

Please login or register to see this code.

Same behavior.
  • 0
Posted

Looks like it's over to fibaro for a response then, hopefully not too long as it's stopped 2 of my scenes working

Cheers

Mike

  • 0
Posted

But if we use LUA with countScene, the notification/case should never happens, no?

  • 0
Posted

But if we use LUA with countScene, the notification/case should never happens, no?

Please try one of the examples above...

I understand your question... but how can I explain it?

The new HC2 limiter comes "first". Your scripts comes "second". So, when a script "wants to start", for instance because of a motion sensor trigger, the HC2 check how many instances already run. That's "0" the first time, and "0" is "< 1" so the script is allowed to run. Then... you do "if countscenes > 1 then abort" and of course, that succeeds to. Now suppose your script is going to sleep for a long time, an you start the script another time while the other instance is sleeping. Again, a script "wants to start", the HC2 check how many instances already run. That's "1" this time, and "1" is not "< 1" so the script is NOT allowed to run a second instance. Because it can't run, it doesn't even get at your "if countscenes > 1 then abort". Because the HC2 didn't start the scene it logs to the notification panel.

If you want your "if countscenes > 1 then abort" logic to work, try setting the number of allowed scenes to at least "2".

  • 0
Posted

OK, thanks for the clarification. This also means I can remove the countScenes and manage the number of running instances directly trough the UI. I find this a bit annoying that there's a notification for that, because I would like to set the rules for each scenes and not be inform in the normal situation that a scene was already running. 

  • 0
Posted

It is something new, and I got the feeling that I don't fully understand all the ramifications yet. But if you want my simple, preliminary advise: set the scene limit to "2" but keep the countScenes check. When I get my head around this... I might revisit that advise

Please login or register to see this image.

/emoticons/default_icon_wink.gif" alt=";-)" />

  • 0
Posted

Thanks for your explenation, petergebruers!

  • 0
Posted

No problem at all!

  • 0
Posted

It is something new, and I got the feeling that I don't fully understand all the ramifications yet. But if you want my simple, preliminary advise: set the scene limit to "2" but keep the countScenes check. When I get my head around this... I might revisit that advise

Please login or register to see this image.

/emoticons/default_icon_wink.gif" alt=";-)" />

 

Guys, taking a stab I don’t think this functionality was introduced as a mechanism to manage the number of instances of a scene that are running.

 

People are constantly complaining about RAM being chewed up and processors grinding to a halt, yet there is very little transparency into what the root cause is. I believe Fibaro has implemented a mechanism to stop poorly designed scenes from  bringing down your system. That’s it. Nothing more.

 

Maybe the functionality will be increased over time to do more than that, but for the time being I would keep countscenes/abort code in place and increase the number of instances allowed to 1 greater than the maximum number of instances you need. Then if you get a notification of aborted scenes you will know that there is an issue with that particular scene. You can then do some debugging e.g. increase the instance count by one more and see if the problem goes away, review your code and figure out why you have so many instances spawning.

My two cents worth.

  • 0
Posted

I have a feeling something is not working.

 

I still get a notificaion with the value set to 2 and even 3.  even though (fibaro:countScenes() > 1) is  working and the count never exceeds 2.

  • 0
Posted

its buggered up a few simple scenes i had running...

 

is motion safe 300 secs then turn light off

 

if motion breached then turn light on

 

lol

 

not much to ask!!!!

 

fix this please you are a laughing stock! even a vera edge pulls this off!

  • 0
Posted

Yes but another point would suggest you code is wrong? You could trigger that motion sensor a ton of times during the first 300 sec. And that is exactly what this function is aiming to prevent. Having tons of instances running concurently and cheving up the ram.

  • 0
Posted

I have a feeling something is not working.

 

I still get a notificaion with the value set to 2 and even 3.  even though (fibaro:countScenes() > 1) is  working and the count never exceeds 2.

I am also getting the same. Scene runs once and fault message apperas. I set the count up to 5 and it still triggers the message.

Also as a general note i would suggest that Fibaro takes the time to explain to users what they need to do to resolve the issue. The current explanation in my mind says: Fault: There is a fault!

 

Battery icon is indeed missing on all sensors with the new breached status, annoying. Battery is visible on Temp etc but not breached part of a sensor. Ie Motion sensor, Dorr sensor and flood sensor.

  • 0
Posted

its buggered up a few simple scenes i had running...

 

is motion safe 300 secs then turn light off

 

if motion breached then turn light on

 

lol

 

not much to ask!!!!

 

fix this please you are a laughing stock! even a vera edge pulls this off!

OK, that's speudo code... Does the real stuff start with "if fibaro:countScenes()>1" then fibaro:abort() end" or equivalent?

Has the number of scenes been increased to at least 2 (on the "general" page of the scene)?

Does your script contains more than one trigger? What are these triggers?

Is it posseble, that your script triggers itself. For instance, you have a relay as a trigger but you also switch that relay in the script?

How many lines are there in the script? Is it thinkable, that the interval between triggers is smaller than the compile time? Or smaller than the run time? That last case has been documented in this topic. If you have a motion sensor that triggers a scene that sleeps or loops for 5 minutes, it is bound to start an other instance. At least one extra, because the sensor will send a "safe" signal while the first script is running.

  • 0
Posted

its buggered up a few simple scenes i had running...

 

is motion safe 300 secs then turn light off

 

if motion breached then turn light on

 

lol

 

not much to ask!!!!

 

fix this please you are a laughing stock! even a vera edge pulls this off!

 

 

I have scenes setup the same as this, created via the graphic blocks way as listed below and still get the notification: - To many instances | Scene: K LED Off -  Number of instances of scene has been reduced due to exceeding limit.

 

Active = Active is so the lights don't come on during the day.

 

This is the simplest of scenes and have played around changing Max. running instances: and still i get the notification.

 

Please login or register to see this image.

 

bedroom_off.png

 

 

 

This needs to be fixed and patched ASAP as it will put people off of buying this system. I'd expect Graphic Blocks just to simply work as it is the way most people will setup this type of scene.

 

I look forward to Fibaro patching this and explaining how to accomplish this via LUA.

 

Hal

  • 0
Posted

I have scenes setup the same as this, created via the graphic blocks way as listed below and still get the notification: - To many instances | Scene: K LED Off -  Number of instances of scene has been reduced due to exceeding limit. (...)

I'd really like to help you, but I am a lua-only man. I really don't understand "block" scenes. So it's not that I don't want to say anything, I really don't know if there's anything tricky to that scene or not. I guess not, but... This one is for Fibaro, or a blocky-man. Sorry about that!

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