question

walter-widmore avatar image
walter-widmore asked

Easiest way to read GX data

Hi all,

I'm living off-grid thanks to a nice Victron setup. However there's one thing that I would like to add: Right now, when the battery is full, the solar energy is being decreased due to the DVCC mode on the GX (which is great).

However I would like to use this 'left over' energy to go into my electric car. Right now, I'm manually adjusting the car's charge rate. For example when there's a cloud, I need to lower the charge rate to prevent my battery from being discharged too much or even too quickly. Doing this manually is of course no long-term solution.


Question: I would like to read the "current" (A) property being displayed by the GX (source: SmartShunt) in realtime (preferably locally). Based on this property, I can use my car's API to start/stop the car and/or adjust the charge rate.


Do I need to connect a Raspberry Pi or Arduino to the Cerbo GX using ModBus? (Which sounds like a hassle). Is there any way to access the websocket communication being used by the Cerbo web interface?


Thanks!

screenshot-2022-07-04-at-133809.png

cerbo gxModbus TCPmodifications
2 |3000

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

3 Answers
Alistair Warburton avatar image
Alistair Warburton answered ·

Not an expert but I am pretty sure this is correct... I am doing it so I know it works at least and I think it is the only option.

Yes Modbus will do that, as will MQTT.

Yes you will need to get and process the data with something, a microcontroller could work but that would be a pain in the behind to code, modify and build a UI for.

There are literally hundreds of ways to go, on many tens of platforms, but I would respectfully suggest that going with something that has a well established community and can also provide a web based UI would be a good choice.

You could use a PC to host your 'application' but it isn't a great choice if the OS is Windows.

You could rebuild an old laptop/desktop with a Lynux distribution and put your application on that, but again, unless you want to learn Lynux that is hard work.

I would recommend, and am using, Node Red on a Raspberry Pi4.

That is still Lynux, essentially, but you can download many different OS images with sets of packages installed so you are up and running in 30 mins or so with almost 0 knowledge of how that happened.

My system is Home assistant with Node Red pre-loaded, why because HA has a huge community and thousands of IOT and other integrations. The entire task of installing that, including setting the PI up to boot from an SSD took less than an hour.

Once you have Node Red, or something similar, you will find that all the stuff you thought was an innovative idea has probably been done many time over in several different ways and you will be able to google - copy and past most of what you need whilst learning just how much you could do with your new favourite tool.

If Node Red doesn't feel like a good fit, use it as a jumping off point to look for similar applications/platforms/systems.

If you want code, it is referred to as nodes in Node Red, you can have mine... but to be honest you will not have any issue finding examples and as I said I am no expert... Working on it though :-)

Lastly you can run Node red on Windows, quickly and easily, and although you probably wouldn't want to do that long term, it will allow you to play a while before committing to hardware.

Don't bother with the Android version, its cool but too limited for what you will want to do.

1 comment
2 |3000

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

walter-widmore avatar image walter-widmore commented ·
Many thanks for the reply! Will definitely look into Home Assistant and MQTT.
0 Likes 0 ·
pvpax avatar image
pvpax answered ·

With Venus OS large you can even run node red on your Cerbo and don't need additional hardware.

If your wallbox is externally controllable and you're willing to "sacrifice" a RasPi, take a look at openWB and EVCC - both are open source and made specifically to charge EVs with excess PV power and can manage the victron stuff.

2 |3000

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

taylortops avatar image
taylortops answered ·

I'm doing this for my water heater. See my post: https://community.victronenergy.com/questions/157637/can-i-publish-custom-topics.html

2 comments
2 |3000

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

walter-widmore avatar image walter-widmore commented ·
Nice! This is the setup that I connect with the most since I'm familiar with NodeJS & Raspberry Pi. I was totally unaware of MQTT so this is very interesting. Will be looking into this. If you have anything more to share about your setup, would be much appreciated. Thanks!
0 Likes 0 ·
Show more comments

Related Resources

Cerbo GX product page

GX family product range

Cerbo GX & GX Touch datasheet

Cerbo GX Manual

Venus root access document

Modbus TCP Basics

Experiments, Modifications and Adaptions. Mods (Modifications) can be made to Victron Software by the Community. Please use the modifications space for enthusiasts who want to push what is possible, without official Victron Support.