Get Battery Voltage from Camper Van over Internet into Home Asistant

Hi,
i own a camper van that is not parked near my house. To avoid drained batteries, I’d like to remote monitor the battery and have the value input into HA to use it in Automations.

I have:

  • A Windows Mini-PC (Intel N95) with HA running in Hyper-V
  • An old Samsung S7 running Home Assistant Companion App with a data plan in the camper van (for using as Wifi-HotSpot while camping and for locating the Van)

How Do I go from there? I could install a battery guard in the van which connects via BT to the phone - but this would get the data only on the phone…

How long does the battery last as it is now?
Does it take weeks or months to “drain” or what are we talking here?

Adding stuff to monitor a battery means you will drain the battery even faster.
Although a phone isn’t that bad, but if the cellular reception is bad then it could really be bad.
But the computer will use a considerable amount of the battery.

Don’t you have a main power switch to turn everything off?

Drainage depends - as the camper van has 3 batteries it should normally last about a month - but when an ECU does not go to sleep (OTA-Update of whatnot) it may be shorter.

There’s no main switch, everything is controlled electronically (although not very well).

I also have a small solar panel in the van behind the windshield, so I don’t think the added drain of a small device should be an issue.

I figure: better have the battery last a day shorter and know about it than a day longer and arriving at a flat battery…

1 Like

Do you have solar? Why not fit a battery maintainer which will trickle charge the starter battery from the leisure batteries? This is what I’ve done on all my previous vans and it works very well!

The van already charges intelligently (or tries to) all batteries from each other via a ECU-controlled shunt.

Problem with that is, if the starter battery is drained, it tries to charge the starter batt via the leisure batteries and drains (and ultimatlely kills) all three in the process.
I had to replace all three batteries 2 weeks ago… This is a design flaw in my book, but Volkswagen thinks otherwise, unfortunately.

I’m quite shure my solar panel (makes about 25W behind the windshield) should be enough to keep the batteries charged in the summer, but I don’t know about the winter and want to be warned if the voltage drops too low.

Just an update… After reading about 28% of the whole of the internet and querying ChatGPT as well as Google Gemini, the following plan transpired:

  • M5stack Atom Lite ESP32
  • Ina226 Voltage modul for the M5stack
  • Tasker for Android

The ESP32 should read the voltage and send it via Bluetooth LE to my Android Smartphone. Tasker should then be able to read the BLE data and feed it via MQTT to my Home Assistant Server over mobile Internet.

ChatGPT was the one which offered the tasker solution but kept also insisting that the smartphone could act as a bluetooth proxy - Gemini vehemently denied that. I fed the two the opposing answers and ChatGPT relented, saying it would indeed not work, whereas Gemini took the Tasker proposition and said it was a great idea from ChatGPT.

So I ordered above parts. An ESP32 dev Board and a simple voltage sensor would have been cheaper, but would require soldering and also a case of some sort - with the M5Stack plug and play solution I think I can get away with stashing it somewhere in the battery housing because there are no exposed cables or pins.

Let’s see if this will work.

Cost so far: about 25 EUR for the M5stack devices including shipping. I’ll need to buy tasker on top as well as some wires and a fuse, so I should end up somwhere in the 40 EUR ballpark.

As for the solar panel: With enough sun and good placement the batteries charge from half to full in a day even with the panel behind the windshield. When the car is parked in the shadows and weather is worse it was able to keep the batteries on the same level. I guess in the winter I’m going to need a drive every few weeks but the solar panel seems to work well so far.
Also: If the battery monitor works, I’ll know when and don’t have to keep checking on the van.

So, next update. Wasn’t in too big a hurry because the solar panel proved itself sufficient keeping the batteries charged up until now. I guess that might change now as days are getting very short.

Problem: Tasker wasn’t able to receive the data via bluetooth and send it over mqtt so change of plan:

Tasker on the phone activates the wifi hotspot 4 times a day. At the same time, the ESP32 wakes from deep sleep, connects to the wifi, gets a voltage reading and sends the data to home assistant. After that it synchronizes it’s time to HA and gets back into deep sleep. Phone is rooted so that it’ll only be charged when it’s under 50% and will stop charging when it reaches 60%.

This has worked at home with a AA battery, so I’m now preparing to get it into the car and wire everything up. I’ll probably connect the sensor to 12v socket and not direcly to the battery for convenience - don’t need the whole shebang in the summer and on the road. Also: Front 12V sockets are connected to the engine battery, rear one is connected to the leisure battery so I can choose which battery I want to monitor.