Hi everyone.
I am new to Node-Red and want to know where best to install the program.
I have an Emonpi for energy monitoring.
I also have a Raspberry Pi 4 running Home Assistant that is very much a work in progress
I am new to both the above and want to use Node-Red to help integrate various devices into both Home Assistant and Emoncms and create automations etc.
I use a PC to carry out changes to the EmonPi and Raspberry Pi
Would it be better to locally on my PC or on the EmonPi or Raspberry Pi home assistant
Definitely best on the Pi. Whether as the default stand-alone global installation, part of Home Assistant or as a local install is entirely up to you. If HA will be your focus then maybe you should use that. However, if you want the greatest flexibility, a local install on the Pi would be good. The default global install is somewhere in the middle.
Local install will be the more complex but done once, updates and backups are really easy. For the global install, you can use Dave's install script but then you may not learn how it all works (of course, that might not be important to you anyway). The HA install is the most integrated to HA but Node-RED versions may not happen as quickly and possibly one or two things might not work as most people would describe them in the forum.
That is the userDir where all the data for your Node-RED instance lives. The actual installation is elsewhere depending on how you install it. The 4 most common methods being:
The default global install (maybe using Dave's script on a Pi or Debian device)
A local install as in the example of my alternate install repo
There are 2 potential reasons for running locally. Either you want the capabilities of Node-RED on your PC or you want to develop flows away from your "live" system and the PC is most convenient.
I only wouldn't run on the Pi (assuming it is stable and running 24x7) if that device was already heavily loaded AND your PC is also running 24x7 (which is probably rather wasteful of energy).
Yes, you can have as many instances of Node-RED running on a device as you have resources and spare TCP/IP ports for. Each instance on one device has to be on a separate IP Port (actually, there are ways around that but I don't think you are interested in that at the moment. But virtual machines and reverse proxies can provide workarounds).
You can certainly have a local install and an HA install as long as your local install uses a different port (I don't know whether you can change the port in HA).
You can have a single installed version of Node-RED running multiple times. Or you can go the full localised route as I tend to and as illustrated in my alternate install repo where you can have different versions of Node-RED running as well - useful both for backup/recovery and if you want to run test instances for new versions of Node-RED.
Oh, either way, for each instance, you will need a separate userDir folder. That is where all of the settings and flows and other stuff for Node-RED is stored.
Different Dashboards, one NR instance with more secure code than the other, one instance dealing with serial or other legacy hardware and the other focused on processing flows, ...