Http in node

Any luck with this? I am having the same issue with trying to use the http node with a shell command . Latest version of HASSIO and the node red add on

For a while now Iā€™ve just used a stand-alone docker for node-red as opposed to the hassio add-on without any issues.

Guess I should look into this. How hard is it to export the palette, flows, connection settings, etcā€¦?

Easy. Basically export the flows as a JSON and import it into the new instance. Youā€™ll need to configure any connection setting as those are not fully copied in an export for security purposes, I assume.

Itā€™ll prompt if you if any nodes are not recognized (eg a node dependency that you might have to install).

Donā€™t get me wrong - the node-red addon is nice too, and I donā€™t mean to have you jump the gun in moving to a stand alone docker. But I manage a number of stand alone dockers for other purposes, so it was a no-brainer for me.

For anyone who stumbles onto this thread from elsewhere, you need to use url in the following formā€¦
[node-red URL with port]/endpoint/httpNodeName

3 Likes

Thank! simply inserting /endpoint/ to my old requests worked!

25

1 Like

Hope it is ok to ask, found your thread and wonder if you have time to elaborate on post? I am using Fibaro scenes to run node red on home assistant and am tyring to send a api request to a node. I have tried various variations in referance to your suggestions, presently trying : http://hostname.local:8123/endpoint/lgtv/netflix. This is a temporary fix until i move fibaro scenes over to HA. Greatly appreciate any ideas. Thanks

Unless you changed the default ports, the endpoint you are referring to is in nodered.
As such the correct url for the endpoint is http://hostname.local:1880/endpoint/lgtv/netflix
8123 is the default port for HA
1880 is the default port for NodeRed
GV

Not sure if i understand correctly, but you should not use username and password anymore.
Instead, send the HTTP Request via Bearer Authentification (create a token in the Hassio UI).
With this you can simply do as previously (i.e. update states as in my picture below)

Thanks for info, unfortunately i canā€™t get it to work. Can i explain a little more? I have a scene on fibaro homecenter that starts lgtv/netflix when a light comes on. I have used this api for a long time with node-red running on my mac. I have now moved home assistant and node-red addon to a rasp Pi4 connected to my home network. Iā€™m not great with coding and am a little unsure of what to do next. Just to ask, what is the hostname ,meaning what device ? Is it the name of my home assistant instance ? I have read that i can change config/node-red/settings.js file to bypass the home assistant login in name /password. Is this the way to go ? Thanking you in advance for any ideas/info.

In the example ā€œhostname.localā€ can happily be replaced by the IP address of the Pi4.
In my situation (which is I think the default), the node red endpoint (your_Pi_4_address:1880) is not password protected.
In a browser if you call http://your_Pi_4_address:1880/endpoint/lgtv/netflix it should do what you wantā€¦ or at least what is in the flow with the defined lgtv/netflix endpoint.
GV

Sorry for the delayed response. @greengolfer is right about how it works. Did you have any luck?

A bit of an update.
In my case I ended up using MQTT and getting my Xeoma (my camera software) to run an application and got it to call mosquito. It went well. Got me out of trouble and simply had node red monitor the topic etc in MQTT.

My camera server died. So I built up a new UNRAID box and installed a Xeoma docker. Now that docker doesnt have MQTT so I went back to try HTTP and a HTTP in node.

I am actually running Node-Red also on another RPI without any HA stuff as I use the RPIs for miny PLC units. So I installed MQTT on it as well. My original camera server was also my MQTT server.

So added a HTTP In node and can call it from web pages. Use the exact same URL in Xoema and when you hit the test button, it says it connected etc but nothing is outputted from the HTTP IN node. Take that node away and Xeoma complains.

So whilst it originally worked some time ago, in my case NODE_RED addon for Hassio will have to be tested again but NODE-RED on a separate RPI and Xeoma dont talk from Xoema to Node-Red From Node-REd to Xeoma using a request node it does. I am now looking around for new dockers with MQTT built in and then getting that to work.

On a side note: I have recently tried Zoneminder, Shinobi, Motioneye and got real excited over AGENT DVR in trying to fix my issue as I use movement in the cameras to trigger lights but I am back to Xeoma. I use a request node to imprint the last time the doors were open into the video as a reference

After a long sturggle, here is what is worked.
You go to http://your_Pi_4_address:1880 , it asks for user name and password.
Just use the Hassio user and pass. Not the ones you made in Nod-RED configurations.
Weird but it works.