OBD2 to MQTT for Home Assistant
What you need?
- an installed Home Assistant with Mosquitto Broker
- (optional) an installed PlatformIO
- (optional) an installed NodeJS and NPM
- a ESP32 with SIM800L
or A7670
- a ELM327 OBD Bluetooth Adapter or any other
- a SIM Card - i use one
from fraenk
- and the most important thing, a car
Getting started
Upload via Web Installer (ESP Web Tools)
If you don't want to install PlatformIO and compile by your own, use
the Web Installer.
Update Settings or Firmware & Filesystem
- connect to WiFi Access Point starts with name OBD2-MQTT- followed from device MAC
- open Browser and navigate to http://192.168.4.1
- change settings to your needs and reboot afterward OR update to new firmware and filesystem
Build
Build firmware.bin
pio run [-e OPTIONAL ENV]
Build littlefs.bin
pio run --target buildfs [-e OPTIONAL ENV]
Upload
Build and upload firmware.bin to device
pio run --target upload -e T-Call-A7670X-V1-0
Build and upload littlefs.bin to device
# connect to AP and save current settings
curl http://192.168.4.1/api/settings -o settings.json
pio run --target uploadfs -e T-Call-A7670X-V1-0
# after reboot connect to AP
curl -X PUT -H "Content-Type: application/json" -d @settings.json http://192.168.4.1/api/settings
Supported Sensors
This sensors only available if your car support.
- Ambient Temperature
- Battery Voltage
- Calculated average speed
- Calculated consumption
- Calculated consumption per 100km or MPG
- Calculated driven distance
- Check Engine Light
- Engine Coolant Temperature
- Engine Load
- Engine Running
- Fuel Level
- Fuel Rate
- Intake Air Temperature
- Kilometer per Hour
- Mass Air Flow
- Oil Temperature
- Pedal Position
- Rounds per minute
- Throttle
- Top Speed ;-)
Diagnostic Output:
- CPU Temperature (ESP)
- Free Memory (ESP)
- GPS Location (only for A76xx)
- GSM Location
- Signal Quality
- Uptime
If you are afraid of the Internet...
...and don't want to expose your MQTT broker on the Internet, use a free MQTT provider and take a look
on mqtt-proxy tool.
ToDos
- support more PIDs (odometer,...)
- get vehicle information (working)