Modbus connection in Node Red lost after restart of HA

Hello,

I recognized that after restarting HA the modbus connection of my Node Red nodes to my wallbox are lost. Sometimes the connection comes back after 5-10 minutes but most of the time it doesn’t and I have to restart my wallbox to get connection again. Does anybody know what the problem could be?

Thanks in advance!

Could it be you need to wait for NR to completely start (check your node-red debug log on startup)?

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting
-----------------------------------------------------------
 Add-on: Node-RED
 Flow-based programming for the Internet of Things
-----------------------------------------------------------
 Add-on version: 14.1.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 9.5  (amd64 / qemux86-64)
 Home Assistant Core: 2023.3.6
 Home Assistant Supervisor: 2023.03.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-nginx: starting
s6-rc: info: service init-customizations: starting
s6-rc: info: service init-customizations successfully started
s6-rc: info: service init-nodered: starting
patching file nodes/ui_base.html
Hunk #1 succeeded at 1164 (offset 633 lines).
s6-rc: info: service init-nginx successfully started
up to date, audited 308 packages in 6s
57 packages are looking for funding
  run `npm fund` for details
6 vulnerabilities (4 moderate, 1 high, 1 critical)
To address issues that do not require attention, run:
  npm audit fix
To address all issues (including breaking changes), run:
  npm audit fix --force
Run `npm audit` for details.
s6-rc: info: service init-nodered successfully started
s6-rc: info: service nodered: starting
s6-rc: info: service nodered successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[22:32:03] INFO: Starting Node-RED...
> start
> node $NODE_OPTIONS node_modules/node-red/red.js --settings /etc/node-red/config.js
23 Mar 22:32:04 - [info] 
Welcome to Node-RED
===================
23 Mar 22:32:04 - [info] Node-RED version: v3.0.2
23 Mar 22:32:04 - [info] Node.js  version: v18.14.2
23 Mar 22:32:04 - [info] Linux 5.15.90 x64 LE
23 Mar 22:32:05 - [info] Loading palette nodes
23 Mar 22:32:08 - [info] Dashboard version 3.4.0 started at /endpoint/ui
23 Mar 22:32:09 - [info] Settings file  : /etc/node-red/config.js
23 Mar 22:32:09 - [info] Context store  : 'default' [module=memory]
23 Mar 22:32:09 - [info] User directory : /config/node-red/
23 Mar 22:32:09 - [warn] Projects disabled : editorTheme.projects.enabled=false
23 Mar 22:32:09 - [info] Flows file     : /config/node-red/flows.json
23 Mar 22:32:09 - [info] Server now running at http://127.0.0.1:46836/
23 Mar 22:32:09 - [info] Starting flows
[22:32:09] INFO: Starting NGinx...
23 Mar 22:32:09 - [info] Started flows
23 Mar 22:32:09 - [info] [mqtt-broker:MQTT Server] Connected to broker: nodered@mqtt://192.168.8.8:1883
23 Mar 22:32:14 - [info] [server:Home Assistant] Connecting to http://supervisor/core
23 Mar 22:32:14 - [info] [server:Home Assistant] Connected to http://supervisor/core
23 Mar 22:32:19 - [error] [influxdb batch:pv_DB] Error: A 400 Bad Request error occurred: {"error":"unable to parse 'photovoltaic,type=photovoltaic current_power_consumption=undefined,current_power_export=undefined,current_power_import=undefined,current_power_production=undefined': invalid boolean"}
23 Mar 22:32:19 - [error] [influxdb batch:whirlpool_DB] Error: A 400 Bad Request error occurred: {"error":"unable to parse 'sensors,device=whirlpool_L1 current=undefined,energy=undefined,pf=undefined,power=undefined,power_max=undefined,power_min=undefined,returned_energy=undefined,total=undefined,total_returned=undefined,voltage=undefined': invalid boolean\nunable to parse 'sensors,device=whirlpool_L2 current=undefined,energy=undefined,pf=undefined,power=undefined,power_max=undefined,power_min=undefined,returned_energy=undefined,total=undefined,total_returned=undefined,voltage=undefined': invalid boolean\nunable to parse 'sensors,device=whirlpool_L3 current=undefined,energy=undefined,pf=undefined,power=undefined,power_max=undefined,power_min=undefined,returned_energy=undefined,total=undefined,total_returned=undefined,voltage=undefined': invalid boolean"}
23 Mar 22:32:19 - [error] [influxdb batch:smart_meter_DB] Error: A 400 Bad Request error occurred: {"error":"unable to parse 'smart_meter,type=smart_meter active_power=undefined,total_power_export=undefined,total_power_import=undefined': invalid boolean"}
23 Mar 22:32:29 - [error] [influxdb batch:whirlpool_DB] Error: A 400 Bad Request error occurred: {"error":"unable to parse 'sensors,device=whirlpool_L1 current=undefined,energy=undefined,pf=undefined,power=undefined,power_max=0,power_min=0,returned_energy=undefined,total=undefined,total_returned=undefined,voltage=undefined': invalid boolean\nunable to parse 'sensors,device=whirlpool_L2 current=undefined,energy=undefined,pf=undefined,power=undefined,power_max=0,power_min=0,returned_energy=undefined,total=undefined,total_returned=undefined,voltage=undefined': invalid boolean\nunable to parse 'sensors,device=whirlpool_L3 current=undefined,energy=undefined,pf=undefined,power=undefined,power_max=0,power_min=0,returned_energy=undefined,total=undefined,total_returned=undefined,voltage=undefined': invalid boolean"}
23 Mar 22:32:30 - [error] [modbus-flex-getter:Send Request] Error: Timed out
23 Mar 22:32:39 - [error] [influxdb batch:whirlpool_DB] Error: A 400 Bad Request error occurred: {"error":"unable to parse 'sensors,device=whirlpool_L1 current=0.93,energy=undefined,pf=0.82,power=182.86,power_max=182.86,power_min=0,returned_energy=undefined,total=1294.17,total_returned=0,voltage=239.98': invalid boolean\nunable to parse 'sensors,device=whirlpool_L2 current=0.02,energy=undefined,pf=0.04,power=0,power_max=0,power_min=0,returned_energy=undefined,total=220.75,total_returned=3.14,voltage=240.9': invalid boolean\nunable to parse 'sensors,device=whirlpool_L3 current=0.02,energy=undefined,pf=0.19,power=0,power_max=0,power_min=0,returned_energy=undefined,total=1019.69,total_returned=0.01,voltage=241.08': invalid boolean"}
23 Mar 22:32:49 - [error] [influxdb batch:whirlpool_DB] Error: A 400 Bad Request error occurred: {"error":"unable to parse 'sensors,device=whirlpool_L1 current=0.93,energy=undefined,pf=0.82,power=182.86,power_max=0,power_min=0,returned_energy=undefined,total=1294.17,total_returned=0,voltage=239.98': invalid boolean\nunable to parse 'sensors,device=whirlpool_L2 current=0.02,energy=undefined,pf=0.04,power=0,power_max=0,power_min=0,returned_energy=undefined,total=220.75,total_returned=3.14,voltage=240.9': invalid boolean\nunable to parse 'sensors,device=whirlpool_L3 current=0.02,energy=undefined,pf=0.19,power=0,power_max=0,power_min=0,returned_energy=undefined,total=1019.69,total_returned=0.01,voltage=241.08': invalid boolean"}
23 Mar 22:32:59 - [error] [influxdb batch:whirlpool_DB] Error: A 400 Bad Request error occurred: {"error":"unable to parse 'sensors,device=whirlpool_L1 current=0.93,energy=undefined,pf=0.82,power=182.86,power_max=0,power_min=0,returned_energy=undefined,total=1294.17,total_returned=0,voltage=239.98': invalid boolean\nunable to parse 'sensors,device=whirlpool_L2 current=0.02,energy=undefined,pf=0.04,power=0,power_max=0,power_min=0,returned_energy=undefined,total=220.75,total_returned=3.14,voltage=240.9': invalid boolean\nunable to parse 'sensors,device=whirlpool_L3 current=0.02,energy=undefined,pf=0.19,power=0,power_max=0,power_min=0,returned_energy=undefined,total=1019.69,total_returned=0.01,voltage=241.08': invalid boolean"}

There is always this: “23 Mar 23:05:50 - [error] [modbus-flex-getter:Send Request] Error: Timed out”

Sorry, I can’t help with that other than doing a search for that error (something I am sure you have already done).

no problem, thanks anyways!
yes already searched for a solution and also tried some settings within the node red modbus nodes but still the same issue.

and the guys in the node red forum told me since it’s a HA integration i should ask here :smiley: