Monitor your car battery in Home Assistant

Is it possible to make such a project with a Zigbee connection rather than WiFi? I figure that might be less of a drain on the car battery, and my wireless network is already heavily saturated so I am trying to move smart home things over the my Conbee II instead. I have a solid Zigbee network of static and battery powered devices so the range shouldn’t be an issue, though I don’t know how well they would handle leaving and rejoining the network frequently?

not sure about using the (oh the) zigbee as I am all wifi, but there is no issues with drain on the car battery as in deep sleep it uses uA and mine is only awake for 60 seconds in every hour.

Ok thank you. With your reassurance that wifi shouldn’t be too much of a drain when using Deep Sleep, I picked up 3x Wemos D1 Mini boards and 3x power shields, and have gotten them working on Tasmota, feeding voltage values via MQTT to Mosquitto and then into HomeAssistant.

However I couldn’t see that anybody reported using Deep Sleep on Tasmota, only ESPHome. I tried jumping D0 to RST on one of the boards, and then sending a DeepSleepTime 3600 command in the console (as per DeepSleep - Tasmota), however that device never rejoined my wifi afterwards so I had to re-flash it back to stock to recover.

I therefore attempted an ESPHome build, using the code somebody kindly shared earlier in this thread. However, that never showed up on my wifi either (despite already having an assigned static IP for it’s MAC address from the Tasmota connection), so I flashed it back to Tasmota again.

I prefer having a web interface and am not particularly proficient with tailoring YAML, Tasmota is probably the way forward for me rather than ESPHome… is there anything else I’m missing that I need do to get Deep Sleep to work on Tasmota, and should this still work ok with MQTT? Thanks

Tasmota deepsleep works with d0-rst for me. MQTT works with deep sleep(obviously it needs to be awake to receive). You can send the sleep durations via mqtt. I only have d0-rst linked I don’t use any other wake up wiring. Try some shorter durations for testing 60 or 600. Waiting an hour can be annoying if you miss the wakeup window.

Thanks, yes your suggestion of using shorter DeepSleep intervals helped with the troubleshooting.

I’m still not sure what was actually causing the connection issues, and whether it was power / wifii / DeepSleep related, however incidentally found that after updating my router’s firmware to the latest AsusWRT Merlin they seem to connect more reliably.

Following this I found that adding “force_update: true” to the HA MQTT sensors ensures they always reflect the most recent reading has been obtained from the broker, even if it’s identical to the previous reading - otherwise it can appear as though it hasn’t updated. And enabling “SensorRetain 1” in the Tasmota console ensures after a HA restart it displays the last known reading before the next DeepSleep wake-up.

All seems to be working well now with DeepSleepTime 3600.

2 Likes

Well this is typical, I put it all together, connect it to my battery and it all works perfectly, shut the bonnet of my car and come inside to calibrate the D1 Mini and its not connected, it appears my engine bay is too good of an insulator!

I had to add a 2nd hand access point just for the drive. firstly for the battery monitors, but it came in handy as I discovered Wled for Christmas decorations. :blush:

I’ve got a golf cart I am looking to do the same thing with. Its got 4 batteries 48v, is it as simple as 4x the resistance at 2.72M to achieve the same result?

I came here hoping to find a solution for this as well. It appears my hood (bonnet) is a faraday cage

I can also be fitted to the inside of the car, I have installed one at the top of the windscreen on my daughters new car, You just need to be able to find a battery +ve inside the car and calibrate with the voltage drop to where you mount the D1.

It could be just a coincidence but this project maybe I am not sure could have caused my battery’s premature failure. Yesterday I had a battery warning while driving. I had the teleperiod comd at 900 also.
Any other way you guys recommend to power up the device instead of the actual car battery?

Did you get a warning while driving?
In that case your alternator is not supplying enough or the battery is really depleted.

If you mean to got a low battery warning just as you started the car then that is kind of expected when you use the battery to send updates of what the battery voltage is even though it’s really not needed and shouldn’t change significantly.

1 Like

You are right on the money. Alternator gone bad. understandably so since it is a somewhat old car.

On a side note, any way I can get the D1 mini that’s using Tasmota Deepsleep to wake up somewhat quicker and send voltage change to home assistant so I can use the voltage change to alert/confirm that the car started?
I get a notification now, but it’s delayed by 10 minutes at least.

before i plug the d1 mini into my 12v car batt, i thought i would try with this 12v dc plug

strangely, i dont see the D1’s LED turn on when i plug it in.


RST and D0 is soldered together (not seen in this picture). using a volt meter, i get 12v dc between VIN and GND
but i get nothing between 5V and the GND. I also get nothing between 3v3 and GND.
in log of esphome, this is all i have

any idea what’s going on? is my D1 mini fried???

nevermind. i swapped to another power shield and all is good now.
how do i calibrate though? play around with this number right?
image

actual voltage from meter is 12.23v.
HA is showing 11.71v

yes you are correct, just play around with the multiply option until you get it spot on.

Or be a bit more scientific and calculate it.

12.21÷(11.71÷14.5583) = 15.1799182749

so happy to say i got it working. but found out the D1 mini under the hood has terrible wifi coverage or something. will try the D1 pro mini with an external antenna. hope that will help out