Hub Low on Memory Alert, Have Questions

I do not have access to my hub at this time so cannot send you a screen capture of the RM rule (will try later this evening) but it is a very simple rule. My rule accesses some of the attributes that are exposed by @thebearmay ’s Hub Information Driver. The Hub Information Driver exposes the Free Memory value of the hub. I have the rule set up so that I receive a Push Notification whenever the Free Memory gets below a certain value, as well as automatically triggering a reboot and restart of the hub. In addition, I receive another Push Notification once the hub has rebooted.

Unless someone else chimes in earlier, I can send a screenshot of the rule to you later today when I am on the same network as my hub.

Viewing memory % and a time selected reboot upon an exceeded threshold in my opinion should be built into Hubitat settings somewhere since its Alerting a memory issue and to reboot.

1 Like

To @UkSub , as promised, here is a group of three RM rules I use to manage and get notifications of when my memory starts to approach a critically low value. The three rules consist of: Rule #1 Hub memory low-reboot and notify; Rule #2 Hub Rebooted Notification; and Rule #3 Hub Rebooted - Update Mode States.

Rule #1 tells me when the memory is low and will automatically reboot my hub and notify me when this is done. The rationale for the 12 minute delay is that sometimes your hub may temporarily dip below the threshold level you set and you really only want the hub to auto reboot if it stays below a certain level for a certain period of time. The 2 minute warning allows you a short amount of time to abort the auto reboot if you wish.

Rule #2 sends me another notification to let me know if the hub has actually successfully rebooted based on the uptime that has elapsed since the last reboot, just so I know if I am at a remote location that the hub actually did successfully start up again.

Rule #3 makes sure that my hub is set to the correct Mode when it is restarted based on the time of day. If your Mode setting is triggered by a certain time, your Mode setting may be incorrect until the next time that particular time occurs again depending upon when your hub reboots (say after a power failure depending upon how long it takes for the power to be restored). This is not critical when a “low memory” reboot is automatically performed, but I just included this for your reference to be complete.

As mentioned in my previous response to your question, the device “- Hub Information -“ is the device set up with @thebearmay ’s Hub Information Driver. The various attributes such as “freeMemory” and “uptime” can be referenced via a device you set up using the Hub Information Driver and can be used as Required Expressions and Trigger Events as well as Conditions within your rules.

I have also set up a device using the Hubitat Hub Controller driver to initiate an automatic reboot of my hub upon hitting the low memory threshold. I believe you can also just use the Hub Information Driver device as well as there is a [Reboot] button on devices set up with that driver as well.

Here are screen shots of the three rules:

Rule #1

Rule #2

Rule #3

Note: While my Rule #1 triggers an automatic reboot of the hub as well as notifying me of the low memory condition causing the automatic reboot, to answer your question about a simple rule to notify of the low memory condition, you can edit my rule to get rid of the automatic reboot by eliminating the “reboot() on - Hub Controller - action line.

Hope you find these sample RM rules helpful to give you some ideas of at least one way to approach this.

I am sure that there may be more elegant ways of accomplishing this but this has been working well for me for a number of years now and has been rock solid. I also like to avoid combining too many functions in one rule as it sometimes makes troubleshooting much more difficult when something goes wrong (at least in my experience). By separating the functions into various (more simple) rules, I have found it is easier (at least for me) to track down a problem when and if they occur. Of course, YMMV. Anyway, hope this is helpful to someone.

BTW, I use local variables so that I can easily change the various parameters (such as my low memory threshold, uptime, etc) when I am experimenting with my RM rules to determine the optimum values to use. It is much easier to click on the local variable to change it than to go into the rule and have to edit values in each condition within the rule. This way I can easily see what values work the best for each condition in the rule and can easily change them.

3 Likes

Just built this simple rule, if memory <120mb for over 2hr, reboot at a specified time and notify me. I chose reboot time that wont interfere with any of my automations. Not tested yet.

Uses 'Hub Information driver' to get the freeMemory value for trigger. Again, I think this freeMemory should be a built in hub accessible value.

Very much apprecaited, @moh
My stalling point is the "hub information driver" Forgive me as i dont understand where or what this "driver" is. is this an app i need to install first? an idiots guide of how to get this bit established would be appreciated to help me (the idiot) out. thanks

Here is the info. It's real easy to find stuff here with a quick search. Click on the search magnifying glass and enter "hub information driver" and the first hit is: [RELEASE] Hub Information Driver v3

Just the job! much appreciated, thanks

Hi @kampto ,

Your rule appears to be a more elegant method compared to my Rule #1. Good job! At the time I created my rule, the “stays that way for x time” was not a part of RM so I had to figure out a way to incorporate this as a condition, thus complicating my rule.

It is nice to see how the Hubitat team keeps improving the software. Sometimes I actually get motivated to rewrite my rules to take advantage of the improvements just for OCD reasons. However, if my rules are working, I usually get lazy and just leave them as is (again, out of laziness, LOL). Yours is a nice rule though! Let us know if it works after testing. Thanks again.

While I created the reboot-rule as well, this just masks the underlying problem. It looks really strange, that the device is losing half of the available memory in a single day without anything in the logs/statistics indicating any unusual activity...

What activity is occurring at the large drop points (roughly 8:00 and 11:00, the 3-3:30 should be a backup)?

That's the thing - nothing is happening at that time. and I just checked, it is down to 120Mb now :frowning: Will check the log files now, to see if there was any activity.

What time are your local/cloud backups set for? What non built in apps do you have installed?

I have no backups scheduled at all and nothing in the logs when there are these significant memory drops.
Installed apps:

  • Bond Integration
  • Hubitat Package Manager
  • Kasa Integration (no active devices)
  • Lutron Integrator
  • MyQ Lite
  • Obit Bhyve Controller (no active devices)
  • Unofficial Ring Connect

I would start with removing the kasa integration. There have been reports of resource issues. I would also remove obit as well for now during testing.

I got the low memory alert for the first time as well. First time seeing it in ~2 years with hubitat. Rebooted and it's been fine for a few days so far.

Its slowly gettng low. Rule will be tested at <120mb. No idea why... Maybe its supposed to work like this
image

A slow decrease in free memory is normal, as are occasional larger drops that are then mostly recovered semi-immediately.

2 Likes

Well, removed "unnecessary" apps like Kasa, Bhyve, Ring and got it down to the bare minimum with Lutron, Bond, MyQLite - nothing has changed, memory immediately drops. does not recover and within 2 days is below 100k. It worked with ALL apps for 2+ years, so either the OS got too fat, or there is a memory leak somewhere. With quite a few others suddenly experiencing the same issue, I would not be surprised, if this is firmware based.

1 Like


These are fairly normal curves for my hubs. As you can see rebooted 2 of them yesterday, normal first ~30 minute drop as apps get loaded, and then a steady decline over time. Prior to reboot these had gone about 15 days (only because I rebooted them after making a large code update on a couple of packages) before being rebooted for an update. Development C-7 will hold at about that 420 line almost indefinitely when I’m not loading/modify code for testing.

1 Like