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

Out of memory /Number of instances of scene has been reduced to high memory usage.


Question

Posted

Hi Guy's 

 

I have a problem with a scene , i am on the latest Beta Firmware and I get

 

Out of memory | Scene: Global Check

 

Number of instances of scene has been reduced to high memory usage.

 

What is wrong with this scene ?

Please login or register to see this code.

Thanks in advance for help

 

 

10 answers to this question

Recommended Posts

  • 0
Posted

Remove "Night" from the GLOBALS header:

Please login or register to see this code.

By changing the global variable the script want to be called again and again.

Why it says "Out of memory" I don't know right now.

  • 0
Guest bozman
Posted

Hi, could someone explain more regarding the %% globals, when should I have a value there?

I believed that it always should be there if you want to read that value, but maybe fibaro:getGlobalValue is enough?

 

I have the same problem as FUUSS with memory related issues.

And it's really hard to troubleshot these kind of problems if the limitation in software isn't telling you anything more.

  • 0
Posted

I am pretty new to LUA scripting. Based on recent attempts to troubleshoot some scripts I have and writing new ones, it seems with 4.061 or 4.062 firmware, if global-variable is added to the %%globals section, it keeps triggering the scene/script to run whenever that global-variable is changed. I have since removed it and just use fibaro:getGlobalValue and the script works fine so far and also no more "exceed instances" error/alert coming up.

  • 0
Guest bozman
Posted

I tried it quick on a scene firmware 4.062 and if

I use fibaro:getGlobalValue in a if statement and I do not have

that global value in the %%globals it never runs that if statement, 

 

changed it back to have in the %%globals then the if statement works fine.

I can't really understand the logic here.

  • 0
Posted

You only use %%globals if you want a global variable to trigger a scene:

 

I use it to set my alarm; if the global variable "Sleeping" or 'PresentState" is changed, the scene for arming/disarming devices will be run automatically. if the value is 0 is will disarm devices and if set to 1 it will arm devices.

 

So if you just want a value of a global variable you don't need it.

 

top of the Alarm scene:

--[[
%% properties
%% globals
Sleeping
PresentState
--]]

  • 0
Guest bozman
Posted

Ok so you are saying that in the scene for instance if you have a sundown as global value you never have in that scene

if sundown=yes then

 turn lights on

end

 

it's enough to have it in the

%%globals

sundown

 

and then in the rest of the scene.

 

lights on

 

that's it?

  • 0
Posted

You will always have to do the check, because if the global variable is saying no, it still will set the lights on (it acts on the change not on the value).

 

Scene 1:

--[[
%% autostart

%% properties
%% globals
--]]

if sundown then

  fibaro:setGlobal("sundown","yes")

elseif sunup then

  fibaro:setGlobal("sundown","no")

end

 

Scene 2:

--[[
%% properties
%% globals
sundown
--]]

if getGlobalValue("sundown") == "yes" then

  lights on

end

 

But you will normally only use it if you really want to have a instant trigger on a change, if you want to set the light you can better make a scene checking the global variable with getGlobalValue and have a  while loop (or with settimeout).

  • 0
Guest bozman
Posted

Ok, thanks for that clarification!

  • 0
  • Inquirer
  • Posted

    I don't really understand what I have to change now , and why this error comes now , and didn't came before

    • 0
    Posted

    You have to remove the word Night just after %%globals.

     

    What the script does is changing the global variable, but the script is triggered by the change of the variable, so it will come in a loop.

    Please login or register to see this code.

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