Homeyscript strange behaviour

I noticed the following serious problem with Homey.

Homeyscript is consuming memory which increases in time.
After a short period (20 to 90 minuts) there is probably a cleanup function to reset the memory consumption.
During the memory cleanup (the dips in the graph) every Homeyscript freezes and does not run during 2 minuts
In the graph below I am sure there is no Homeyscript running. (based on triggers that could be fired.)

During the cleanup all Homeyscript flowcards are unavailable

The list of Homeyscripts in the browser are gone (empty).

May be the cleanup can also cause other Homey internal issues.
Since I own Homey (April 2023) I noticed many reliability problems .
For instance :

  1. lights not switching on.
  2. smart plugs not switching on.
  3. no reaction to motion triggers.
  4. smart plugs becoming unavailable.
  5. lights becoming unavailable.
  6. doorbell not ringing.
  7. inaccurate person presence.

The Homeyscript issue has been reported to Homey support a time ago.
Reaction zero until today.

No, the app is using too much memory (more than 120MB for more than 50 seconds) and gets restarted. Which also explains why the cards are temporarily unavailable.

1 Like

The behaviour is not identical when the app restarts manually
The dip in the graph is after the app restart is intiated. This does not take 2 minuts and does not go to zero.

An app that gets restarted due to using too much memory basically crashes, which is different from a manual restart. Also, restarts due to crashes are delayed from anywhere between 10 to 120 seconds.

Yes I understand. But found no documentation about this.
So Homeyscript crashes because it has memory leaks ?
When not running any script. I see same behavior.

It’s not documented, I’m looking at Homey’s core code.

Right after the app is started it’s already consuming about 60MB of RAM. On my Homey, which does absolutely nothing, it’s about the same. However, I don’t see any notable increases in memory, so it’s not leaking memory when it has nothing to do.

Besides reporting again, any suggestion how to solve this ?

Look closer at your scripts to see if they’re causing the memory leaks.

I already did this more than once (maybe 15 times) and also runned it in the Homey simulator without Homeyscript. No issues reported.

No idea what that means.

As it says a simulator that reacts on Homeyscript SDK calls but without the physical Homey.
It runs a JS module and enables me to debug code as standalone VS Code debug target. It only supports static calls. Or in other words no live support of device responses. I use this for basic code structuring of Homeyscript development. For App development I use a setup which also enables live target debugging for Typescript with VS Code. Maybe somewhere in future there will be a Athom supported development environment for Homeyscript.

If you’re sure your scripts aren’t leaking, post an issue (first look at #53, which might be related).

Robert thanks. Issue #53 is indeed related.
I discovered this issue a few months ago and reported this. Until today zero respons. Not even a confirmation of the receipt.
Further you said you have read this in the source code. Can you share ? I only have the SDK sources.

Legally I probably can’t, but if you have a HP2023 you can jailbreak your Homey and access the code yourself.