Node-RED nodes for hubitat

Every few hours, Node Red has been crashing for the last few days here, so in my debugging, I'm searching out errors. Any ideas what this might be? It's probably not this, but I'd like to know.

Do you have some async / await code or something that returns a Promise? Something is throwing an exception in async code that's not being caught / handled. Looks like it's in the HubitatDeviceNode but it could be in an event handler hooked to a HubitatDeviceNode.

It seems to be a code issue. I'll handle it in the next days, but instead to have an ugly traceback, you will have a well formatted error message.
Device node try to fetch status of a device that's not in the global cache. My guess:

  • You send deviceId from the message input and the ID is not the right one
    • to debug: add a function node with something like node.warn(msg.deviceId) and now you should see an ID before the next traceback
    • wait until a better error message in 1-2 days, the know the ID
  • You add new device without redeploying your flow
    • try to redeploy a flow containing hubitat nodes
      (It should automatically redeploy config node, which will rebuild cache)
    • Look at the first post for the flow to rebuild global cache
3 Likes

@mike 1.7.3 released to handle the traceback
Now you will have a better error message with the device ID :wink:

5 Likes

Thanks, that was super easy. I found my error. Really appreciate it Francois.

3 Likes

I was getting a similar error and couldn't translate. I haven't had the crashing that you are experiencing though.

Node Red isn't showing option to update the Hubitat Nodes to 1.7.3 yet though.

I just went to the command line and entered:

cd ~/.node-red
npm install node-red-contrib-hubitat

The update to 1.7.3 gave the error in a language I could understand. As I suspected, I had deleted a couple of devices in HE without removing from Maker API first and had nodes in flows for those devices.

Has anyone else seen this in logs where instead of naming the device, it is giving a node ID for device:

I see this from one Hubitat but not the other.

I know I saw this.... I think I found it was related to a node not having a Name.

Screen Shot 2021-04-27 at 11.01.13 AM

I had to make sure Name had something in it. Used to be if you left it blank, it filled in with the Hubitat name.

That's what I remember.. but I could be remembering wrong.

Yes it's the same error, fixed with 1.7.3

1 Like

Thank you I didn't understand the question before your comment :sweat_smile:

Then yes there are 2 kind of name:

  • manually configured (internal attribute: name)
  • automatically populated (when you leave field Name empty) (internal attribute: deviceLabel)

When the attribute name is configured, then log will display it, otherwise it will take node-id. I don't remember if I made specific config to take name as label or if it is hardcoded in NR core to explicit take name attribute (I think so). I can look at this later

1 Like

It used to be that I'd have a hubitat node configured and then change something... I'd have to re-add it to the MakerAPI list and then, within Node-Red, reselect the device. I had acquired a muscle memory of opening the properties, deleting the Name then selecting the device. On closing the Name would be updated with the device name... as if Name wasn't optional. Currently though, Name is optional. A Blank name will work perfectly well... unless you don't read 16 char hex well :slight_smile: because that is what shows up in the log as far as I can tell.

Again, I'm still going by memory and haven't tested deleting Names to verify I'm lucid. :smiley:

I did try it and was able to duplicate.

27 Apr 13:54:52 - [info] [hubitat device:9c2d088f.9646f8] Initialized. motion: active

by doing a Search Flows for 9c2d088f.9646f8 it identified a new node in which I'd removed the name from:

Screen Shot 2021-04-27 at 1.56.56 PM

The Name field has the device name, but dimmed. Somehow that translates into 'no value' somewhere down the line. After typing the exact same words into Names for each, the 16char hex values in the logs vanished. :smiley:

3 Likes

Any suggestions on why my Change Node isn't replacing the msg.payload coming out of an Alexa Event Node from node-red-contrib-alexa-cakebaked pallet?

I would assume it would be real simple:
image

But what comes out of a Debug Node immediately after that Change Node is unchanged from what comes out of Alexa node:
image

I even tried a Delete msg.payload Node before Change Node and still the original msg.payload made it thru. What am i missing?

Remove the space at the end of "payload"... :grin:

There isn't a space after payload in Change Node.

Well that's the only way I can get it to fail in the test I just did - if I name it "msg.payload_" vs "msg.payload" (underscore is space).

For debug node show the complete object...

(note: I didn't think you really did this but it was the only thing I can think of that would mimic this behavior!)