question

Tim from Eat Sleep Van avatar image

Setting Tank Monitor Values Manually via API

I have a Color Controller in my motorhome and want to show the state of my tanks on the display. This has been a lot more difficult to figure out that I thought it should be.

Now as you can imagine, I don't want to spend $800 on the resistive tank level adapter, and even then I couldn't figure out what devices to buy to make it work. (It would be cheaper to by a Venus! Why are the adapters so expensive?!)

However I do have a raspberry Pi and could easily program it to tell the CC what the current levels are via an API or Modbus. I couldn't see how to change the values, or even make the tank levels show on the screen. It looks like on Modbus the values are read only.

My feature request is:

- Make it easy to set the values of the tank levels via an API (preferably), SSH command line or Modbus.

Or let me know if this is already possible, but I simply missed it.

I'd also like to see clear instructions on what products to buy for to make it work. Which senders work, what type of senders, which adapters needed for the CC etc. I asked the Victron dealers here in NZ but they didn't know anything about it. There also seems to be a disconnect between the language used by Victron (i.e. resistive, voltage or current type senders) and the products sold in NZ. None of which use any of those terms. e.g. https://www.marine-deals.co.nz/ultrasonic-tank-sender or http://www.rvsupplies.co.nz/products/view/electronic-tank-probe-290300

Any help welcome!

feature request
2 comments
10 |3000 characters needed characters left characters exceeded

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

Hey Tim


did you find a solution? I'm exactly in the same situation: RV, CCGX and a raspberry onboard. Wish I'd able to monitor the tank level of my generator but the cost of the adapter is just overkill.


I live in Italy so Rob is not an option for me unfortunately.


THANKS

Hi, no sorry, no solution yet. I'll definitely post here if I figure it out.

2 Answers
ben avatar image

It's pretty easy to inject your own tank values via MQTT, ModbusTCP, or dbus.

That's what I am doing today, because there is a limitation in the Victron NMEA2000 implementation that doesn't allow it to properly handle a sender that transmits multiple tanks.

Instead, I intercept the N2K tank values myself and turn around and post them right back to the Venus/CCGX. They show up fine after that.

8 comments Share
10 |3000 characters needed characters left characters exceeded

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

Which dbus paths are you setting to make this work? I've managed to get the basics working with MQTT, including reading current battery voltage and SOC, and turning the inverter on/off. Thanks!

ben avatar image ben ♦ Tim from Eat Sleep Van ·
I’ll grab a sample tank for you when I get back home next week. I’m away from the system right now, and the Venus is firewalled.


I had it easy, because I already had a real tank being posted by my n2k adapter. I just copied it field for field.

Thanks! After a bit more research I suspect what I want to do is not possible, as the Venus has the tank details built in. But because the color controller doesn't have tank inputs, it doesn't the built in software dbus-adc which makes the analog DBUS tank paths available.

ben avatar image ben ♦ Tim from Eat Sleep Van ·

I’m 90% sure you don’t need dubs-adc. You just write your own dbus “driver” that posts your values to the bus.


I think it will work just fine.

ben avatar image ben ♦ Tim from Eat Sleep Van ·

Hey Tim,

I finally got back to my setup and grabbed a dump from dbus-spy. My service clones a tank level sensor that was input from Victron's N2K level sensor adapter.

https://pastebin.com/V3PXhVyJ

I don't think all of those fields are strictly necessary, but it was faster to just copy everything.

I took Victron's sample python dbus driver and modified it to publish all the level sensor fields.

You can see this tank sensor, along with any others, on the tile view screen on the stock Venus UI.

Awesome, I'll give it a whirl when I have a chance and report back. Thanks for taking the time.

Rob Duthie avatar image Rob Duthie Tim from Eat Sleep Van ·

Hi Tim/ Ben

I have tried that another way and i have all the tiles loaded showing the tanks and fuel levels on the front pages etc.

ben avatar image ben ♦ Tim from Eat Sleep Van ·

The important numbers on there are FluidType, which iirc is 5 for black tank and 1 for fresh water, and Level, which is a float from 0 to 100 (I had just emptied my tank when I took that screen dump). I don't think most of the rest of them really matter from a display perspective.

If you have a second tank, just bump the last digit of that dbus address ("com.victron...") by one.

Let me know how it goes.

Rob Duthie avatar image

Hi Tim

Rob here from Rotorua NZ of course I have a Raspi 3B + working with all the tank sensors temp sensors all work OK and showing up on the touch screen etc.

If you want local contact details here for a catch up etc. might be able to help each other out.

As i have one last hurdle to get over and that is to get the Digital I/O GPIO going for the Raspi units then it would be complete unit with the function of the CCGX and the Venus GX.

RD Electronics & Electrical & R&G Energy Systems ltd

Electronic Design & Service

Email: raduthie@xtra.co.nz

Ph: 07 3456043

Mobile: 0272898824

Address: 11 Selwyn Rd

Rotorua,3010

NZ


Share
10 |3000 characters needed characters left characters exceeded

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