Hubitat Node-Red device state not auto updating

I have Node-Red up and running inside of Home Assistant on a raspberry pi. My HE hub is also running properly with the Maker API app installed. Both hubs seem to be working as expected independently, as I'm able to manually inject commands to control my HE devices on NR. However, I can't seem to get the Device node to reflect the state of my devices as seen in the HE dashboard.

Specifically, I have a motion sensor that I wan't to trigger a light. Both are working as intended in the HE dashboard, and like previously mentioned, I can trigger the light on/off inside of Node-Red. But the motion sensor node (in NR) doesn't ever change on it's own.

I assume there must be something I'm doing wrong in the webhook config, but wouldn't that prevent me from being able to manually trigger the light? Any help would be greatly appreciated!

No, the webhook is only used for updates from the hub to the client. Command nodes do direct http calls to the hub.

Maybe pretty some pics of your webhook config.

Here's my webhook config:

!

And if it matters, my HE config:

I assume 86.3 is the node-red IP, and 86.5 is the HE IP?

Maybe try it w/o a CORS IP specified first?

See if you can connect to Node-RED on 192.16886.3:1880 from another PC. If you can't then HE can't either. If not then it may be a docker port publishing issue.

I know there are a few others that run node-red in HA (I don't), so maybe they will see this and chime in with some thoughts, too.

Hey Jason, sorry for the radio silence, and thank you for the quick reply!

I have it working now, and I think the problem was my POST url port number. I read in a few different places that this is typically the point of failure people run into, but I had so many series of numbers floating in my head trying to figure this out that this one slipped by.

Thanks again!

2 Likes

Reviving this thread:
This was seemingly resolved for a bit, but it's no longer working and I've tried removing and reinstalling both the Maker API app and config in HA multiple times. No luck.

I think I'm not understanding the connection between HA and HE enough. On the Maker API side, should I be hardcoding my HA ip:port that I used to launch the webpage with? And on the HA/node-red side, should I be using that same url:port/hubitat/webhook? And in that same window the HE server port number should stay at the default '80'?

Sorry, I'm not thoroughly fluent in networking ins and outs. I know just enough to be dangerous, but at a certain point I devolve into stabbing in the dark...

It is intended to be very simple...

  • In Hubitat Maker API config - POST URL points to whatever IP and PORT Node-Red is listening on. Normally this is the machine IP where node-red is installed and port 1880, but if you are running it in HA then the port may/may not be different - don't know.
    • That may/may not be where it is failing. My guess is that this is the breakdown though.
    • If this part is broken/misentered you will not get automatic updates on device nodes in node-red (but command nodes, etc may still work as they do not use this connection at all - see below).
  • In Node-Red hubitat node setup - "server" points to the hubitat web address.
    • If this part is broken/misentered you will not get a list of devices in the node configs, and command nodes will not work.

Entering something in Node-red setup for webhook configuration and hitting "Configure Webhook" just writes that text to the POST URL setting in Maker API.

1 Like

Another lightning fast reply! Amazing!

You're totally right, and thanks for hand holding me through. It was ultimately the port that was tripping me up. I completely forgot that the node-red config in HA has it's own port specified by way of the supervisor

The other key thing I was confused by was whether or not to add or remove the '/endpoint/' (it needs to be there):

Looking at both of these, coupled with your explanation makes perfect sense. Kicking myself for not seeing it before, but more glad that I finally have it all straight in my head.

Thanks again for your help!

Hi - this is baffling me! I've followed these instructions to the letter... and it's just not working! I can see all the nodes, I can push events and everything is working just grand except real-time update from HE to Node-Red. Real-time updates do work if WebSockets are enabled.

Trying to debug I set up a 2rd Maker API to expose HE devices directly to HomeAssistant and then used the HomeAssisant nodes in hassios Node-Red. These update in real time.

Taking it further I installed NR outside of hassio and set up a 3rd maker API and linked the two, this works a charm without websockets being selected.

So... the only thing NOT updating in real-time is HE to NR (within hassio). I"ve checked I have matching ports, application IDs and security keys are right, I can access Node-Red outside of hassio) the /endpoint is in both sets of configs... I'm now at a loss! websockets seems to be the only way to get it updating, and thats a "not recommended" setting.

Brain is truly frazzled!

Node-Red Config:

HE config:

Any help gratefully received, thanks

EDIT: Deleted old post.

I see you are running node-red in hassio - I can't help you there. While I use Home Assistant, I don't run node-red in it. I know other do/have though so maybe someone else will chime in.

Believe your POST link is missing underscore and has an additional "/"
URL to send device events to by POST
http://192.168.1.254:1880/hubitat/webhook_

thanks for the input... no joy sadly

same results

Dunno. Make sure there is no trailing or leading spaces on those entry fields?

Don't run it inside of hassio? :slight_smile:

The same idea occurred to me but when installing the home assistant node into my new node-red install (v1.2.7) I got this!


2021-01-22T00:24:19.080Z Remove : node-red-contrib-home-assistant-websocket

2021-01-22T00:24:18.898Z npm.cmd remove --no-audit --no-update-notifier --no-fund --save node-red-contrib-home-assistant-websocket
2021-01-22T00:24:21.069Z [out] removed 60 packages in 0.933s
2021-01-22T00:24:21.091Z rc=0


2021-01-22T00:24:38.035Z Install : node-red-contrib-home-assistant 0.3.2

2021-01-22T00:24:37.661Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production node-red-contrib-home-assistant@0.3.2
2021-01-22T00:24:40.037Z [err] npm
2021-01-22T00:24:40.037Z [err] WARN deprecated joi@13.7.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
2021-01-22T00:24:40.665Z [err] npm ERR!
2021-01-22T00:24:40.665Z [err] code ENOENT
2021-01-22T00:24:40.665Z [err] npm ERR! syscall spawn git
2021-01-22T00:24:40.665Z [err] npm ERR! path git
2021-01-22T00:24:40.666Z [err] npm ERR! errno -4058
2021-01-22T00:24:40.668Z [err] npm ERR! enoent Error while executing:
2021-01-22T00:24:40.668Z [err] npm
2021-01-22T00:24:40.668Z [err] ERR! enoent undefined ls-remote -h -t ssh://git@github.com/node-red/node-red.git
2021-01-22T00:24:40.668Z [err] npm ERR! enoent
2021-01-22T00:24:40.668Z [err] npm ERR! enoent
2021-01-22T00:24:40.668Z [err] npm ERR!
2021-01-22T00:24:40.668Z [err] enoent spawn git ENOENT
2021-01-22T00:24:40.668Z [err] npm ERR! enoent This is related to npm not being able to find a file.
2021-01-22T00:24:40.668Z [err] npm ERR!
2021-01-22T00:24:40.668Z [err] enoent
2021-01-22T00:24:40.672Z [err]
2021-01-22T00:24:40.672Z [err] npm
2021-01-22T00:24:40.672Z [err] ERR! A complete log of this run can be found in:
2021-01-22T00:24:40.672Z [err] npm ERR! C:\Users\VisionUser\AppData\Roaming\npm-cache_logs\2021-01-22T00_24_40_668Z-debug.log
2021-01-22T00:24:40.685Z rc=4294963238

Solved!

Eventually I went back to basics and I think the issue lay in the NR config so i made the following changes in the Config settings in the HA GUI in addition to all the good advice from Jason:

  1. removed the static node and http node passwords, i think these are not needed now as access is via the HA passwords
  2. double-checked the credential secret was correct for the Maker API being used

That seemed to solve it!

Thanks for the help :smiley:

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.