WARNING! Do not update websocket to 0.61.1 with Add-on version: 16.0.2

did you log in as root user?

Many blessings on you. What do you expect with open source.

My version is the one known as the ā€œHome Assistant Operating Systemā€.
I think the reason I donā€™t see the folder is that I donā€™t have such low level access.

Forgive me but my knowledge is quite limited.

But who is to ā€œblameā€ for this problem?

  1. Node-RED companion integration
  2. Websocket Nodes
  3. Node-RED addon

Just to clarify, I tried restoring the backup, but it didnā€™t solve the problem.
Every time I restart Node-Red I have to reinstall the websocket palette.

I think ā€œblameā€ is a highly emotive word and not something I want to be associated with in the context of this forum.

Please remember (and anyone else reading this thread) that HA is an opensource project and NOT a commercial product. There is an onus on us, the end users, to act with care and self-responsibility.

I have absolutely no connection with or contribution to the product or code we are discussing here, other than to freely use it (and I donā€™t pay for it, only for my Nabu Casa account). Since none of this would be here were it not for the hard work and efforts of the dedicated few concerned, I accept the product as it comes and fully applaud their work. Thanks to frenck for putting Node-RED into HA, and to kermit for making the HA WebSocket nodes work. (apologies to anyone else who I should also thank).

As you asked, all subject to my understanding being correctā€¦

The Node-RED addon is maintained by frenck. This is a customised package of the independent Node-RED language, with configuration settings etc specifically modified for HA, and the package includes a set of pallet nodes specifically for HA.
The NR addon release therefore includes a build with a given (at the time) version of Node-RED, and a (current at the time) set of the HA WebSocket nodes. Naturally this is tested as a working set (and released against a given version of HA).

The NR companion and the HA WebSocket nodes are built and maintained by kermit. Development is ongoing (dare I say frantic?) with numerous releases, so what comes out in a Node-RED addon release is a snapshot in time, against HA, Node-RED, and the WebSocket nodes.

HA has recently undergone a number of significant changes, for example the service call (API) now provides for a response. This means that every integration that works with service calls has (at some point) to change to accommodate this. Kermit is probably burning the midnight oil making the necessary changes.

As kermit does his work, he must be using the latest versions of HA and Node-RED (pointless otherwise). Also he will be making frequent commitments of his code (very sensible) once it is tested, hence the long release list.

It just so happens that Node-RED has gone to v3.1.1, and this is now required by HA WebSocket Nodes from v0.61.0+. Clearly, the Node-RED addon update has not yet caught up with the Node-RED version change.

It is possible to manually update any or all of these components yourself.
Updating the HA WebSocket node set is probably the easiest. HOWEVER, in this case, doing so has a breaking change and requirement for HA 2023.12+ and for Node-RED v3.1.1.

If you have not got Node-RED v3.1.1+ and HA 2023.12+ the WebSocket nodes will not work past v0.59.0. Kermit has included version checking (very sensible), so when trying to load / start the WebSocket nodes with the wrong supporting versions this will generate an error message or prevent the nodes from loading at all.

Conclusion:
The HA Node-RED addon is almost always going to be behind the latest ā€˜everythingā€™, so manually updating pallet nodes without checking for breaking changes and dependency updates can lead to problems.

I believe that you can fix your problem by downgrading to V0.59.0 (or by upgrading Node-RED to v3.1.1. but this would not be a good idea if you are using the NR addon)

You can prevent this from happening again by not automatically updating, by checking the release notes - particularly checking for breaking changes - and by cross checking the versions of the supporting dependencies you have installed.

You can also wait for the next Node-RED addon and just take the included WebSocket node set as provided.

I hope this fully answers your question.

6 Likes

Excellent explanation.

I had to revert to my Node-Red backup after updating in docker. After I found this page too late off course!

HA is running on another VM container supervised.

Thanks for the thorough answer.

One thing I learned:
if everything works donā€™t touch anything. :grin:
From now on I will never do a Palette update manually again.

We await the releases of new component versions.

I agree with you that we should be the ones to pay more attention to what we do.

I agree that ā€œGuiltā€ probably wasnā€™t the right word, even if put in quotes.
But sometimes it is difficult to convey the meaning of words using a language that is not yours, I am Italian and you know that in addition to speaking we gesture passionately :rofl:

Giuseppe

Iā€™m just catching up with this issue. I havenā€™t noticed it (and iā€™m up-to-date on everything), because I run HA and Node Red in the same docker-compose.yml, pulling whatever is the latest image of both. Therefore, Iā€™m using Node Red 3.1.3, HA 2023.12.3 and node-red-contrib-home-assistant-websocket 0.62.2 without issue.

Iā€™ve been considering going with HAOS on my next server hardware upgrade (instead of a container install), and using the add-ons, but this has opened my eyes to a potential gotcha in that scenario. Iā€™d have to watch the versions in my add-ons and be careful of dependencies like this.

In my day job, we have code that manages updates in dependencies. It automatically raises pull-requests and then runs through the tests ā€“ unit (would have passed in this case), integration (probably ditto) and end-to-end (BAM!) ā€“ catching things like this before they get merged.

I wish I had that safety net in my own house! I guess I could have a parallel, bleeding-edge HA instance with a couple of integrationsā€¦ :thinking:

I am a big fan of ā€˜if it is not broken, donā€™t fix itā€™ (in English), however I have learnt that the Node-RED palette does need manually updating - Node-RED moves on, the HA NR addon brings new versions, and some of the palette nodes then break.

This was evident last year when the NR addon update brought a new version of Node-RED and the default editor went from ā€˜aceā€™ to ā€˜monacoā€™. Many found themselves unable to edit (read only) function nodes - the editor did more error checking and old nodes that were not following the ā€˜rulesā€™ caused problems. Hence manually updating the Palette is required.

What would be good would be something that more easily indicated the node dependencies, at least in terms of Node-RED.

The HA - NR addon - HA WebSocket - NR Companion situation is quite complex, and seems to me to revolve around the version of Node-RED encapsulated in the addon. This sets a bar to both what is now required of nodes (so forcing an update of old node sets that no longer work with a newer version) and setting a bar above which newer nodes cannot be updated to their latest version.

I am sure that there is room for something like a version status traffic-light system for (if nothing else) the HA WebSocket node set, and ideally automated back into HA. What seems to be missing from the ā€˜versionā€™ number is something like

HA WebSocket v0.62.2 (HA 2023.12+, NR 3.1.1+)

which could allow visual and automatic dependency checking for the masses.
Room for improvement perhaps.

Oh, and I ā€˜take my hat off to youā€™ for managing to converse so well in a foreign tongue. I am native English, and so have a stiff upper lip, donā€™t wave my hands around for anything, and overcook my pasta.

If you are HassOS ie Home Assistant Operating System

  1. Install the Terminal addon & and start it
  2. To get to the correct path you should enter: cd /addon_configs/a0d7b954_nodered
  3. Follow the rest of the instruction instructions

Thank you guys.
Works a treat

2 Likes

@gleepwurp - I was stuck having to re-install the websocket upon every reboot. Thank you for posting the solution. I just wanted to share an alternative that may be simpler for someā€¦

If you have the Samba addon install the node-red config folder is shared on the network. I simply opened packages.json with notepad++ and made the edit you suggested. I then rebooted and the websocket survived so the problem is solved. Thank you again for sharing!

1 Like

Iā€™m using HAOS 11.2 with 12.3 Core. I donā€™t see the folder. If I try to find package.json it doesnā€™t show up. Any ideas? Thanks.

If you can login to your HaOS and issue the following command with sudo, it should traverse your entire system to find the packages,json file:

sudo find / -name "packages.json" 2>/dev/null

This will run the find as root, and omit any access errors that might clutter up your findingsā€¦ important to have the packages.json filename between quotes.

No thatā€™s what I did. My file structure appears different from what you apparently have. The only thing I can find is a path custom_components/nodered but the only json file in there is manifest.json. Itā€™s working but I keep losing the websocket node. I noticed itā€™s up to 6.2.2 but still a problem.

If you are using Node-RED as an addonā€¦

The HA file structure has moved around from 2023.12. This is an HA core change.

The Node-RED addon configuration is now in its own folder - HA config is still under \config but the Node-RED stuff has gone to \addon_configs

Under \addon_configs you should find a folder ā€œa0d7b954_noderedā€. This is now the new location for such wonders as ā€œpackages.jsonā€

If you use Samba share, you should be able to find the new addon config location by using \192.168.0.190\addon_configs (replace your IP address as appropriate)

I hope this helps!

Additional note:
No amount of updating the HA WebSocket nodes (to 0.62.2+) will solve this. From v0.61.0+ the HA WebSocket Nodes require Node-RED v3.1.1+. The current Home Assistant Node-RED addon package only has NR v.3.1

The long term solution will be the release of an update for HA Node-RED addon !

1 Like

Thanks. I reinstalled stuff and saw a message about things moving about. A difficult update maneuver and appreciate the people willingly taking on these tasks. Funny how they present themselves at the most inopportune times. Thanks again.

1 Like

[quote=ā€œbbostock, post:30, topic:653887ā€]
If you are HassOS ie Home Assistant Operating System

ā€¦/addon_configs/a0d7b954_nodered[/quote]

Woah I thought I was about to have my HA down for xmas eve and day! Manually operating lights would bring back some of that old xmas nostalgia for me, but now that is totally optional thanks to the key pointers from @gleepwurp & @bbostock. In my case with HassOS the former worked perfect for me. Serves me right upgrading today I guess, lol. At least this HA landmine wasnā€™t a big deal to fix.

1 Like

Realized that my node-red is a bit wonky. Node-red seems to work, but all my injects cannot be pressed or see any debug in the debug window.
In my package.json file, the line node-red-contrib-home-assistant-websocket is missing. Can I just add that line or?


Great, it works.
Thank you very much

Updating the websocket will result in a disable of these ws websocket nodes.
I tried to update because Node Red crashes every night structurally (since a few weeks) and was never like this before.

Hope it will be solved soon, thanks a lot!

  • Node Red: 16.0.2
  • Core 2023.12.4
  • Supervisor 2023.12.0
  • Operating System (Hassos) 11.2
  • Frontend 20231208.2