Add custom sensors to my Cerbo GX
Go to file
Carsten Schmiemann edc90b79cb Rename grid-meter to grid_meter 2023-09-20 21:54:53 +02:00
data create energy meter service 2022-08-09 23:47:09 +02:00
dbus-batrium-native Update reamde 2023-08-08 23:36:53 +02:00
dbus-node-red-grid-meter Rename grid-meter to grid_meter 2023-09-20 21:54:53 +02:00
dbus-node-red-pvinverter Disable pv-inveter file logging for production usage 2023-07-15 11:56:48 +02:00
dbus-node-red-temp-outside Clean up 2023-05-26 12:16:32 +02:00
node-red-flows Add node-red flow for reading Tibber node locally 2023-08-08 23:37:15 +02:00
.gitignore Initial commit 2022-08-09 21:30:41 +02:00
LICENSE Initial commit 2022-08-09 21:30:41 +02:00 Update reamde 2023-08-08 23:36:53 +02:00


Add custom sensors via Node-Red instance included in Venus OS Large to my Cerbo GX Venus OS.

Node RED

I gather data from my heating control system, my energy meter (SDM630 Modbus) connected to one of my PLCs via Node RED and exported it via HTTP JSON API, see my flows under /NodeRED.

You can gather data from all available sources via Node RED easily, just export it via JSON HTTP and modify these python files, to grep JSON and push it to the DBUS daemon.

On victrons github pages there is documentation which formats and servicenames dbus is accepting and how it will display it on Venus' visualization and VRM portal.

Thoughts on Node RED service

It is not a perfect or efficient solution, but I want data gathering on Node Red and use only a exisiting python script to push it to Venus OS' infrastructure, because I am not an experienced python programmer, of course you can gather data directly with python.

Batrium Native CAN protocol support

I created a dbus python script to implement Batriums Native 1.0 (and 2.0 but there are mandatory items missing) protocol, to gather more informations in Victrons OS. A forum user started some time ago the same approach but the script was outdated and lacking of some datapoints. I try to integrate every datapoint from Batriums BMS to fill Victrons registers.

What is working or improved against Victron default or Pylontech emulation

  • faster update rate
  • transfer of most alarms (instead of only voltage low alarm)
  • number of cells balancing
  • time to empty or full
  • capacity used and total Ah discharged
  • daily stats like kWh charged, discharged (calculated)
  • time since last full charge
  • correct transmitting of CVL (Stock implementation fixed with Batrium version or downgrade to 2.17.27)

What is not working, needs improvement

  • capacity to full or to empty is not transmitted by Batrium (transmission of 0x00111900 is missing against documentation)
  • Ah, kWh charged and discharged is calcualated by script (see above)
  • Capacity of battery must be entered into script (see above)
  • dbus script is started by rc.local which gets executed last, so all mppts and multiplus' showing temporarily "BMS missing" and need to be cleared after (re-)boot of Venus OS fixed
  • include calculation of State Of Health, based on Ah discharge and SoC State after full charge, because Batrium does not have

dbus-node-red-XXX Service files


In the Python file, you should put your data points you exported with Node-RED via JSON API.


  1. Copy the files and folders to the /data folder on your venus device:

    • /data/dbus-node-red-XXX/
    • /data/dbus-node-red-XXX/
    • /data/dbus-node-red-XXX/service/run
  2. Set executeable permissions for service file:

    chmod +x /data/dbus-node-red-XXX/service/run

  3. Add a symlink to the file /data/rc.local to start it at boot time:

    ln -s /data/dbus-node-red-XXX/service /service/dbus-node-red-XXX

    Service manager of Venus OS will start the script immediately if you run above in terminal. If you want to start it at boot time, create or append above to your /data/rc.local

    If you just created rc.local, set it executeable with

    chmod +x /data/rc.local

    Note: If you install batrium dbus script, you must install python can module, you can do it with '" inside batrium-dbus folder


You can check the status of the service with svstat:

svstat /service/dbus-node-red-temp-outside

It will show something like this:

/service/dbus-node-red-temp-outside: up (pid 1442) 406 seconds

If the number of seconds is always 0 or 1 or any other small number, it means that the service crashes and gets restarted all the time.

When you think that the script crashes, start it directly from the command line:

python /data/dbus-node-red-XXX/ or /data/dbus-node-red-XXX/service/run

and see if it throws any error messages.

If the script stops with the message

dbus.exceptions.NameExistsException: Bus name already exists: com.victronenergy.SERVICENAME"

it means that the service is still running or another service is using that bus name.


My scripts generate a logfile in working directory which you can check, every 10 min there will be a status message, with actual values and so on.

Restart the script

If you want to restart the script, for example after changing it, kill running script

The daemon-tools will restart the scriptwithin a few seconds.


You can insert a SD card with FAT32 filesystem, or a blank one and format it with the GX device itself.

Simply add to cron following command, to copy data folder with some exceptions for node-red node modules every day at 2 am

crontab -e

0 2 * * * /usr/bin/rsync rsync -rlptD --progress --exclude /data/home/nodered/.cache/ --exclude /data/home/nodered/.npm --exclude /data/home/nodered/.node-red/node_modules /data /run/media/mmcblk0p1/data-backup


Used as basis for my custom services. DBus service descriptor are located at