question

randomguy avatar image
randomguy asked

How do you connect a CerboGX to a Raspberry Pi 3B with Home Assistant?

I would like to read the data from a CerboGX with a Raspberry Pi 3B with Home Assistant.For this I have the HACS integration “Victron GX modbus TCP”.The CerboGX is connected via Ethernet cable to a router to which the Raspberry is also connected via Ethernet.Modbus is activated in the Cerbo.It doesn't work.Did I make a mistake in the wiring? Does the Cerbo have to be wired to the Raspberry somehow differently?

cerbo gxRaspberry Pi
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

6 Answers
matt1309 avatar image
matt1309 answered ·

Hi @Randomguy

There's a few ways you could get the data from cerbo gx to home assistant. Modbus or MQTT are the most popular/easiest. If you've got a integration for modbus tcp is should be as easy as turning on the modbus tcp server on gx device, assuming both the gx device and the home assistant machine are connected to same LAN/network. And in the integration entering the server IP (it might auto detect)

I'd make sure you've enabled the modbus tcp server on the GX devices.

Settings -> Services->ModbusTCP (change to enabled).

MQTT is also in the same location if you prefer that.


If the integration relies on ip being entered you may want to make sure the cerbo gx is assigned the same IP by your router everytime. (this is usually done in the router settings under DHCP settings or static IP settings)

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

randomguy avatar image
randomguy answered ·

Thank you.

Yes, that's exactly how I did it.The Cerbo has a static IP from the router.Modbus TCP + MQTT are activated in the Cerbo settings.I can reach both devices, the Raspberry Pi and the Cerbo, on my laptop via WLAN via their IP addresses.How can you check whether the Cerbo can even be reached from the Raspberry?Could it be due to the Raspberry's Tailscale VPN integration? I've already deactivated it, but it still doesn't work.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

matt1309 avatar image
matt1309 answered ·

Hi @Randomguy

It should work if they're all on the same network.

When you say vpn do mean mean connection into the network or for connections out. Im not familiar with that program but it might install firewall that you need to open. (If you mean connecting into the network via vpn then you may need to add routing depending on how you've configured the vpn server).


A basic test to see if pi can access cerbo would be to ping the cerbo from the raspi. If that works you could go a step further and check you can view mqtt data via the pi using mosquitto.


Tbh from what you've said my guess would be there's probably something not quite right in the home assistant integration config.


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

randomguy avatar image
randomguy answered ·

Ping ist negative, packets transmitted but 100% packet loss :O

In browser i can access the ui of cerbogx with same adress (192.168.1.30).

The raspberry pi, the cerbo and my pc are all connected with the same network with the same router.

I deactivated all vpn services and installed home assistant completely new, but it still dosnt work.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

matt1309 avatar image
matt1309 answered ·

That's odd. Sounds like some sort of routing issue.

So via browser you can go to http://192.168.1.30
but ping 192.168.1.30 is losing 100% of the packets. And you've definitely not got a proxy on chrome or firewall on ping stopping it getting through?

Have you got another machine you could test it on? Another test might be can you ssh into cerbo? Enable that in gx device and see if you can ssh in. If not on that machine try a phone on the same wifi network. At least then it'll prove/disprove if it's network issue or cerbo issue.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

randomguy avatar image
randomguy answered ·

I specify:

Ping from PC to CerboGX: Success

Calling CerboGX from PC via Firefox: Success, UI visible

Ping from Raspberry PI with Home Assistant console to CerboGX: Failed, packets transmitted but 100% packet loss.

It must have something to do with the Raspberry Pi, but I have no idea what it could be. Network is connected, otherwise I wouldn't be able to access Home Assistant from the PC.Is it possible that you need a USB data connection to access Modbus?

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.