Node-red-contrib-home-assistant-websocket

i just discovered this is not working as i expected. is that “& topic” can be also " & global.name"?

image

thank you!

These nodes do not work anymore for me. Every time I open node-red I see the message I post i this image. I tried to uninstall, reinstall, nothing solves it. Any idea?

I have the same same issue. On install I get this:


-----------------------------------------------------------
2022-11-27T21:36:17.867Z Install : node-red-contrib-home-assistant-websocket 0.47.0

2022-11-27T21:36:17.946Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2022-11-27T21:37:08.603Z [err] npm
2022-11-27T21:37:08.605Z [err]  WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/chokidar/node_modules/fsevents):
2022-11-27T21:37:08.605Z [err] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
2022-11-27T21:37:08.606Z [err] 
2022-11-27T21:37:08.609Z [out] + [email protected]
2022-11-27T21:37:08.609Z [out] updated 1 package in 48.279s
2022-11-27T21:37:08.739Z rc=0

Latest version known to work: 0.43.1

So I actually deleted an empty file with the same name in the node-red directory, and everything works.

I had to update node red to version 3. So everything working now.

Hi,

would it be possible to show an example of how to create an entity that will appear in HA?

I’m stuck. When I drop a binary sensor and attempt to configure it, it wants me to provide device details, rather than entity details.

Maybe it’s just that the documentation doesn’t go through the steps?

Thanks!

B.

  1. Drop a binary sensor onto the NR workspace
  2. Open the node in the editor, edit the entity config, and click on the pencil button.
  3. Everything is optional on the entity config except the server and type.
  4. Click Add for the entity config
  5. Then Done in the binary sensor editor.
  6. Deploy

In HA under Settings > Devices & Services > Node-RED you should now have a binary sensor with the state unknown. Attach a inject node to the binary sensor in NR and send it a payload and the state will update.

2 Likes

Hi Kermit!

Thanks so much for your rapid response!

B.

Hello again Kermit, one more question please? ( a multi-part…)

Once created, does the new sensor exist until destroyed?
How is it destroyed?
Should the same node that creates it be used to update it, or will a simple call service do?

Thanks again!

B.

are there any known issues with 0.49.0? I just updated from 0.47.0, i am on Hass Core 2023.3.6 and the trigger:state and event: state nodes don’t seem to be working

I was gettting the dreaded

23-05-16 10:21:50 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request initialize
23-05-16 10:21:50 INFO (MainThread) [supervisor.api.proxy] WebSocket access from a0d7b954_nodered
23-05-16 10:21:50 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running
23-05-16 10:21:50 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API error: Received message 258:WebSocketError(<WSCloseCode.MESSAGE_TOO_BIG: 1009>, 'Message size 4982137 exceeds limit 4194304') is not str
23-05-16 10:21:50 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API connection is closed

and I was able to get past this by doing a few things

#1. Make a full backup incase you bork this, editing stuff in the .storage folder can really wreck your day if you’re not careful
#2. removed unifi and ibeacon integrations since they had amassed a few thousand entities. I had disabled all those entities via the UI and stopped them from adding more, but that didnt seem to matter… The websocket payload clearly showed them in the debug logs
#3. restarted HA to make things clean
#4. manually remove items from core.entitiy_registry config file ( steps below )

ha core stop
cp ~/config/.storage/core.entity_registry{,.original}
cat ~/config/.storage/core.entity_registry.original  | jq 'del (.data.entities[] |select(.platform=="unifiprotect"))' > ~/config/.storage/core.entity_registry

#5. Clean up core.device_registry ‘deleted_items’ as discussed here
#6. Start up HA again

ha core start 

#7. Look for errors in supervisor logs

docker logs -f hassio_supervisor -n 100

This seemingly got me going again … hope someone finds it helpful…

@Kermit I do have a quick question for you if you have a second… is there any way to monitor the current size of the payload so I can maybe get ahead of the problem next time before it impacts my “uptime” and I blow all my family error budget when all the automatons fail :stuck_out_tongue_winking_eye:

After upgrade to NodeRED 3.1.0 I have problem with this plugin:

Does anyone have an idea how to solve this?

07. 09. 2023 13:41:37
7 Sep 13:41:37 - [warn] Deprecated API warning: Calls to RED.util.evaluateJSONataExpression must include a callback. This will not be optional in Node-RED 4.0. Please identify the node from the following stack and check for an update on npm. If none is available, please notify the node author.
07. 09. 2023 13:41:37
7 Sep 13:41:37 - [warn] Error: 
07. 09. 2023 13:41:37
    at Object.evaluateJSONataExpression (/usr/src/node-red/node_modules/@node-red/util/lib/util.js:775:18)
07. 09. 2023 13:41:37
    at JSONataService.evaluate (/data/node_modules/node-red-contrib-home-assistant-websocket/dist/common/services/JSONataService.js:58:39)
07. 09. 2023 13:41:37
    at CallService.evaluateJSONata (/data/node_modules/node-red-contrib-home-assistant-websocket/dist/nodes/BaseNode.js:131:36)
07. 09. 2023 13:41:37
    at CallService.onInput (/data/node_modules/node-red-contrib-home-assistant-websocket/dist/nodes/call-service/controller.js:63:50)
07. 09. 2023 13:41:37
    at CallService.preOnInput (/data/node_modules/node-red-contrib-home-assistant-websocket/dist/nodes/BaseNode.js:208:18)
07. 09. 2023 13:41:37
    at /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:210:26
07. 09. 2023 13:41:37
    at Object.trigger (/usr/src/node-red/node_modules/@node-red/util/lib/hooks.js:166:13)
07. 09. 2023 13:41:37
    at callServiceNode.Node._emitInput (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:202:11)
07. 09. 2023 13:41:37
    at callServiceNode.Node.emit (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:186:25)
07. 09. 2023 13:41:37
    at callServiceNode.Node.receive (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:494:10)
07. 09. 2023 13:41:37
    at deliverMessageToDestination (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:799:40)
07. 09. 2023 13:41:37
    at Immediate._onImmediate (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:815:21)
07. 09. 2023 13:41:37
    at processImmediate (internal/timers.js:464:21)

https://github.com/zachowj/node-red-contrib-home-assistant-websocket/issues/898

I know about it, I always reported the problem there too.

NR appears to be spontaneously updating the flows and losing the config to connect to HA.

I have updated my components so that I am now on version v3.1.3 of NR, 0.62.2 of node-red-contrib-home-assistant-websocket, v3.1.2 of the Home Assistant Node-RED Companion.

This started happening on the morning of 1/1/24:

2024/01/01 08:17:02,stdout,1 Jan 08:17:02 - [error] [server-state-changed:40aa24fd6365c0f5] Error: Server config node not found
2024/01/01 08:17:02,stdout,1 Jan 08:17:02 - [error] [server:8543beb1656653ec] Error: No credentials provided
2024/01/01 08:17:02,stdout,1 Jan 08:17:02 - [info] Starting flows
2024/01/01 08:17:02,stdout,1 Jan 08:17:02 - [info] Updated flows
2024/01/01 08:17:02,stdout,1 Jan 08:17:02 - [info] Stopped flows
2024/01/01 08:17:02,stdout,1 Jan 08:17:02 - [info] Stopping flows
2024/01/01 08:16:59,stdout,1 Jan 08:16:59 - [info] Started flows
2024/01/01 08:16:59,stdout,1 Jan 08:16:59 - [info] Starting flows
2024/01/01 08:16:59,stdout,1 Jan 08:16:59 - [info] Updated flows
2024/01/01 08:16:59,stdout,1 Jan 08:16:59 - [info] Stopped flows
2024/01/01 08:16:59,stdout,1 Jan 08:16:59 - [info] [server:Home Assistant] Closing connection to http://localhost:8123
2024/01/01 08:16:59,stdout,1 Jan 08:16:59 - [info] Stopping flows

It is happening every day and often at around 23:00 when I certainly wouldn’t be doing anything. Full log at this gist: Node RED log for lost config issue · GitHub

Any ideas of what could be causing this?

Hi guys, does this still work? is this the best way to integrate a remote NR installation with HA?

I have added the node-red-contrib-home-assistant-websocket palette to NR, generated a long lived access token in HA, then I setup the config node to speak to IPADDRESS:8123 and populted the password field with the token key.

But I receive “Invalid access token or password”

The key is obviously longer than what it looks in the screenshot, it seems to truncate it after I save the configuration module… is that normal?

image

nevermind… seems there are two websocket palettes, one has not been updated in 7 years… dont use that one!