C7 hub, low memory

I installed the Hub Information driver. I created a virtual device using the driver. It seems to be getting some of the parameters, but I don't see "freeMemory" in the list of items to use to recreate your rule. I am sure I am missing something, but what?

Check the Custom Attributes if youโ€™re using RM. If you still donโ€™t see it, make sure you have freeMemory polling enabled in the driver:

I have Enable Free Memory Polling enabled. However, when I try to set the IF statement, I get this:

Hub Information freeMemory(null) < 250000.0(T) [TRUE]

It doesn't seem to be pulling the free memory. What I did not do was reboot the hub after installing the driver code and creating the driver though. Edit: I rebooted the hub, but still am not seeing a free memory custom attribute even though I have the memory polling enabled.

Did you hit Configure? Check your logs too, just in case it's throwing an error.

Yes, I did remember to hit Configure. I copied the code direct from the page and pasted it into the driver code. To the right of the configure/initialize buttons, there is a list and this is what shows up:

Current States
currentHsmMode : disarmed
currentMode : Home
data : [hardwareID:000D, zigbeeEui:000D6F00168FA93D, zigbeeChannel:0x14 (20), zigbeePanID:5428, localSrvPortTCP:39501, localIP:192.168.1.130]
firmwareVersionString : 2.3.0.124
formattedUptime : 0d,0h,58m,15s
hardwareID : 000D
hubModel : C-7
hubUpdateStatus : NO_UPDATE_AVAILABLE
hubUpdateVersion : 2.3.0.124
hubVersion : 2.3.0.124
id : 1
lastHubRestart : 1647810116345
lastHubRestartFormatted : 2022-03-20 17:01:56
lastUpdated : 1647813611402
latitude : 35.971763
localIP : 192.168.1.130
localSrvPortTCP : 39501
locationId : 1
locationName : Haffly_Home_Automation
longitude : -78.517388
name : Haffly_Home_Automation Hub
temperatureScale : F
timeZone : sun.util.calendar.ZoneInfo[id="US/Eastern",offset=-18000000,dstSavings=3600000,useDaylight=true,transitions=235,lastRule=java.util.SimpleTimeZone[id=US/Eastern,offset=-18000000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]]
type : PHYSICAL
uptime : 3495
zigbeeChannel : 0x14 (20)
zigbeeEui : 000D6F00168FA93D
zigbeeId : 000D6F00168FA93D
zigbeeStatus : enabled
zipCode : 27587
zwaveStatus : enabled

Edit: I switched on the Enable HTML Attribute Creation and these lines were added into the list:

html :
Name Haffly_Home_Automation Hub
Version C-7 / 2.3.0.124
IP Addr 192.168.1.130
Free Mem
Last Restart 2022-03-20 17:01:57
Uptime 0d,1h,6m,50s
Temperature
ZB Channel 0x14 (20)

You will note that the Free Mem line is blank.

Is there a scheduled job for getPollValues at the bottom?

If you have hub security enabled make sure you turn that on and enter the ID and Password. Other than that you could check to see if

http://yourHubIP/hub/advanced/freeOSMemory returns a valid value.

1 Like

Bingo! I needed to enable hub security. Now it shows a value. Thanks!

1 Like

I'm going to just have it notify me for now. If I see it as an ongoing issue, I guess I will install the Hubitat Hub Controller to automate the reboot.

Should be able to do that with the Hub Information Driver also (was added for rebooting if the hub came up without DHCP or a static address to force a retry).

2 Likes

Okay. I'll look at it more in the morning when I am more awake. Thanks.

Edit: I looked for a reboot option to add to the rule, but I don't see it. I see it in the driver with the Reboot button and I made sure that "Allow Hub to be rebooted" was turned on. How would I use that option in Hub Information in my rule to not only notify me, but to reboot also?

I guess you don't get a topic notification if I edit an entry. How do I add the ability to reboot to my rule that I set up for notification? I set the option on to allow it.

@StephenH Reboot should be listed as a custom action in RM.

1 Like

That is why I could not find it. I had no idea to look for "Actuators."

What is Hia Update?

Hub Information Aggregation

The command lets me overwrite the HTML attribute with a custom attribute that combines information from 2 or more hubs.

2 Likes

Here is the rule I made for rebooting if the memory is low:

Once I am sure it will work reliably, I will probably change the time to while I am asleep. Until then, I want to be awake to observe whether it works or not.

1 Like

It will work. I have been using the same rule for quite some time now, except that mine runs at 3:48am. I'm getting about 3 days between reboots on my C5 since changing my threshold to 250k.

It took me a bit to wrap my head around "Required Expression" rather than an If condition AND condition Then rule. Normally, I would think of it as
If
Time=8:05(F)
AND
Hub Information freeMemory (current memory) < 250000.0(F) [FALSE]
THEN
Notify . . .
AND
Speak . . .
AND
reboot() on Hub information
EndIf

The new way to write a rule does make sense though and should be easier once I get used to it. It just seems that Required Expression is just another way to say Condition.

1 Like

I'm creating the above rule to auto reboot at 3am if the hub memory is low. I want to get a notification on my phone that it happened, but not at 3am. I always forget what survives a reboot. If I put "send notification delay 6h" will I still get notified at 9am or will the reboot wipeout the delay?

if the notification time is not during the reboot you should get it.