Node-RED nodes for hubitat

I have a hub slow down occurring on a regular basis. I found this when I opened the log:

This is going constantly. After a reboot, it seemed to settle down, only sending updates.

Edit: Seems to have settled down. It starts up again when I edit or deploy a flow. So maybe it's supposed to happen?

Ok, I got tired of feeling like I should explain what nodes were what when I posted a picture of one of my flows so I have kept the icons the same so the rest of you can recognize the node types in my flows.... BUT I am still changing the colors cuz I am stubborn. :grin: :grin:
image

1 Like

Not sure who you are asking or what context your question is in, but the "remote2" palette mentioned above has zero dependency on Hubitat

2 Likes

Hi all -

I'm getting the following warning/error during startup (MaxListenersExceededWarning). How do I determine what node:9284 is?

30 Mar 12:33:15 - [info] Starting flows
30 Mar 12:33:15 - [info] [hubitat config:HubitatM] Starting endpoint for /hubitat/webhook
30 Mar 12:33:15 - [info] [hubitat config:HubitatS] Starting endpoint for /hubitat/webhook2
30 Mar 12:33:15 - [info] Started flows
(node:9284) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 device.1479 listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(node:9284) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 device.11 listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
telnet connect

The "telnet connect" immediately below the two warnings indicates the Lutron Caseta integration that I use to control my Caseta devices.

It seems related to nodejs not node from node-red. (node:9284)
I'll check it tonight, but from what I read now, you can ignore it
By curiosity how many different devices you have? (I mean different device ID, ex: 2 nodes with the same device = 1 different device)

1 Like

It is Hubitat device ID 1479. That should give you all the details about which device it is

1 Like

@fblackburn

Thanks! I have 31 devices from one Hubitat and 72 from my second Hubitat. In addition, I have about 30 Caseta devices that are brought in using a Lutron Caseta integration.

@dan.t

Thanks! It's a Sengled rgbw A19 that is in my Nightstand. I have other identical bulbs ....

It is not about the bulb itself. How many times do you have a "device node" in NR for this one device 1479?

1 Like

Aha! 14 times.

It is just a warning, you can ignore it. Or you can change the limit in node.js to make the warning go away. Either way it does not impact functionality.

2 Likes

Oh yeah I read too fast the documentation

@aaiyar I will bump the limit to 500 for the next release (instead of 10 currently)
While testing this setup I also found a bug: we leak some listeners on partial deployment :sweat_smile:

EDIT: Everything is fixed on master

4 Likes

Does this mean a new version is released? I cant find it. I presume now it means no new version yet.

It's on François' github.

Ok this is killing me that I can't figure out something that is probably so simple...

The Rokus can be controlled by sending HTTP Requests locally. I created an HE dashboard that has all of the buttons of a Roku remote plus some buttons that will take me to specific channels (21 total). I thought it would be easy and created a virtual Button Device w/ 21 buttons. Next, I put in a Device Node for the Virtual ROKU Remote & redirect the outbound payloads based on which button was pushed. My flow creates those URLs using a string node. It has one prepend for the channel buttons and another for the navigation buttons. Works like a charm!

So here is my problem (I think I understand why it's happening but not how to fix)....

It works too well. When I push any button, it ends up sending multiple HTTP Requests. As a workaround, I thought I would just use an RBE Node to stop the duplicates but there are times with the Navigation buttons that I will actually need to be able to push a button on dashboard multiple times in row.

I know it is something elementary that I am missing. Please help. I am about to resort to using RM.

How quickly are the multiple button pressed being passed through?

You might rate limit the messages to every 500msec, that way you yourself can press the button once every 1/2 second, but the device wont pass them through for multiple presses.

That's what I was thinking. A delay node set to discard intermediates is a wonderful debounce tool. I use it more for inputs (I have a few zigbee devices that like to update 2x for some reason within a few hundred ms of each other), but should work the same for an output.

Or just put the ones you don't want to throttle (like navigation) after the rbe, and the rest before it.

Only 1 button press at a time is appearing in the Hubitat logs for the Virtual Device and I just turned on logging for the Maker API and Maker API is only sending 1 log entry per button request. When I open Node-Red-log, it shows the multiple button presses.
image

Very strange! I will have to try the rate limit. I can't put the navigation buttons after an RBE because pushing a down arrow while in a menu will move the cursor down 3-6 times depending on how many repeats I get.

I will have to keep digging. I want to find a solution vs a workaround if it doesn't drive me to drink.

Are you sure the large node (and the list of actions) in the middle are set up correctly? Maybe there are issues with the flow. Did you copy but forget to change the input? I've done that too many times.

I think it's the bug I found yesterday (it's a regression from the event/callback logic refactor :cry: )

Can you try to restart the node-red server or use Full deployment or Restart Flows ?

That solved it! Dang, its always that darn regression from event/callback logic refractors causing problems. hahaha

I have no idea what that means but the dashboard works!!! You are helping to contribute to the WAF because my wife is the one that primarily watches the TV with Roku hooked up to it. Thank you.

I know I could have just used one of the community Roku Integrations but what fun is that when you can do it in Node Red? Sending HTTP Requests are easy to recreate button pushes but there are a lot of more complicated requests where the Rodu sends info back. I need to learn how to use that information on my dashboard remote.

1 Like