Need help rebuilding home automation raspberry pi

Rebuilding my Home Automation RPi3B+ with latest version of RPi, NodeRed and MQTT. I had exported the FLOW from the old system. After installing the new software versions and trying to import the FLOW I realized there is a little more to it than that. I had to install several nodes from the library. I think that the one that is causing me this issue is the one that includes all the ui interface nodes. There is also the fact that the versions of NR are not the same now. The original version of NR is v0.20.7 and the current one is v4.1.6. When I imported the FLOW to the new version, all of the ui nodes were marked with the red triangle. When I compared some of the files with some screenshots of the same files from the original system, the layout were very different. I think my question is this. Should I try to find the earlier version of the ui nodes and if so how do I locate the earlier versions? I would prefer that method instead of re-writing the nodes to the later version, as there are 60 of them.
Any and all ideas greatly appreciated.
kentm

Hi @merkelck

One thing that caught my eye.

You were using Node RED Version : 0.20.7
And now you rebuilt (From 0.20.7) to 4.1.6

My suggestion is this: Migrate to modern versions.

  • Security (100's of CVE's) - you really don't want to stick with older versions of Node.
  • 100's of optimisations.
  • Easisyer migration after (so you can keep aligned with modern developments)
  • Other than DB Nodes, other Nodes might have moved on, and dropped support for older Node Versions.

Example: Some of my Nodes, no longer supports Node < v20

I get it might be a lot of work, but I think you will be in a difficult situation trying to moving forward later, and support will be really hard to acquire as a result.

Yes!!!
You can install older version, but you will need to use command line args todo so.

  • Its quite easy, but your experience wont be as nice, as it is with modern versions,
    again, many Nodes may pull in incompatible (recent) versions that no longer support older Node versions - it could get really messy, really quickly
1 Like

One of the more frustrating aspects of computers is everything changes. As things move forward it's always been my philosophy to keep up to the latest rev levels and moving from dashboard 1 to dashboard 2 was one of the most painful things I've done. Literally months and I'm still sorting out a few things. Loading old modules, definitely not something I think you should do. Try to get everything up to date as much as you can and when the next change comes along it won't be near as bad.

1 Like

Have you got a new Raspberry Pi for the migration?

Your dashboard nodes will be the original node-red-dashboard add-on, which you can install using the hamburger menu | Manage Palette | Install tag and searching node-red-dashboard.

Unfortunately, although the original dashboard should still work fine, it is now replaced by @flowfuse/node-red-dashboard (because it uses libraries that are no longer kept updated) and there is no easy way to migrate your dashboard.
You can install both dashboards and work slowly through the migration process, or I guess you can stay with the original version, so long as your system is not accessed from outside your LAN.

1 Like

Open one of the nodes with the red triangle and show us what you see.

Also stop node red and start it again and post the startup log here.

I really appreciate all the response. Here is the data requested by Colin




node-red-start.txt (1.7 KB)
Hopefully this will help
kentm

Wow thought so - just to muddy the waters further you are also using the Node Red version from Home Assistant with its webhooks etc - this will layer another level of complexity as there have been many internal changes changes with various versions of Home Assistant and how is handles States and notifications etc.

Your best bet would be to build your system in parallel slowly on a different machine and step through the different versions of the various applications (Home Assistant, Node Red and Webhooks) and slowly edge your way forward.

Craig

For ease of seeing the problem I am posting the log inline (that it the preferred method here, unless the log is large). If posting a log again please paste inline and add lines containing triple backticks before and after it to stop the forum interpreting it as markdown

ckentm@4004HOME:~ $ node-red-start

Start Node-RED

Once Node-RED has started, point a browser at http://192.168.1.151:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   node-red-log                           to view the recent log output
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as a systemd service.
nodered.service: Referenced but unset environment variable evaluates to an empty string: NODE_RED_OPTIONS
8 Mar 16:23:51 - [info]
Welcome to Node-RED
===================
8 Mar 16:23:51 - [info] Node-RED version: v4.1.6
8 Mar 16:23:51 - [info] Node.js  version: v22.22.0
8 Mar 16:23:51 - [info] Linux 6.12.62+rpt-rpi-v8 arm64 LE
8 Mar 16:23:51 - [info] Loading palette nodes
8 Mar 16:23:55 - [info] UI started at /ui
8 Mar 16:23:57 - [info] Settings file  : /home/ckentm/.node-red/settings.js
8 Mar 16:23:57 - [info] Context store  : 'default' [module=memory]
8 Mar 16:23:57 - [info] User directory : /home/ckentm/.node-red
8 Mar 16:23:57 - [warn] Projects disabled : editorTheme.projects.enabled=false
8 Mar 16:23:57 - [info] Flows file     : /home/ckentm/.node-red/flows.json
8 Mar 16:23:57 - [info] Creating new flow file
8 Mar 16:23:57 - [warn] Using unencrypted credentials
8 Mar 16:23:57 - [info] Server now running at http://127.0.0.1:1880/
8 Mar 16:23:57 - [info] Starting flows
8 Mar 16:23:57 - [info] Started flows

In particular note the lines

8 Mar 16:23:57 - [info] Flows file     : /home/ckentm/.node-red/flows.json
8 Mar 16:23:57 - [info] Creating new flow file

That means that this is not how you normally start node-red. How do you normally start it?

HOWEVER

As @craigcurtin noticed you said at the start that you are using Home Automation. If you want to continue to use Home Automation, and you are using the HA node red addon, then to upgrade node red you have to upgrade the HA node red addon.

If you want to use HA but use node red standalone then that is possible I believe by installing the HA nodes into node red.

The text node config that you show is not from the standard node original dashboard or the new one, so what dashboard was installed on your old system? Is it one that comes with HA?

From the way that the UI nodes seem to have a tab of none - it seems like they have just lost their ui_base node for some reason. If you weren't using HA I'd would say just copy over the entire .node-red user directory and sub directories - then run and npm rebuild to update to make it match latest nodejs version then and npm update to update the nodes... BUT not sure how do that within HA-land as I have never used it.. However if it is "just" a case of missing ui_base then in theory you should just be able to redefine the tabs by recreating them (using the plus symbol button) and allocating the UI nodes to them - which of course means you have to recall where they all were etc... but may be simper than wrangling HA.

The text node from node-red-dashboard does not have a Tab field, nor does it have an Order field, and the Size field is missing. It should look like

@merkelck which dashboard have you installed? Look in the dropdown menu Manage Palette and see what it says. I suspect you have installed one of the dashboard clones, not node-red-dashboard.

True - Indeed it does look like an unfamiliar dashboard.
The other safe way to install nodes is to copy over the original package.json file and the package-lock.json file if there is one, to the .node-red user directory, and then remove the local .node-red/node_modules sub-directory and re-run the npm install so it uses the correct list.

It might be better not to include the lock file, as that could force old versions of nodes to be installed. I suggest just copying package.json and running the install command.

Or you could migrate to UIBUILDER and likely never have that problem ever again. :wink:

ah - there he is ! right on cue ! (I thought one had slipped past you :slight_smile:

2 Likes

No, I've been building a new personal finance system along side enjoying my retirement, so I've been a bit distracted! :rofl::rofl:

1 Like

Being an old geezer with nothing better to do, I have decided to rebuild from scratch with a new RPi .
I will just work through one node at a time.
Thanks for all the suggestions
kentm

1 Like

I rebuilt this system as suggested. An RPi 4B with Trixie firmware, latest NR, latest MQTT and the exported flow from the original system that is still working. This system was a project that came from the RNTLAB course called "Smart_Home_Raspbery_Pi_ESP32_ESP8266 v1.3". the original system was built about two years ago. I built this new system from the latest v1.7 of the course. I reloaded the required Nodes from the library most notably the ui, timerswitch and BigTimer. I imported the old flow from the working machine. Then removed several of the older flows that were no longer being used. I now have five flows still operational. After deploying the flow, I wasn't really surprised to see that it did not work. By not working, I mean that I did not get a response in the debug window. At this point, I created a simple four node flow with "timestamp, mqttout, mqttin and debug . It worked perfectly. I then
reconnected the mqttout from one of the original nodes and made sure the topic was set to the same topic in the new mqttin node. And then manually switched the node on and off. The response was as expected. I then reversed the connection to use the new mqttout to operate the old mqttin node of the old flow. Again that worked fine.
So here I am again. The old system and the new system are connected to the same wired network. They each have their own static i/p addresses.
I realize this is well below the expertise level of most of you, but please know that I appreciate all of your assistance.
kentm

Are you using the same MQTT broker as before, or is it running on the new Pi?

Do the messages which don't show up originate on the broker's localhost or elsewhere?

Thank you for the reply. The first question is easy. The broker is running on the new Pi.
The second question has made me realize that the issue is really between the two mqtt nodes. The simple test node output signal never goes anywhere. It must crossover directly within the pi and that is why I get response via the debug node. In the actual situation, the mqttout node sends a msg to the device who in turn replies and sends the state msg back to the broker via the mqttin node who passes it to the NR for display. The devices used in this case are simple wifi switches that have been programmed using arduino code.
I am going to rethink this whole thing and see what I can do to find the culprit here. The first thing will be to see if I am even sending a command to my router (A/P).
It appears that your second question may have lead me toward the problem.

If the broker is Mosquitto, make sure it is set up to accept connections from devices apart from localhost. Surprisingly for a communications application, it's default is localhost only.