Node-red-contrib-home-assistant-websocket

I have a problem with version used by node-red plugin of hassio.
I know I can’t upgrade using the palette menu, so I follow an advice from this topic and used

"npm_packages": [
    "git+https://github.com/zachowj/node-red-contrib-home-assistant-websocket"
  ]

Restrating nodered plugin show me

[15:12:41] INFO: Starting installation of custom NPM/Node-RED packages...
+ [email protected]
updated 1 package and audited 876 packages in 22.587s

which seems to be good. BUT, if I look in palette menu, NR still says the sued version is 0.18.0 and I have the button “update to 0.22.3”… and it seems that NR still using 0.18.0 ( for example, sensor node is still called sensor node instead of the new entity node)…

Have I missed something ?


There was a problem with the nodered addon of hassio.
It shows the last version but it was still download old dependencies from it old package.json file… weird…
Uninstalling NR addon, deleting folder, re-install it and copy my nodes make it work…

I’ve installed both node-red and the companion from HACS in Home Assistant. I have a nodered folder in custom components…should work. . When I try to deploy and ENTITY, I keep getting the following message:

Node-RED custom integration needs to be installed in Home Assistant for this node to function correctly. (but it is installed???)

Nodered addon .04.4

Node-Red 6.3.0

name: testA
Server: home assistant
type: sensor
state msg ABC
attribute key TEST xyz

I’d like to get this working :slight_smile:

IGNORE: INSTALL ERROR

Did you restart HA after installing the custom integration in HACS?

I can answer my own question. Follow the instructions. User error.

I’m having a bit of a hard time understanding how to use the entity node and might have the wrong idea about it. When I first read about it, I imagined being able to read binary_sensor data from a remote HA instance and use the entity node to populate the master instance with that data. Effectively, a better/more versatile version of MQTT statestream.

But – can one (1) entity node not dynamically create/update multiple sensors? I’d like it to receive multiple incoming messages and create/update a binary_sensor for each. So for every binary_sensor on the remote instance, there will be one on the master instance as well. When I try to use the node for this, it seems to only output one sensor, no matter how many different msg topics I input through it.

I’ve read a bit about how unique node ids are handled in this thread but am not sure if this is impacting my situation.

If I were able to dynamically name each new incoming sensor (I’ve tried lots of combinations of whisker templates in the name dialog, no dice so far) it would allow me to set it and forget it. Any new binary_sensor I created would automatically be populated to the other instance.

Is this possible?

Thank you.

Yes, there needs to be a sensor node for each sensor you want to register with HA because of how it uses the node id within HA.

Here’s a post I made a while back about how to register and update dynamic sensors using the API node.

https://community.home-assistant.io/t/help-merging-2-node-red-flows-in-1/154642/23?u=kermit

You can also flow this Github issue for when this will become available using only the entity node.

Hi, looks like I have an issue with latest version of hass.
It looks like the events listener loose connection to the event after some time.

I have an event from a custom_component: zigate.attribute_updated.
I have a flow starting with this event running for months.
But today I have updated hass from 0.109.x to 0.112.2 and I have an issue.
After some time running, nodered doesnt start the flow anymore when the event is triggered.
If I just move a node and redeploy the flow it’s woking for some time until it stop again.

I have checked on hass side and the event is triggered I can see messages when I listen to it.

Any idea how I can debug this ?

edit: ok I’ve noticed that I was on a deprecated version of nodered container I’ve updated to latest with v1.1.0. I’ll wait to see if it works

edit2: stil got the problem but it looks like it’s not related to nodered. I have added a second events node with “state_changed” an it’s still receiving update after an hour but the events node with “zigate.attribute_updated” not…

Noticed today that my websockets stopped after the update to HA core 0.112.x. After deploying I’m getting “Node-RED custom integration needs to be installed in Home Assistant for this node to function correctly.” and the node says “Registered”. When checking the webhook address it was not created and the integration page don’t show no entity on the Node-Red integration.

Node-Red Addon: 7.0.0
node-red-contrib-home-assistant-websocket: 0.22.6
Node-Red Integration (via HACS): v0.4.4

Any thoughts about that?

Anyone using Node-Red 1.1.0 or 1.1.1 yet? Any risk in upgrading?

Thanks

Does the trigger: state node not output the friendly name of the entity id, like the current_state node does?
image

Yes, it does. That doesn’t look like the standard output of a trigger-state node. Did you manually trigger it?

Oh yeah, wow, I feel stupid, sorry for wasting your time. I did manually trigger it. That makes sense…

@Kermit,

I am a big Node-Red fan and have a lot of flows etc written in it. I am in the process of slowly implementing HA (running on a Virtual Machine with the official Virtual machine config of HASSoS etc)

I intend to continue running NR in a seperate Virtual machine - is this a support config for your node i.e. two seperate Virtual machines instead of Docker containers etc ?

By the Way Great NODE !!!

Craig

What step did you miss in the documentation? I have the same problem but can’t see what I did wrong. Maybe your input could help? Thanks!

go to configuration/integrations and choose node-red…you have to install it (again)…apparently HACS brings the package in, but doesn’t actually install it…you have to do the extra step.

New Release 0.23.0 (2020-08-02)

Features

  • Add extra data to the events:all output (4212cac), closes #229

Bug Fixes

  • Handle resubscribing after a disconnect (93d396c), closes #250

  • trigger-state: Only update HA when integration is loaded (1c187a5), closes #256

  • wait until NR integration is loaded (42b02cb)

Documentation

  • add documentation for events: all changes (6078302)

Buy me a coffee For those that enjoy my work.

1 Like

That’s it :slight_smile: Thanks for sharing! That wasn’t obvious from the docs.

New Release 0.24.0 (2020-08-04)

Features

  • events-all: Add option to output events before HA state = running (3f2e6ec)

0.24.1 (2020-08-08)

Bug Fixes

  • wait-until: Use the rendered template on event check (5721ebb), closes #259

Buy me a coffee For those that enjoy my work.

1 Like

Just updated and now I’m getting an error on restart of node red.

4 Aug 17:18:09 - [info] Waiting for missing types to be registered:
4 Aug 17:18:09 - [info] - server

And in node-red:

image

Appears to be stuck, not sure what to do.

*edit: tried console rolling back to version 0.22.0 but still stuck with the same error now :frowning:
*edit 2: console update to version 0.22.6 and now it appears to be working. :sweat_smile:
*edit: Ran Node-Red -V and got this message in the console:

12 Aug 22:26:42 - [warn] [node-red-contrib-home-assistant-websocket/server] Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/[MyUsername]/.node-red/node_modules/home-assistant-js-websocket/dist/haws.umd.js
require() of ES modules is not supported.
require() of /Users/[MyUsername]/.node-red/node_modules/home-assistant-js-websocket/dist/haws.umd.js from /Users/[MyUsername]/.node-red/node_modules/node-red-contrib-home-assistant-websocket/lib/ha-websocket.js is an ES module file as it is a .js file whose nearest parent package.json contains “type”: “module” which defines all .js files in that package scope as ES modules.
Instead rename haws.umd.js to end in .cjs, change the requiring code to use import(), or remove “type”: “module” from /Users/[MyUsername]/.node-red/node_modules/home-assistant-js-websocket/package.json.

Solution: Thanks to @Kermit for his help, updating NodeJS to version 12.18.3 eliminated the error.

Trying to install into a standalone NR 1.02 instance - getting this error thrown up - installing through the Palette manager.

This is on a Ubuntu 18.04 VM

2020-08-06T09:15:19.142Z Install : node-red-contrib-home-assistant-websocket 0.24.0

2020-08-06T09:15:19.473Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix="~" --production [email protected]
2020-08-06T09:15:28.325Z [err] npm ERR! code E404
2020-08-06T09:15:28.328Z [err] npm ERR! 404 Not Found - GET https://registry.npmjs.org/@hapi%2Fjoi - Not found
2020-08-06T09:15:28.328Z [err] npm ERR! 404
2020-08-06T09:15:28.328Z [err] npm ERR! 404 ‘@hapi/[email protected]’ is not in the npm registry.
2020-08-06T09:15:28.328Z [err] npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
2020-08-06T09:15:28.328Z [err] npm
2020-08-06T09:15:28.328Z [err] ERR! 404 It was specified as a dependency of ‘node-red-contrib-home-assistant-websocket’
2020-08-06T09:15:28.328Z [err] npm
2020-08-06T09:15:28.328Z [err] ERR! 404
2020-08-06T09:15:28.329Z [err]
2020-08-06T09:15:28.329Z [err] npm
2020-08-06T09:15:28.329Z [err] ERR! 404
2020-08-06T09:15:28.329Z [err] Note that you can also install from a
2020-08-06T09:15:28.329Z [err] npm ERR!
2020-08-06T09:15:28.329Z [err] 404 tarball, folder, http url, or git url.
2020-08-06T09:15:28.337Z [err]
2020-08-06T09:15:28.337Z [err] npm ERR! A complete log of this run can be found in:
2020-08-06T09:15:28.337Z [err] npm
2020-08-06T09:15:28.337Z [err] ERR! /home/pi/.npm/_logs/2020-08-06T09_15_28_331Z-debug.log
2020-08-06T09:15:28.354Z rc=1

regards

Craig