[APP][Pro] Device Capabilities - Enhance the capabilities of devices

Indeed, no clue if this is the lowest possible MB’s, or if it can be tuned down somehow.
i didn’t bother to ask the dev yet :grimacing:

1 Like

Not sure, i don’t have that:


This is the same period as yours.
Could you perhaps check the period with other apps (like HomeyScript)? See if you can find the same paterns?
Because i have seen it before, but not in the DC app but another Athom-API app (not sure which one anymore).


Also a weird thing i tried before (MB’s are from my head/memory and not precise, but it was something like this depending on the precis tests i did):

  • Reboot Homey
  • Install DC in debugging mode, whilest everything was disabled internally
  • Memory about 20MB
  • Load a lott of data through the Athom-API
  • Memory about 40MB
  • Drop that data completly
  • Memory about 30MB
  • Deinstall the App from Homey
  • At this point, tha app is uninstalled, but leaving settings, devices and files. But the app and everything that belongs to it, is no longer available.

Then

  • Reinstall Homey the same way
  • Memory about 29MB
  • Load a lott of data through the Athom-API
  • Memory about 49MB
  • Drop that data completly
  • Memory about 39MB
  • Deinstall the App from Homey

I actually have repeated this process, constantly increasing the Memory used, until my Homey actually fuly crashed!

And i could completly simulate the exact same behavior without reinstalling the app, by reinitilizing the athom-api everytime, instead of a app-restart. Only, Homey did not crash: everytime the memory approached the limit (and the app 3-400MB memory sometimes) it would suddenly drop from f.i. 300 MB to 200MB. This would grow again until the limit, then schrink, etc.
Now, except for the data-retrieving, this special DC app version did absolutly nothing: no devices, no settings, i removed everything in the end to only test the athom-api.
And all (my) conclusions were the same: somehow, even when only requesting data from the Athom-API, it keeps growing, and somehow, when re-starting/installing an app, that overhead is still there.

I might be wrong, but most of my apps (all except Google Services) that don’t use the athom-api, are running at about 7MB to 10MB memory usage.
All could be reduced, since i think all are using the lodash module, meaning, when the BLL is done, most could be reduced about 2 MB memory size (and some install size).

15 MB what I mentioned was just guess.

Yesterday I restarted Homey and the app needs already 25-27 MB. Please see the graph:

I didn’t mean it that way. Besides the 2-3 individual apps, the current ADC app should still exist. However, that would mean a lot of extra work, which is of course not a solution either.

No, because I don’t use this app.

No, sorry. Because I have 10 important ADCs in use and some of them are used daily. Among other things I transferred the virtual devices to the DC app, and then deleted the VD app to have more memory.

Arie has already pointed out several times that the Athom API is also part of the problem, and I believe him.
I also don’t blame anyone. In post #917 I also just asked if it is possible to reduce memory consumption.
A constant memory consumption of 30-35 MB is probably not the main problem either. Now after a few people have taken a closer look at it and charts were posted, the real problem seems to be that the memory consumption increases constantly.

@Arie_J_Godschalk, I think we can close the topic from my side for now. Of course, I will continue to watch the memory consumption and the possible app optimizations. :wink:
Also I have to think about how to deal with the current situation. Restarting Homey all the time is definitely not an option, but maybe I will have to delete one or the other app.

1 Like

Just curious; what does Athom say about this memory increase?

1 Like

I actually never got an answer from them about this.
Altho it has been part of various tickets with them.
But never the main part of the ticket.

No worries Dirk, i didn’t took it as blaming or anything. :slight_smile:
My responses were just to clarify which issues i run into, which solutions and research i have done and thuse some explaination about the various choises i made.

I hope i can make some time free this week to pick up the various support tickets, including a option to not preload data for TFEs.

Because, i think, the preload is/might also be done when creating a new AVD, i’ll check this later.
And since it’s a loading (which i do clear) which permantly increases the MB, i hope that by creating a setting to not preload, the default MB used for non-TFE-users, will be lower.

Sorry, because you are also a very active community forum member, i thought you might have also noticed the BLL updates:

Simple put: BLL is about the same MB (install and memory), but contains a lott of “default” modules and components to be used by other/my apps.
This to reduce install sizes, but hopefully, also, memory usage.

Currently i have already implemented it as required for the FTP Client App and as optional for the Google Services App voor Homey | Homey.

If all goes well, i plan to implement BLL for all my apps, since in most cases, BLL alone is the same size or even less then the reduction for the other app.
And in total, when using multiple of my apps, the reduction would be huge.

Now, in the somewhat further future, if all goes well, i hope i can implement/create a BLL:Addendum (or something) to handle Athom-API data, or at least, the data that some apps need, like getDevices.
This would masivly reduce Memory usage.

But we’ll see. First let’s see how BLL develops.

This is (one of) my “solutions” to reduce memory and install sizes.

1 Like

I am very curious tho Dirk.
Since DC has no real background data collection, what happend at the Load peak 47MB?
What were you/Homey doing?

Because that’s a masive spike, which as far as i know, only happends for TFE. But that is keept for a minimum of 10 minutes.

I tried searching this topic for a solution, couldn’t find one. Hope to get help from the experts here.

I created a new device, very simple and straightforward. It’s meant to function as a normal button to switch on my Christmas lights. To do this, it starts a flow that triggers several wall outlets and so on.

But…in the morning and in the evening the lights are switched on and off on fixed times by this flow. The status of the button isn’t adapted, so the next thing can happen. I switch on the lights with the new button. The status of the button is “on” and the lights are on.
When the lights are switched of by the flow, the lights are off and the button is still on. Vice versa.

Is there a way to activate or deactivate the button. But without activating the flows, because that’s what I get now when I activate the status, turn the button on (or off).

What capability do I have to give to the button? And how can I get this (de)activated?

Hi Roger,

The first button you add, has to be the on/off type.
This makes the device (&tile) go on and off like normal switches

Also make sure to tick the “Create flow cards” and “Create tag” boxes

1 Like

Hi Peter, this is exactly as I have it. Pressing the button on and off functions perfectly.

The problem arises when I want to turn the button active or inactive, but without running the flow that starts after switching the button on or off.

I have to do so, because the lights are (also) switched on/off on a fixed moment, independent of the button. I want to keep the button in sync with the lights, so to say.
I can’t find the status of the button I can change without the button being pressed, so without starting the connected flow.

you should use different triggers and action cards then you are doing now (probably).
Trigger (WHEN): “When button ...” and select “has changed”.
Action (THEN): “Set [Button] to [yes/no] and [Nothing else]”. that won’t start the used Trigger

1 Like

Maybe I don’t understand your solution completely. When pressing the button to on or off, the status changes automatically. It’s not necessary to change it manually, as you in your “Then” statement?

To my opinion, your solution doesn’t solve my problem either. If I only wanted to use the button to put the lights on and off, then it works very easy. Its status changes to on and off after each time I press it. And the flows are executed.

But I only want to change its status manually. When I do so using your solution after Then, the lights still go on ( status to yes) and off (status to no).

Do I overlook something?

Please show a printscreen of your flow with the trigger that reacts to the button being pushed?
Becuase that one it probably the default homey card, and you need the special AVD when card.

Ah I got you wrong then :upside_down_face:
So you want a status ‘copy’?
Like, when a device is turned on/off, your switch has to turn on/off as well?

I guess @Caseda was right, Roger. But it can be quite complex sometimes.
Take a look at this example. The flow(s) with ‘this switch has turned on’ will not trigger when you turn the switch on and off with “and nothing else” option.
→ only if you manually operate the switch, the flow(s) with ‘this switch has turned on’ will trigger.
Peek 2022-12-07 23-57

If this is not what you’re looking for, I just got you wrong again I guess :wink:

1 Like

As I wrote already, I created a really simple ADC. Just a sensor to show the status of a kind of door sensor (link, sorry only in German language). But I changed the settings of the sensor every now and then and tried things out. And I did a restart of the app, if I remember correctly.

1 Like

Hi @Roger_Gorissen,
as Arie already wrote, please post a screenshot of your flow.

I guess the problem is that you just programmed one way. And that is only from the point of view of the switch, and not from the point of view of the lamp(s).
The way back is probably missing. If at a certain time the x lamps are switched off, then the button must also be switched off.
Switch button on → switch lamp on
Switch button off → switch lamp off
Lamp is switched on (e.g. by time) → button has also be switched on
Lamp is switched off (e.g. by time) → button has also be switched off

However, a generell problem is that you switch several lamps. What happens if only one lamp is switched off/on (e.g. by a time setting or manually), but other lamps remain off/on?

This is a sample where you can control up to 5 dimmable lights, made by @Arie_J_Godschalk. I guess something similar has to be created for your case.

1 Like

…seems Homeyscript is jumping up and down :wink:

1 Like

You describe it exactly as I mean. Switching lights on using the button is no problem. Lights react as supposed.

Problem arises when lights are switched off by another cause.

The status off command that @Peter_Kawa shows in his flows is exactly how I used it in the flow that switch off the lights on f.e. a fixed time. But strangely, the flow that is connected to the button is also activated, despite the “and nothing else”.
Even when I make a test flow: WHEN this flow is activated THEN status on and nothing else, then the lights are switched on, caused by the flow connected to the button. Seems like something is not working properly.

I don’t understand why I have to share the flow of the trigger when the button is being pushed? That part works okay.

I make a new button and see if that one works as it should be. I’ll take your suggestions and advice into account.

Keep you informed.

1 Like

Yep, once again “confirming” my feeling: somehow the athom-api is connected and doesn’t clear data correctly.
So athom-api apps will then (if so) be influenced by each other.

Because it looks like you use the triggercard from Homey itself: When xxx turned on.
That one will always trigger!
Even with the custom flowcard with “nothing else”.

As trigger, you need the custom AVD triggercard “when xxx is set/changed/pushed”.
That one will not be triggered by the NothingElse card.