Torque OBD 2 Workaround

As you all know there is an issue with torque component (if anyone got it working please let me know) I have made a workaround which I was using for a while now… would like to share it. I have done it with the help of android device and apps.

Apps Used

Tasker (paid)

MQTT Publisher Plugin (free)

Auto Tooles (paid optional)

Torque Pro settings

Note: Above “Select what to Log” have to be the same order as it’s in the screenshot ( the method I have used is Tasker variable split) if you want to use different PIDs then you have to tweak on task ( Camaro Ha 2) for your needs.

How it Works

When Android device connects to Car Bluetooth or OBD it enables a profile called ‘‘Camaro Data 2’’ will call it as CD2. and a variable called "Hacamaro is set to 0.

CD2 runs every 2 minutes. on its first run, it matches an IF state Hacamaro = 0. which is 0. it Launch torque app and waits for 5 sec and goes back to home screen. now it changes variable Hacamaro to 1. from now every 2 minutes when CD2 triggers it will skip torque lunch action and continues with the task. the task gets the trackLog.CSV file from the device and goes to last updated logs and splits those logs to the required data. once all the data is saved on variables it will perform another task called MQTT Publish 2 which will be publishing the data to Home Assistant.

when the device is disconnected from car Bluetooth/OBD 2 it will disable profile CD2, perform task Camaro Ha 2 for the last time to get the last Logged data and changes variable Hacamaro to 0 and it will close the Torque pro app.

there also a profile called “Delete Log file” this will delete file trackLog.CSV once in every 2 days at 2 A.M disable this profile if you don’t want to delete your logs.

I’m sure there is a better way to do this… if anyone has done it please share it.

Tasker Project File

Home Assistant Setup

Sensor

  - platform: mqtt
    name: Km Per Liter
    state_topic: camaro/state
    value_template: '{{ value_json.kmliter }}'
    
  - platform: mqtt
    name: Fuel Left
    unit_of_measurement: "%"
    state_topic: camaro/state
    value_template: '{{ value_json.fuelleft }}'
    
  - platform: mqtt
    name: Fuel Price
    state_topic: camaro/state
    value_template: '{{ value_json.fuelprice }}'
  
  - platform: mqtt
    name: Last Drive Duration
    state_topic: camaro/state
    value_template: '{{ value_json.lastdd }}'    

  - platform: mqtt
    name: Top Speed
    state_topic: camaro/state
    value_template: '{{ value_json.topspeed }}'

  - platform: mqtt
    name: Total Km 
    state_topic: camaro/state
    value_template: '{{ value_json.totalkm }}'    
 
  - platform: mqtt
    name: Last Updated
    state_topic: camaro/state
    value_template: '{{ value_json.lastupdated }}'
    
  - platform: mqtt
    name: Distance to Empty
    unit_of_measurement: "Km"
    state_topic: camaro/state
    value_template: '{{ value_json.estimatekm }}'

Groups

Camarocar:
  name: Camaro
  entities:
    - sensor.last_updated
    - sensor.fuel_left
    - sensor.distance_to_empty
    - sensor.fuel_price
    - sensor.km_per_liter
    - sensor.last_drive_duration
    - sensor.top_speed
    - sensor.total_km

custimize

sensor.fuel_left:
  icon: mdi:gas-station
  
sensor.fuel_price:
  icon: mdi:gas-station
 
sensor.distance_to_empty:
    icon: mdi:gas-station
  
sensor.km_per_liter:  
  icon: mdi:road-variant
  
sensor.last_drive_duration:
  icon: mdi:timer-sand
  
sensor.last_updated:
  icon: mdi:timer-sand
  
sensor.top_speed:
  icon: mdi:speedometer
  
sensor.total_km:
  icon: mdi:speedometer
10 Likes

thank for sharing

1 Like

Thanks for sharing! Everything’s working for me after some tweaks to tasker.

Thanks for sharing.
In my setup, I just “upload” the CSV by Tasker to a webhook in HA. In NodeRed I have written some Code for parsing the whole stuff, because JS is easier for me and therfore I only need to create one single sensor :wink: But your thread gave me the initial idea! :+1: