I just cobbled this together yesterday, so there are better ways to do many of the sections, but it works! I managed to rig together a little bit of python, a low-spec VM with a USB bluetooth adapter, and HomeAssistant running an MQTT broker to automatically display the fuel levels of our two cars.
I purchased these OBD-II sensors for $12 on Amazon: https://www.amazon.com/dp/B07CP5ZJVQ
I purchased this for another Bluetooth DIY project: https://www.amazon.com/dp/B0DJMN7736, but it just happened to work for this as well. I use this because it has a longer range to reach the driveway/garage from my server. This allowed me to not have to have a second physical device inside the garage listening for the OBD-II sensors.
I spun up a 512 MB single-core vCPU Lubuntu VM on my Proxmox instance (but you could do the same with a Raspberry Pi, as it should be the same steps).
I Bluetooth-paired the VM with the OBD-II sensors via the Desktop GUI, and took note of their MAC addresses. I made a folder at /home/sam/obd to run everything from. I have four Python scripts, and one shell script.
/etc/systemd/system/car.service--> service file to run thestart_all.shscript at bootstart_all.sh--> Kicked off by the service, runs the four.pyscripts belowlisten_for_jeep_fuel.py--> Connects to serial port on OBD-II adapterlisten_for_mitsubishi_fuel.py--> "mqtt_jeep.py--> Publishes topic every 10 seconds by reading from thejeep_fuel_level.txtfilemqtt_mitsubishi.py--> "
For simplicity, I'll just show the Jeep example (the Mitsubishi is the same with with the rfcomm1 changed to rfcomm0 in the fuel .py, and the .txt filename changed in the mqtt .py).
Diagnose & Monitor Your Vehicle with Ease.Stable Bluetooth Connection,Smoother on your cars compared to our competitors. Bluetooth OBD2 Scanner Send Faster Data to your Android & Windows devices from vehicle in real time.Read & Clear error codes causing the car engine light codes on and fix it by...

), and I got it to read the codes for it.