Generates excessive hub load on a sendEvent

I really do not know what else I could try.

Here is the code:
logger("debug", "Cmd4a")
sendEvent(name: "HSwing", value: "Off")
logger("debug", "Cmd4b")

In the log it displays only Cmd4a, it never reaches Cmd4b so the sendEvent is called once and genmerates this error.

Here is the log:

dev:1252023-05-09 07:41:05.394 AMdebug3rd floor AC Cmd4a

dev:1252023-05-09 07:41:05.398 AMerrorcom.hubitat.app.exception.LimitExceededException: App 47 generates excessive hub load on line 745 (method processStateData)

Any idea ?

Can you check event history in how many changes are reported for the "debug" attribute?

From the message I can only see that 'sendEvent' caused exception. And function were terminated (without reaching the next command).

For now I can only propose to wrap 'sendEvent' call with try/catch block to prevent early exit.

Unless you have that code being called by a very tight loop, it, in of itself, will not cause that error. Suggest you expand the search scope to include the code that references that section.

This proc is called 4 times and not in a loop. It crashes at the first call. I made lot of tests and I always got ONLY the first line of log (Cmd4a) so I cannot understand why it could be somewhere else.

I will try to see if it crashes on the next sendEvent.

If it's not in a loop, then I'd look to see how many iterations of the app you have running at the same time - may want to consider changing it to a single-threaded model.

I'm new in developing a driver. The app was already existing, I just created a new driver for this app. It was working fine on MY devices. But now I'm trying to modify it for another user so it's difficult for me to test it.

Sorry, I don't know how to see if it's single-threaded.

In the definition section add:

singleThreaded: true,
1 Like

Thank's I will test it.

Is this not the same issue you posted about in another topic?

I would just add another post there if you need more help rather than making duplicate posts, per the community guidelines. Now there are two topics tracking the issue. Perhaps they could be merged...

I decided to post in a different section because in that section it says:

If you searched the community and couldn't find the answer to your specific question, create a new topic and you'll receive advice from Hubitat staff and active users in this dedicated category.

I see that in section the staff answer more than everywhere else.

You can move your existing post (by editing the title--same place). While you're reading, check out the Community Guidelines and the note about not cross-posting:

I also wouldn't worry too much about what category you post in. Unlike traditional forum software, Discourse (what this runs on) makes it easy to see posts in any category, and most staff and and many users look all over, but I'd still make an effort to put it where it fits best. Coding questions only really seem appropriate for the "Developers" category, where yours was already moved by the time you replied.

2 Likes