I am hoping that someone can point me in the correct direction here, since a couple of hours of googling and experimenting has not gotten me any closer to resolve this issue:
HA Version: 2023.11.2 Node-Red: v3.1.0
I have a Node-Red installation working on my Victron GX.
I am now trying to setup the same config on my Home-Assistant running on a VM.
The Victron nodes do not find the ModBus for some reason.
HA Node Red
Error connecting to dbus: Error: connect ENOENT /var/run/dbus/system_bus_socket
I have the ModBus enabled on the Victron and set to TCP.
I can telnet to the IP and port and it connects.
According to the installation instructions for the Victron pallete (@victronenergy/node-red-contrib-victron)
There is a
com.victronenergy.settings settings that needs to be set. I have no idea how to do this, since there is no clear instruction how to do that. I am not sure if this is the cause of the services not working remotely, because it is working locally on the Victron.
There is not
dbus command on the Home Assistant, so I assume this needs to be done on the Victron:
dbus -y com.victronenergy.settings /Settings/Services/InsecureDbusOverTcp SetValue 1
It states that there is an old way to do this by editing the
/etc/dbus/system.conf file that does exist on the HA, but they refer you to the new location for this file:
I have tried to set the tcp:host entry from the instructions, on the HA, but this also has not worked.
Next there are exports that refer to an IP that is not defined anywhere else in the document.
I am assuming this is referring to the Victron's IP. So, testing with telnet if I can connect to my Victron's IP on TCP port 78, I get a "Connection refused". So that server/Port is not available.
(This is on the same LAN as the HA and there is no firewall locally.)
Any help would be appreciated.
I have found a document that shows how to enable the SSH on the Victron side and I was able to get into it. I was able to run the
dbus command end reboot it.
That didn't help.
I then removed the config from the system.conf (that was for the old method) and restarted HA again.
That didn't help.
My modbus.yaml file:
name: victron type: tcp host: 192.168.x.y port: 502
I can telnet to the IP and port 502 and get a connection.
I can now connect to the port 78 on the Victron. So the next step is to set
export NODE_RED_DBUS_ADDRESS=192.168.x.y:78 only i can't find relevant documentation for the VM version of HA.
The documentation for setting up NODE-RED just states that you can set this up, but it doesn't state where to do it.
HA documentation shows that you can't do this through the YAML files.
- I found a file
/etc/profile.d/homeassistant.shthat already contained two other exports. I added the export just above the home assistant startup. But it seems that file get re-created. So my change was lost.
- I then tried to add my own script to
/etc/profile.dand this also got removed on reboot.
- Then I added it to
~/.bash_profile, This one persisted a reboot, but the Node Red still doesn't pick up the Victron.
After each change I rebooted the VM, not just restart the HS to force the scripts to be executed.
Still not working.