Since 2022.4.X upgrade problems occur using nodered integration

Hello everyone, many days tying to solve my problems on my side but I definitely need your help.

All my automations are done through nodered’s flows and I have some graphical feedbacks on my HA dashboard. Everything was OK but since the last updates my configuration went wrong.

If I use trigs from Nodered IDE (inputs) everything is fine but once I use an external trig (from a switch integrated to my dashboard , or from a zigbee button that trigs a flow) nothing happens and my nodered dashboard buttons went grey for a while and I have those kind of error:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/device_automation/__init__.py:152
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 12:53:32 (11 occurrences)
Last logged: 13:06:11

[281473309708144] Error handling message: Unknown error (unknown_error)
[281473310512080] Error handling message: Unknown error (unknown_error)
[281473309781440] Error handling message: Unknown error (unknown_error)
[281473310444560] Error handling message: Unknown error (unknown_error)
[281473309101264] Error handling message: Unknown error (unknown_error)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/config/custom_components/nodered/websocket.py", line 74, in websocket_device_action
    platform = await device_automation.async_get_device_automation_platform(
  File "/usr/src/homeassistant/homeassistant/components/device_automation/__init__.py", line 152, in async_get_device_automation_platform
    platform_name = automation_type.value.section
AttributeError: 'str' object has no attribute 'value'

I tried many things, like install/reinstall, change the configuration, disable/enable companion integration, try nodered safe mode to catch a deprecated flow that may be the root cause but nothing works.

I think my last chance may be to erase all my nodered tabs but I would be so sad to rewrite all my stuff once again.

Many thanks for your future helps. #fingerscrossed
JY

I know next to nothing about Node Red but I do know the binary search method.

Can you cut and paste these “tables”?

If so, cut out half of them, paste them somewhere safe, like a text file. Save the remaining table and try again. If the error occurs you know it is in the half you did not cut out. If the error did not occur it is in the half you cut and saved. Paste that section back and halve only the section with the error.

Keep halving the section with the error and testing.

It will take surprisingly few iterations to narrow it down to the culprit.

Thank you for your answer !

But it was an error from my “word corrector”, I just wanted to say “tabs” and not “tables”, just meaning all my nodered configuration :slight_smile:

I really think that it’s my “nodered integration companion” that makes my system crazy declaring bad or old “nodered entities” but I dont knoww how to clean up those “automatic” imports.

All flows are stored in config/node-red/flows.json. What version of the addon are you using? Same thing if you are running the companion app from hacs. If both are up to date then go to manage pallette, installed, then search home assistant. If there is an update button press it until it goes away then restart the nodered addon.

1 Like

My Node-RED is v2.2.2 even if my addon is 11.1.1 and the companion is 1.0.7 from HACS.

My palette looks good … eveything is up to date or disabled.

It’s something around websockets and a wrong (too many or multiple declarations maybe) nodes declaration/import in my HA from nodered’s companion.

In the server drop down, inside a call service node, are the re multiple servers?

1 Like

Very good question, coz I’ve never verified that config, but, unfortunately I only have one server “Home Assistant” and it has “I use the Home Assistant Add-on” checked.

Can you cause the error to occur? restarting, opening node red, etc. If you can make the error occur, check the logs in the nodered addon right after for additional errors.

Also in integrations node-red you should see any entries created, are any not available?

It’s currently a bug. Follow here Does this break when updating to 2022.4.0 · Issue #625 · zachowj/node-red-contrib-home-assistant-websocket · GitHub

Fixed in the latest release

2 Likes

Back up each of your tabs (flows) by selecting the 3 bars at top right of screen and select ‘Export’. Select ‘Download’ and save the .json file with a meaningful name. You can back up each flow to a separate file or all flows to a single file. Once you have everything backed up you can either start deleting flows to troubleshoot or try a complete uninstall/reinstall. Import your flows from the saved .json files once it’s reinstalled. I periodically save all of my flows this way so I can revert if I mess something up.

1 Like

This is essentially the same as Tom suggested.
I also believe this is worth a try.

1 Like

You could first try adding safe_mode: true to the configuration page of the add on and restart. This starts nodered with all flows stopped.

You can then double click on each tab and disable all tabs. Then deploy, change safe_mode: to false. Then enable tab by tab.

Thank you all ! I will try some of your advice, and I’ve already tried the safe mode and, unfortunately, it didn’t help.

Trying to export/import tab by tab is smart and I’m sorry to not have the idea by myself :slight_smile:

I have button flows and motion flows and they both dont work.
Sometimes Node-red crashes and sometimes works but 100% of the time anything with ha-devices nodes does not work.

@Kermit, you’re right and I didn’t find this issue even if I’ve searched a lot ! It looks like I’ve got the same problem as the issue you’ve linked. I’ll try the update and I’ll give you a feedback coz it could help people like me. :crossed_fingers:

Once again, thank you all !

So … Thank you so much !!!

Everything works like a charm ! More, I switched from stable to beta and everything is still fine !
Not any problem so far !

The soluce was to upgrade the “node-red-contrib-home-assistant-websocket” that pop today through the node red HA companion from HACS.

Fifteen days trying things whereas I should have simply wait for an update :laughing:

Once again thank you every one ! What a great community !
Have a nice weekend full of upgrades :slight_smile: