Node-RED nodes for hubitat

Yeah sure :+1:

Everything should be in your NR log (or docker logs) tagged as:

[error] [hubitat command:<node-name>] [<node-id>] <interesting-message-error>

I don't run it in docker - pm2 on bare metal linux. I did find the pm2 logs, though. I need to comb through them and see if I can pinpoint one of the errors. :+1:

Here we go. This is a really simple one:

19 Apr 08:02:26 - [error] [hubitat command:Front Door Lock] [b5b846ac.116088] [deviceId:1513] http://192.168.2.161:80/apps/api/326/devices/1513/departed: Device not found or not authorized to send that command
19 Apr 08:02:26 - [error] [hubitat command:Garage Door Lock] [c730e508.b553c8] [deviceId:1493] http://192.168.2.161:80/apps/api/326/devices/1493/departed: Device not found or not authorized to send that command
19 Apr 08:02:26 - [error] [hubitat command:2473c26d.3b985e] [deviceId:1779] http://192.168.2.161:80/apps/api/326/devices/1779/departed: Device not found or not authorized to send that command

Hard coded / node properties setup on the command nodes. Set to command "lock".

Based on the error, it looks like there may be a msg.command and/or msg.arguments getting passed to it from somewhere else in the msg chain - as there should not be a "departed" on it at all... I'll add some nodes to 'sanitize' the msg before it gets to the command nodes by removing msg.command, msg.arguments, and msg.deviceId.

1 Like

Looking through my (admittedly fairly complex) msg chain, I still can't figure out where the "departed" came from at all. But I'll keep looking. EDIT: Found it, and yes it propagated from about 5 previous flows deep - had to walk my way back through it.

The sanitize block below would have fixed it. I'll start adding that after command nodes/msg chains that go to a lot of other flows/nodes just to be safe.

Maybe msg.command, msg.arguments, msg.deviceId, msg.attribute should get stripped off the output msg from the command node? Regardless, my sanitize node will fix it.

Sanitize change node:
image

1 Like

FYI @fblackburn every error I saw in my logs (I looked at the past week or so) was due to unintended msg.command propagation.

I didn't find any evidence that there is rate limiter/too many commands at the same time issue. So that's good!

1 Like

@JasonJoel here's the PR for msg.responseStatus, any feedback is welcome

Maybe with the msg.requestXXX variables, these attributes are not really useful anymore. The only thing that make me hesitate, is that no builtin nodes (ex: http request) sanitize its input. It always forward input attributes to the output message. I opened an issue to write thoughts

Updated node red today and now I can not see devices under under property.
If i add a new device from hubitat I can not select a device under properties.
Checked API and all is right.
Does anyone have an idea to check?
All my nodes are working still but all devices and commands can not see devices from hubitat.

In 1.7.0, duplicate javascript code have been moved to a common file. Then you may need to force refresh your page (or try private navigation to test)

Otherwise, if you open the browser debugger (F12) and you look at the network tab when you open a device node. you should see a request with an error.

You can also look at the NR log to see more info (the location depends on your installation, the following command should output the log sudo journalctl -f -u nodered -o cat)

that fixed it. I hit F12 and clicked refresh and the devices show up now.

Thanks alot

1 Like

I agree. I would leave it as-is to be consistent.

1 Like

Not working again. restored my last backup and node red would work.
Updated node red and I'm getting the same as above. I tried f12 and looked at network and that seemed ok. No errors.
Still cant see any devices from hubitat.
I did find error below.
DevTools failed to load SourceMap: Could not load content for http://xxxx.xxx:1880/vendor/purify.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

Couple of things to try:

#1 Stop node-red and then restart it (node-red-stop, node-red-start)
#2 Refresh the webhook in the configuration node

Generally one of these will cure the problem for me.

No go. Stopped and Started and refreshed the webhook.

I guess I'll just restore from backup.
and try again when I have more time.

Thanks for the help.
Restored yesterdays backup and working again.

Just curious - would the "Catch" node trap it? I have a few flows that write to a MySQL DB and I rebooted the computer that hosts the db forgetting to pause these flows. I got spammed by my error handler! I haven't used it in my HE flows and I'm wondering if I should...

Maybe. Even then, though, you would still need to send it somewhere to view the full details - to a file, pushover, somewhere. Not as necessary now that I found the full PM2 logs so can just go look... :wink:

Yeah - I already have a "Notification" sub-flow using Pushover (transitioning to SMS/Email) that I use when some scheduled flows run (backup, restart etc.), so I would just use that.

2 Likes

Fix version 1.7.2 released

  • fix empty dropdown when you have httpAdminRoot or NR credential configured
    More information in this debugging thread
6 Likes

Wanted to report an issue with Node-RED update 1.3.0-1.3.3.

If you are using the MQTT Aedes broker node + MQTT nodes then you might experience some "Close timed out" errors on deploy. This is because Node-RED shuts down the Aedes broker before closing the MQTT nodes. This in turn causes the MQTT Nodes to generate an error due to being unable to close the connection to the Aedes broker.

1 Like

Sorry for the rookie question here but what is the copy paste method?

So like if you drag your mouse pointer over a select group of nodes and hit the delete keyboard key they disappear.

Can you do the same with copying nodes drag your mouse pointer over a group of them and click " what "???

Yes - Standard copy/paste controls - ctrl-c/v or cmd-c/v

The right-click does not work for me.

3 Likes