Source for BYD Atto 3 battery state of charge

Just circling back

I am currently using a slightly lame solution of simply running a script using the macrodroid app on my Android phone on screen going blank.
If the phone is connected to my home wifi and the script hasn’t be run for 30min it opens the BYD app and grabs the SOC from the screen, sending it to an input_number helper in Hass via the Rest API.

It is good enough for my purposes and lets me optimise my EV & home battery charging from solar and limit the BYD charge to 80% as default. The script really only needs to run successfully once a day to serve my purposes as I can estimate current SoC from the last update + energy that the EVSE has put in since that time. (I very rarely charge at night - in those cases I just change the EVSE mode and charge to 100% anyway).

It would be ideal if it could be run this script on an android VM on my proxmox server, but the BYD app requires ARM architecture and I didn’t have the energy to get that working via emulation.

Given the BYD comes with a hotspot built-in (not enabled by default), is there any merit to having a dedicated device connected to the car that feeds info to HA remotely?
Then it could use the OBDII connector to get the data and report back live.

OR, could you have a dedicated Android Auto device with the HA app installed?

The meatpiHQ/wican and OVMS devices referenced above would do that.

1 Like

I have a hack for my Seal to get SoC, using an old tablet running A Better Route Planner. Using an obdlink cx+.

Effectively, the tablet just runs ABRP and when the car enters the garage it will automatically connect via BLE and extract the state of charge. ABRP has an API that I can then call to grab the SoC as reported there.

I have EVCC to manage my charging, so it will grab the SoC from the API every 30s.

It’s a kludge, it works, but its not the most efficient method. So I’m looking at how I can develop a BLE serial connection to the CX+ and extract information from the various PIDs available from the car. That way I can do it once every 5 or 10 minutes instead of constantly polling.

Would you be able to share that macro? I had a quick go but got lost when it came to the text extraction bit.

Hi @Mod74
Try the link Wormhole - Simple, private file sharing . It will there for the next 24hrs

You need to obtain a long lived token from home assistant and then insert that into the variable in the macro, update the address for home assistant and update the input_number name to match your choice (or just create input_number.byd_percent in hass).

This is the key bit I think you were after :

I’m appending the hour to the SOC to make sure the “last_updated” is always set even if the SOC hasn’t changed since the last run.

Hope it works for you.

The obdlink cx+ sounds like it is a secure bluetooth implementation, but it’s worth pointing out that many aren’t. https://www.usenix.org/system/files/sec20summer_wen_prepub.pdf

Yeah ‘relatively’ secure. It doesn’t accept pair requests after about 10 minutes of being powered on. So you could get unlucky.

It would be a lot more preferable for the car to provide an API to read information like that.

1 Like

I now have a prototype arduino sketch that is working on my M5Dial to connect to the OBDLink device and poll the state of charge every 15 minutes. It’s better than the ABRP method of constantly polling, but I need to make it a little more stable.

Also working with CarScanner to figure out some of the other customs PIDs to get more detail.

2 Likes

Are you still relying on bluetooth to the ODBC connected device?

Yes, still using the OBDLink CX+ because it works with ABRP, has some security through only being able to pair in the first 10 minutes after it’s turned on and can only be connected to one device at a time.

Hi, thank you for sharing. I didn’t see this in time to get the contents of the link, but I’ll try to piece it together using the screenshot. Thank you!

@Mod74 messaged you

Would this also work for a BYD Dolphin?