"Call Service Node" "notify" + Error Message Node-Red

Hi,

i try to call a service from Nodered to HA.

Therefore i installed:

  • “Node-Red Companion” integration on HA
  • create Access Token for Nodered on HA
  • installed “node-red-contrib-home-assistant-websocket” on Nodered

For a first check in used the HA state node to check the connection to HA.
That works.

After that i tried to use the “call service” node to send a push notification to my mobile device.
That doesn’t work and i get the following error Message.

     'TypeError: (0 , lodash_1.cloneDeep) is not a function'

I didn’t find an information in combination with nodered or HA on the internet.
To call a service from type switch, doesn’t work as well.

Are there any ideas how i can find out where the problem is ?
I would be happy about every idea and approach to find out.

Thanks
Christian

PS: reininstall “Node-Red Companion” on HA and restart, done
reininstall “node-red-contrib-home-assistant-websocket” on Nodered and restart, done
actual version from nodered and integrations and nodes

Please post the code for the flow.

[{"id":"a1888055b097872d","type":"tab","label":"Flow 3","disabled":false,"info":"","env":[]},{"id":"3c4e4c5df1bd9ccd","type":"inject","z":"a1888055b097872d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":440,"y":160,"wires":[["6ca5c31487a82364"]]},{"id":"6ca5c31487a82364","type":"api-call-service","z":"a1888055b097872d","name":"Notify Test","server":"ccb0e94fdeeb06f1","version":5,"debugenabled":true,"domain":"notify","service":"mobile_app_kryslyx","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"Test Message\",\"title\":\"Test Title\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":730,"y":160,"wires":[[]]},{"id":"ccb0e94fdeeb06f1","type":"server","name":"Home Assistant","version":5,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":": ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"default","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

Regardless of which service I use, I get the same error message.
If I set nodeRed logging to debug, I don’t get any more information either.
I’m really at a loss as to what else I can check to track down the problem.
Even a newly installed HA in a VM does not change anything.

The connection itself seems to work because I get information from HA in NodeRed via the “events: state” node
However, everything I send out via the “call service” node leads to the error.

UPDATE:
It seems to be due to nodered. I did a new nodered installation and everything worked right away. Now I just have to find out why it doesn’t work in my productive instance.
One assumption was that nodes.js was not available in the current version. However, updating node.js did not help.

My guess would be lodash didn’t get installed correctly on the install or update. I would remove the node-red-contrib-home-assistant-websocket package and reinstall it.

1 Like

I did that two or three times with no effect.
Is it possible to install or update it manually? Or to check the loadsh installation and version.

Inside your node-red config directory should be a node_modules/lodash.clonedeep directory if it is installed. The version number can be found in the package.json file in that directory.

What’s your installed type of NR (container, add-on, bare metal)?
What version of node.js is running?

ok that’s weird. it really seems like a very old version is installed. However, I can’t bring it up to date.

  "name": "lodash",
  "version": "0.9.2",

11 Nov 15:32:30 - [info] Node-RED version: v3.0.2
11 Nov 15:32:30 - [info] Node.js version: v18.12.1
11 Nov 15:32:30 - [info] Linux 5.15.64-1-pve x64 LE

Running on a VirtualMachine in Proxmox