Can't Get HomeSeer Nodes to Update Using NR in App

I’ve added the HomeSeer nodes to a Node-RED instance running as an HA App and while I can control a device from NR, I can’t get any device nodes to update. My troubleshooting is telling me that the webhook defined in HS4 isn’t working or may not be accessible to NR.

http://172.29.1.10:8123/homeseer/webhook

Controlling a device is via the JSON web interface, so I can see why that is working. It’s the webhook that seems to be the issue.

Thanks for any guidance.

Port 8123 is likely connecting to Home Assistant and not the Node-RED app. To connect to Node-RED, use port 1880 (or whatever you have configured in the app configuration).

In addition, you may need to change the webhook to be a subpath of /endpoint in order to access it without Home Assistant authentication. If that is troublesome, you can try using the Node-RED Plus app instead which does not restrict the path.

Thanks. I’ll give that a try. Just to confirm…

The webhook would be http://172.29.1.10:1880/endpoint/homeseer/webhook

That looks right, if everything else is configured accordingly.

Thanks Rob. I’m not going to be able to test until tomorrow morning but I’ll report back.

No Joy. Here is what I see in the HS4 log:

Posting to webhook failed: The remote server returned an error: (404) Not Found. URL: http://172.29.1.10:1880/endpoint/homeseer/webhook

OK. After digging a little deeper, it looks like the HomeSeer server node in Node-RED expects to be accessed via httpAdminRoot (rather than httpNodeRoot). In effect that means you should remove the /endpoint from the URL, but it also means the webhook will require authentication. Maybe try something like this:

http://<username>:<password>@172.29.1.10:1880/homeseer/webhook

where <username> and <password> are valid Home Assistant credentials.

Still not working.

Posting to webhook failed: The remote server returned an error: (401) Unauthorized. URL: http://xxxx:[email protected]:1880/homeseer/webhook

Looks like you’re much closer.

Make sure the <username> and <password> exactly match a Home Assistant user listed in Settings > People > Users. You could also create a user just for the webhook.

Also, if either field contains any special characters, you may need to %-encode them to be URL safe.

I created a special user just for this.

user: test
pw: homeseer

Still doesn’t work. 401 Unauthorized.

Posting to webhook failed: The remote server returned an error: (401) Unauthorized. URL: http://test:[email protected]:1880/homeseer/webhook

Hmm, I’m not sure what the problem might be. I was successfully able to POST to the webhook using authentication in a test setup. Maybe HomeSeer doesn’t support basic authentication for the webhook? I don’t have HomeSeer myself so I’m only testing the node-red-contrib-homeseer nodes.

You could perhaps try something like the following to work around the authentication requirement… create three nodes:

┏━━━━━━━━━━━━┓   ┏━━━━━━━━━━━━━━━━━┓   ┏━━━━━━━━━━━━━━━━━━┓
┃ 1. http in ┣━━━┫ 2. http request ┣━━━┫ 3. http response ┃
┗━━━━━━━━━━━━┛   ┗━━━━━━━━━━━━━━━━━┛   ┗━━━━━━━━━━━━━━━━━━┛
  1. Method: POST
    URL: /homeseer/webhook

  2. Method: POST
    URL: http://localhost:1880/homeseer/webhook
    :white_check_mark: Use authentication
    Type: basic authentication
    Username: <username>
    Password: <password>

Then you could use http://172.29.1.10:1880/endpoint/homeseer/webhook for the webhook. This would be routed through httpNodeRoot which doesn’t require authentication and be processed through the nodes above. The second node will forward the request back to Node-RED via httpAdminRoot with authentication.

It’s a bit of a hack but maybe what’s needed.

EDIT: I unmarked this as solved since I’m getting timeouts under heavy load. It works fine with 2-3 updates per second but hangs with a timeout when a larger number of updates is received from HS4. I’ve moved back to using a standalone Node-RED instance for now.

Brilliant. THANK YOU! That works perfectly.

It took me a minute to think about what it was doing but now I understand it.

Thanks again,
Ken