CocoHue generating excessive hub load

I was checking my logs this morning and I saw I had a large number of errors I think for every hue device attached via CocoHue

Device 41 is the CocHub Bridge. It is still seeing the bridge and sending/receiving.

Not seen this before and I have been doing some changes, so it might well be something I have done.

Any ideas or views on how to investigate further?

Steve

I resolved this by rebooting my HE hub.

Steve

That is the solution when you see this error. Often the driver/app being targeted by the error is not what is actually causing the problem, it is just what is trying to run.

Error is common if the hub reaches uptime over 60 days I have found, typically as you get closer to 90 days uptime.

3 Likes

Many thanks

It looks as if this is a much more persistent fault as it came back later in the day within 24 hours of the reboot. So I tried another reboot and it came back again, any ideas on what I should be looking for or doing to fix this issue?

Steve

Looking through the log I am also seeing a Java Error on the Hue matter bridge

java.lang.NullPointerException: Cannot invoke method toInteger() on null object on line 744 (method parse)

I am not sure if this is connected or not or what is causing this

I have now gone back to a backup from a month ago pre-dating the large set of changes I have done recently and HE is still generating these device 41 error .

Now at that time I wasn't aware of any errors, but then I wasn't looking. I didn't modify anything at that time and the system that was running had needed little of my time.

So my working hypothesis is that it not something I have done in my coding changes (restructure and using Hue Matter Bridge to control lights) or the additional devices I have implemented (2 * Govee Matter lights via HomeKit and a Switchbot Hub3 also via HomeKit using virtual switches to transfer device statuses to HE) and therefore it relates to something else, though I can't think what. HE can obviously see both HomeKit (HomeKit connection) and my Hue Hub (CocoHue and Hue Matter Bridge using generic matter driver) which are my major integrations.

I am running on a C-8 Platform 2.4.3.173

I am suspecting a major database failure, due to some odd behaviours I am experiencing when updating RM rules.

This is what I have attempted so far

Tried restoring past backups prior to making the code modifications - to no avail.
I have then restored the latest backup with a database rebuild
Disabled 8 devices using 'community drivers' (none of these have changed for over a year)
Backed up and done a soft reset prior to restoring the backup

All of these to no avail.

I then was doing a quick RM rule to automate some of the light settings following a system reboot as I had lights left on etc. As I was doing that I had an 'If 1st condition and 2nd condition then' statement and was finding if I changed one condition the other condition changed, for no good reason.

Any ideas of what next to ry and what I can do to resolve?

Steve

Those excessive load errors will often times break complicated apps like RM. Whatever background processes they run get terminated so then it gets all wonky. I have never seen it impact the UI like that but I know it messes up scheduled jobs.

Have you tried disabling the Hue App and Bridge device to see if it solves it?
Also have you updated CoCoHue to the latest version?

Let the hub run for some time after a reboot, or wait until you start getting errors. Go to Logs > App Stats (and Device Stats). Make sure all display settings are enabled. Should be sorted by %busy highest to lowest by default. Get a screenshot of the top however many fit on the screen, including the stats up top showing the uptime. Get that for both pages.

Thanks, It takes about 15 minutes for the error to show.

If I turn off the Hue Matter Device and the CocHue app I do not get any error messages.

If I turn on the Hue Matter Device I didn't get any error messages, although I noticed that alerts seemed to be elevated.

If I turn off the Hue Matter device and turn on the CocHue app then I immediately got the errors and alert status was severe.

screen shots taken when both were turned on

Here is the apps one again as I selected the wrong screenshot

It does look like your CoCoHue has gone bonkers.
You never answered if your app is up to date? If you installed with HPM and keep it updated there then you should be up to date.

Go into the CoCoHue app and turn on logging / debug logging (I forget what options it has). Maybe some additional clues as to what it is trying to do exactly will be in the debug logs.

@bertabcd1234 any ideas or other ways to troubleshoot? Could there be some sort of conflict with running CoCo and the Matter Bridge together? (I dont know what that Matter bridge even does sorry)

Apologies forgot to add that detail CoCoHue is installed via HPM and I don't get offered the opportunity to update it, so I guess it is up to date. The Hue Matter Bridge is an instance of the Generic Matter Bridge and is not a recent addition, although I have started to use it more recently. I have turned on debug and I am seeing some debug data coming through.

Now seeing slightly different error codes than I saw previously

refers to line 1241 and 370

You could try a "Repair" on CoCoHue just in case something got missed and HPM only thinks it's up to date, though it's been a few months since any updates.

If you keep having problems, you could see if tweaking any of your settings in the app helps. Enabling the V2 API/eventstream option and reducing your polling interval if it's fairly often might be good places to start, as well as making sure that your bridge configuration is correct (e.g., if you specified a static IP, make sure that hasn't changed).

Are you using the Hue Bridge with both the Matter integration and CoCoHue at the same time? While you can do that, I wouldn't recommend it long-term -- I could see commands from one causing events in both, and possibly on more than one device (e.g., both a light and a group), so that's probably not helping, but I don't see why it would be a problem alone. :thinking:

Thanks for the input.

I don't believe it uses a static IP address for the hub, and since the hub has remained up through this period I don't believe it has changed.

I have undertaken a repair and changed the polling duration from 20-45 seconds, to no avail.

There is no option to enable the V2 API/eventstream that I can see, only to turn off use of V1 for polling or stop polling. So I turned of V1 for polling and that did not seem to make a difference.

I then turned off polling but the system reset it to polling every 1 minute (default) and that seems to reduce the frequency but I was still seeing Errors and the system feels sluggish

With polling turned off these are the stats.


I then decided to try and see if rebooting the hue hub made a difference and the errors seemed to stop (the CocoHue device shows as on-line)

I then re-enabled polling to 20 seconds and turned on a light and the error messages recommenced.

So I changed the settings back to polling 1 minute and V1 turned off and the errors still continue.

I then decided to see if it could see the hub and it can with the same IP as previous.

I then set polling to 5 hours and the errors continue.

This morning I turned off both the HomeKit Bridge App, Hue Matter Bridge Device and the CocoHub app as I was getting random lights coming on and off

I am now getting

After a bunch of Null Pointer cannot invoke calls it now seems to just give the illegal state exception. This may be the byproduct of turning off the devices. However I am not seeing the flood of CocoHue excessive load alerts I previously got when I just turned off the Matter Bridge and CocoHue apps. So I will turn on the Hue Matter Bridge and CocHue apps, leaving off the HomeKit Bridge to see what happens

It is something with the CoCoHue bridge (device). If you look at these stats from when you had polling off, still the hub was busy 71% of 5h with devices, and of that time 77% was taken up by the Hue Bridge.

image

Here is what is more typical. Total device time is less than 1%

On the Hue Bridge device in the devices list, go in there nd turn on debug logging also if you have not already. (It may turn itself off after 30 minutes, not sure). I found you can also turn this on from the Integration app, Advanced Debug options.

Here is my integration settings (granted I only have two bulbs on the Hue Bridge)


Random thought, do you by chance have any heavy automations on Hue devices? Like possibly some sort of holiday lighting effects constantly changing colors of bulbs?

All of my bulbs (bar 2) are on the Hue Bridge and have always been. The 2 that aren't are all Matter via HomeKit.

I do have some holiday lighting effects but they are not running and haven't been since the New Year. I didn't have any issues over the New Year either.

Feeling hopeful I backed up the app without the errors ( it had stopped controlling via the Hue Matter Bridge) and restored yesterday's morning backup prior to my attempted diagnostics as I wasn't seeing any errors. I then modified 2 rules, to see if the issues I experienced on editing were still there (they weren't) and when I looked at the log the errors had started again.

I turned off those rules and it made no difference.

I have now turned off debug/logging for the Hue Matter Bridge device and CocHue

I was once told by staff that once an app or driver gets flagged for excessive load it won’t recover unless you reboot

1 Like