Best Practice to check devices state

Hello,
When doing automatons that will trigger something when for example temp exceeds certain value, but the function is not time critical (i.e. it is ok to get notified 5 mins late), which is the ideal approach between the following? I have a Pi3B+ and would like that my logic is as lightweight as possibe :slight_smile:

  • make a trigger having a condition IF device.temp > 60C then …
    or
  • make a time based trigger to check device.temp every 5 mins, and if device.temp > 60C then …

Neither will make any difference to your 3B+ - even if you have a couple of hundred automations it won’t be a big deal. I had nearly 300 automations (many complicated ones) on my Pi3B and even with a stack of other software it rarely reached 25% load, with just the very occasional spike to 50%.

The first is the right way of doing such automations, and is the one I’d recommend.

2 Likes

what about memory usage?

Memory usage of HA… is trivial. Fully loaded my Pi3 rarely hit 50%, of which HA was just a part.

I have some 3K entities, dozens of template sensors, and more. My Pi could have handled twice that without breaking sweat.

I am at 70% - 80% :confused:

can you take a look at this thread maybe you can help?

In modern operating systems, unused RAM is wasted RAM

Yeah, but you’ve also got Node Red installed, consuming 33% of your RAM, and and a mountain of other stuff. You’re past the point where you should be thinking of running on something else than a Pi3.

Also, honestly, 80% is fine. 95%+ is a thing to look into, to see if you’re running into actual issues.

i am moving away from Node-Red right now, converting all automation to the in build HA automation platform. 80% is ok, but sometimes RAM increases and the Pi crashes