question

wedgehog avatar image
wedgehog asked

Is there a tank level sensor for heating Oil that will work with the Cerbo GX please

I have one of those radio linked floating sensors that gives a bar graph display of the level, but it's not very accurate, I would like an accurate display of my heating oil on the Cerbo, but after an hour of searching and reading all I find is water and LPG tank sensors?

cerbo gxtank monitor
2 |3000

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

10 Answers
wedgehog avatar image
wedgehog answered ·

Tap Tap! Hellooooo is anyone there?

2 |3000

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

Jeremy Albrecht avatar image
Jeremy Albrecht answered ·

Is there any reason a water or LPG level sensor wouldn't work for you? One of the Mopeka bluetooth sensors for example?

2 |3000

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

wedgehog avatar image
wedgehog answered ·

Hi Jeremy, Don't think I could use a water sensor in heating Oil it might attack the components, they call it Oil, but it's not really much different to jet aviation fuel. I'm not sure how the LPG sensors work, I know they are detecting it in it's liquid form, but surely it's not inside the tank? you would let all the gas out fitting it? I will have a look at them. Bob

9 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.

matt1309 avatar image
matt1309 answered ·

Hi @wedgehog

I have an Apollo oil sensor they use radio signals to send data from ultrasonic sensor on top of heating oil tank to a small plug/display that's inside the house. I capture this radio frequency using this:

GitHub - merbanan/rtl_433: Program to decode radio transmissions from devices on the ISM bands (and other frequencies)

Which is running a separate raspberry pi and then forward it to gx device via MQTT.

Only thing i needed to do on GX device was use the dummy script to make a "virtual tank"

velib_python/dbusdummyservice.py at master · victronenergy/velib_python · GitHub


I imagine you could technically install rtl_433 on the venus os device itself. You'll likely also need to install the drivers for the SDR.


68 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.

dansonamission avatar image
dansonamission answered ·

One of these connected to VE.CAN

https://www.maretron.com/products/tlm100-tank-level-monitor-40-depth/

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.

wedgehog avatar image
wedgehog answered ·

How do I forward the MTQQ from a Lilygo 433 to a Victron Cerbo-gx


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 @wedgehog


Here's how you setup a virtual tank. You can then write the litres values to this. (If you can edit the output received from ultrasonic oil sensor to just send litres to mqtt topic then you wont need any other devices).


Victron has a more detailed guide here, which explains how you can make the below more robust, and get the drivers to persist over updates etc, however the below works.

So you start with Victrons custom driver but edit it to make it create a tank

  1. #!/usr/bin/env python3
  2.  
  3. """
  4. A class to put a simple service on the dbus, according to victron standards, with constantly updating
  5. paths. See example usage below. It is used to generate dummy data for other processes that rely on the
  6. dbus. See files in dbus_vebus_to_pvinverter/test and dbus_vrm/test for other usage examples.
  7.  
  8. To change a value while testing, without stopping your dummy script and changing its initial value, write
  9. to the dummy data via the dbus. See example.
  10.  
  11. https://github.com/victronenergy/dbus_vebus_to_pvinverter/tree/master/test
  12. """
  13. from gi.repository import GLib
  14. import platform
  15. import argparse
  16. import logging
  17. import sys
  18. import os
  19.  
  20. # our own packages
  21. sys.path.insert(1, os.path.join(os.path.dirname(__file__), '/opt/victronenergy/dbus-systemcalc-py/ext/velib_python'))
  22. from vedbus import VeDbusService
  23.  
  24. class DbusDummyService(object):
  25. def __init__(self, servicename, deviceinstance, paths, productname='Thunderstorm Tank', connection='Dummy service'):
  26. self._dbusservice = VeDbusService(servicename)
  27. self._paths = paths
  28.  
  29. logging.debug("%s /DeviceInstance = %d" % (servicename, deviceinstance))
  30.  
  31. # Create the management objects, as specified in the ccgx dbus-api document
  32. self._dbusservice.add_path('/Mgmt/ProcessName', __file__)
  33. self._dbusservice.add_path('/Mgmt/ProcessVersion', 'Unkown version, and running on Python ' + platform.python_version())
  34. self._dbusservice.add_path('/Mgmt/Connection', connection)
  35.  
  36. # Create the mandatory objects
  37. self._dbusservice.add_path('/DeviceInstance', deviceinstance)
  38. self._dbusservice.add_path('/ProductId', 0)
  39. self._dbusservice.add_path('/ProductName', productname)
  40. self._dbusservice.add_path('/FirmwareVersion', 0)
  41. self._dbusservice.add_path('/HardwareVersion', 0)
  42. self._dbusservice.add_path('/Connected', 1)
  43.  
  44. for path, settings in self._paths.items():
  45. self._dbusservice.add_path(
  46. path, settings['initial'], writeable=True, onchangecallback=self._handlechangedvalue)
  47.  
  48. GLib.timeout_add(1000, self._update)
  49.  
  50. def _update(self):
  51. with self._dbusservice as s:
  52. for path, settings in self._paths.items():
  53. if 'update' in settings:
  54. update = settings['update']
  55. if callable(update):
  56. s[path] = update(path, s[path])
  57. else:
  58. s[path] += update
  59. logging.debug("%s: %s" % (path, s[path]))
  60. return True
  61.  
  62. def _handlechangedvalue(self, path, value):
  63. logging.debug("someone else updated %s to %s" % (path, value))
  64. return True # accept the change
  65.  
  66.  
  67. # === All code below is to simply run it from the commandline for debugging purposes ===
  68.  
  69. # It will created a dbus service called com.victronenergy.pvinverter.output.
  70. # To try this on commandline, start this program in one terminal, and try these commands
  71. # from another terminal:
  72. # dbus com.victronenergy.pvinverter.output
  73. # dbus com.victronenergy.pvinverter.output /Ac/Energy/Forward GetValue
  74. # dbus com.victronenergy.pvinverter.output /Ac/Energy/Forward SetValue %20
  75. #
  76. # Above examples use this dbus client: http://code.google.com/p/dbus-tools/wiki/DBusCli
  77. # See their manual to explain the % in %20
  78.  
  79. def main():
  80. logging.basicConfig(level=logging.DEBUG)
  81.  
  82. from dbus.mainloop.glib import DBusGMainLoop
  83. # Have a mainloop, so we can send/receive asynchronous calls to and from dbus
  84. DBusGMainLoop(set_as_default=True)
  85.  
  86. pvac_output = DbusDummyService(
  87. servicename='com.victronenergy.tank.ttyO1',
  88. deviceinstance=0,
  89. paths={
  90. '/Capacity': {'initial': 1.235},
  91. '/Level': {'initial': 0},
  92. '/Status': {'initial': 0},
  93. '/Remaining': {'initial': 0},
  94. '/FluidType': {'initial': 4},
  95. '/Standard': {'initial': 2}
  96. })
  97.  
  98. logging.info('Connected to dbus, and switching over to GLib.MainLoop() (= event based)')
  99. mainloop = GLib.MainLoop()
  100. mainloop.run()
  101.  
  102.  
  103. if __name__ == "__main__":
  104. main()


Edit initial values. Can also edit tty01.

This file should be saved in data folder. I make another folder to store it all in called virtTank

/data/virtTank/virtualTankTTY01.py

You also need to create a folder

/data/virtTank/service

inside this folder you will make a file named run

run will contain:

  1. #!/bin/sh
  2. python /data/virtTank/virtualTankTTY01.py

Then you need to create a symlink in /service to the folder /data/virtTank/service


This would be done using command:


  1. ln -s /data/virtTank/service/ /service/virtTank/


You should then see a folder be created in /data/virtTank/service/ called supervise and a tank appear in dbus-spy (and on VRM).


There are more details on victron's github about making the above more robust and to persist over updates as well as storing the drivers in /opt/victronenergy however for a simple setup the /data folder is fine. If you're adding more complex programs keeping things neat and stored in correct folders will matter more. Similarly if persisting over updates is critical then read further here:

https://github.com/victronenergy/venus/wiki/howto-add-a-driver-to-Venus

I'm not too bothered with my setup breaking over updates as redoing the above is quick enough once you've done it once.


Now the virtual tank is in venus os/GX device. However you need to get data values into it.

I do this via MQTT.

The topic you'll need to send the remaining and level to are:

Remaining: /W/{VRMID}/tank/{deviceID}/Remaining

Level: /W/{VRMID}/tank/{deviceID}/Level


Where VRMID you can find in settings->VRM Online Portal
of your GX device

And device ID you can either find in GX device list or VRM device list And i believe it's VRM instance ID. If you just copy the above scripts it will be 0.


Hope this helps. Of course you'll need to somehow format the output of the oilsensor that's read by the arduino into level and remaining before sending into victron's mqtt topics that I've noted above.



2 |3000

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

Al avatar image
Al answered ·

@wedgehog This all looks very complicated..

Can't you just use a normal 0-190 Ohm pressure sender and manually set the range in the Cerbo.

Something like this can be mounted on a tee on the tank outlet pipe:

https://wema.co.uk/products/pressure-sender

Loads of similar on Amazon etc.

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.

matt1309 avatar image
matt1309 answered ·

Hi @wedgehog


What file did you use for your lilygo. I've got my custom code running (it's picking up neighbors weather station and a few other devices around the area but not the oil sensor that it's literally right next to).


At first i thought it was because i was compiling with OOK instead of FSK. However I've done that now and still doesnt seem to work (magnet trick doesnt work on mine so i'm having to test once per hour).


I noticed the FSK prebuilt file uses 915mhz not 433. Was curious which file you used.

2 |3000

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

wedgehog avatar image
wedgehog answered ·

@matt1309 Hi mate, Upload, upload from the web, Lillgo_rtl_433-fsk. Oh! and don't forget, your tank may only send info a few times a day unless you put a magnet by the internal switch on the sender unit. You can look that information up on the web site for your model of sonic sender

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.