I knew this day will come, because there was a warning on Home Assistant 's help page. And now, it seems that after I’ve updated my HA to 0.102.1 ,the Legacy Auth no longer works.
I had this third party node for Node Red that sent back to HA via REST api ,states, attributes etc, in a simple way. The node is called " [node-red-contrib-hass] ", and the connection to HA was made with the legacy password. After the latest HA update, my HA keept banning his own ip, saying “invalid authentication” etc… This node was the problem , because of the old authentication that is using.
I wonder if someone is having a solution, or an alternative to post stuff back to HA from node-red, without implying to code my own api or something, since I don’t know how to. Or maybe a fork to this " [node-red-contrib-hass] " with the updated auth ,since the latest update was over 3 years ago, and it seems that the project is abandoned.
move to the supported node that uses long lived token.
that should be able to help
The maintained and current version, dubbed “the websocket version”, has supported this forever. It communicates over the HA websocket API, and you can send and receive state.
Thank you for responding, I do use " node-red-contrib-home-assistant-websocket" since i use Hassio, but honestly I don’t know how to use that part that I need, I am a total beginner.
Basically, i have a ‘template sensor’ that i use, called nodered, so its sensor.nodered.
What i used to do with the node that is not working anymore, is to set 2 attributes for it, fed it from node-red and then displayed it in the frontend via a markdown card. The code in a ‘function’ node was something like this:
> var rednodeAttr2=global.get('rednodeAttr2') || "Updating...";
> var turnedOninfo=global.get('turnedOninfo') || "Updating...";
> var turnedOffinfo=global.get('turnedOffinfo') || "Updating...";
> var outp= {
> "state": "On: "+ turnedOninfo +"\nOff: " + turnedOffinfo ,
> "attributes": {
> "statusac": msg.payload,
> "statuscent": rednodeAttr2
> }
> }
> msg.payload=outp
> return msg;
where statusac is one attribute, and statuscent is another. Then the function’s payload was passed to [node-red-contrib-hass].
I don’t know even what node to call for this now ( fire event node, or call service) and /or how to use it in order to populate my fake sensor.
Thank you.
There is an aptly named “API” node that will do what you used to do.
You can call service to update the state of an entity
I solved my problem the easy way, thanks to @Kermit that has posted some wonderful new nodes for Nod Red, and one of them takes care of my problem.
You can check his topic here:
Two new nodes for Node Red
Thank you guys for trying to help me.