Wouldn’t it be cool if you could get live data from your car and feed that into Home Assistant?

Well it seemed cool to me and now that I am writing about it, I am forced to come up with some good reasons as to why you dear reader, might do this. So I will jot down a few reasons here. But for me (and probably you), the real reason we do these things is for the joy of investigating how to do it and then making it happen.
Reasons for integrating car telemetry into home assistant:
- Always have an up to date map position of where your car (or the family car) is and get notifications when it arrives home.
- Store data on the performance of your car journeys, such as fuel used per trip, CO2 used per trip, engine performance etc.
- Chart the performance of your car over time using ODB2 parameters such as LTFT, STFT and MAF and other metrics and warn of possible engine faults before they fail.
- Keep a log of car journeys.

Where to start
Firstly, you are going to need the right hardware. This is essential to get a reliable data feed into Home Assistant which doesn’t fail (very often) and means you can just forget about things and they will just happen. This is not necessarily a cheap project, although I will offer some alternatives as to how you can lower the price or use your own smartphone rather than purchasing expensive hardware for your car.
Hardware needed:
- An ODB2 Bluetooth or WIFI car transmitter. Nearly all modern cars in the EU and USA have a service port somewhere under the car dashboard which provides live data from many sensors within your car engine. I use a cheap ODB2 receiver to grab the sensor information and transmit via bluetooth to my android device. Its also important for this project to pick the right ODB2 receiver. You need one which goes into sleep mode automatically and even more importantly, wakes up when it receives a Bluetooth connection attempt. Most cheap ODB2 receivers do not do this, so I am recommending the one I have working which is the Vgate Icar Pro. BT3.0 version should work fine. Bluetooth low energy version is not necessary.
- An android device (v8 or later). I have two options here, which have different advantages:
- Option 1 – Expensive option: swap out your car stereo
- Use an in-car entertainment system based on android. I have a Nissan Qashqai and swapped out my factory installed car stereo for an android head unit from a company called Joying. (https://www.joyingauto.com). Joying are well known for their good value after-market car stereos based on android. This is another subject in its own right, so I cannot advise you here on what the best after market car stereo for your own vehicle might be. However, I do think Joying probably have a solution for your particular car. There are many advantages of replacing your basic car stereo for an android stereo, but for the purposes of this project it provides dedicated hardware in which to host the ODB2 software (Torque).
- An in car mobile data usb dongle. I use this model in the UK, but you can use whichever suits your country. Obviously, what we are doing here, is providing a mobile data connection so that information can be sent back to your home. As a side benefit, you get in car wifi. In the UK, it is also simple to purchase a no contract data sim with a set amount of data. Here is an example. The key thing to look for is a data sim which allows your data to be spread over 12/24 months. By the way, this project will use very little data. The bulk of my data use on the usb dongle, is to stream internet radio, you tube and run google maps in the car.
- Option 1 – Expensive option: swap out your car stereo
Tip: Some of the newer Android car stereo models from Joying now include a built in 4g mobile module so purchasing a separate dongle is not necessary.
- Option 2 – Cheaper option: use an android smartphone
- Whilst this option will work, it only works when your smartphone is in the car. If you share your car, then this is not ideal to capture every journey.
Software needed:
- Llamalab Automate (available on google play). If you have never heard of this app before, it is a visual scripting tool which allows you to do a lot of clever things on your android device. It is similar to a product called Tasker, but I really like the visual scripting language. Also if you choose this product you will be able to download my pre-prepared script to grab the ODB2 data and post it to Home Assistant.
- Torque lite (or pro). This is a very popular application which runs on android devices and connects to ODB2 receivers. It can be used to show the data in the application, but for this project we will be using its data logging capabilities.
- MQTT Broker (like mosquitto). It’s likely that your Home Assistant server is already running an MQTT server for other devices, but just in case it is not, you need to run an MQTT server and configure in Home Assistant.
Step 1 : Installing the ODB2 adapter and Torque software:
So assuming you have the components I have described above, the first thing to do is install the ODB2 dongle into your car ODB2 Port. Your car manual should tell you where the ODB2 port is if you cannot find it. Once found, it is simply a matter to plug it in. I should warn you that you do this at your own risk. I can’t be held responsible for any damage resulting from this. I and many people have installed these devices without any problems. If you purchased the model I recommended, then it should be safe to leave this device in the ODB2 port permanently. I have had it in place for over a year. When disconnected, it will power down and will not drain your car battery.
Installing Torque Application:
Turn on your car ignition so there is power to the ODB2 receiver and then on your android device, go to the bluetooth setting and search and pair to the ODB2 receiver.

Now install Torque lite (or pro) onto your android device. The app will ask you to complete some information to profile your particular car. If you are lucky the app will automatically connect via Bluetooth to your ODB2 adapter. If it does not connect, go to the Torque settings and check the ODB2 adapter settings. The front screen always shows a tachometer, and when there is a successful Bluetooth connection, the current revs of your engine will be shown.
Now that we have a successful connection, we need to set up the logging. Go to ‘settings’ and select ‘Data logging & upload’. Complete the following settings below:
Select what to log:
The first thing you are going to do is select the data set that you want to log. These datasets are called PID’s in the ODB2 protocol. The specific dataset (PID’s) available from your car will be dependent on what the cars manufacturer is willing to provide over the ODB2 interface. The Torgue app makes this simple for you by highlighting the PID’s available in light green. I recommend you choose 1 or 2 PId’s for basic testing at first.
Synchronous logging file log interval: off
File logging interval: Choose 5 seconds.
Log when Torgue is started: Yes
Only when ODB connected: Yes
Automatically log GPS: Yes
Rotate log files: No
Ok, to recap. We have installed the ODB2 adapter and paired it to the android device. We have installed the Torque app and configured it to connect to the ODB2 adapter and log some data continuously to always run in the background (we will automatically restart the app using a script later).
Step 2 : Configure Home assistant access and security:
For the next step we need to prepare Home Assistant to receive data from an external device and to do this we are going to use the ‘services api call’ available in Home Assistant. But first, a word on accessing Home Assistant through your home network router.
Clearly Home Assistant needs to be accessible from the internet so that your car can communicate to it. But we don’t want any bad actor hacking your Home Asistant server, so we need to implement some security. I’m going to assume that as a user of Home Assistant, you are already aware of how and why you should implement SSL security to access your server. If you have not yet implemented security, this project will still work but will be, well , less secure.
We are going to communicate to Home Assistant using the services api. For security, we are going to set a password which must be provided for any external device connecting to the API. Choose a nice long one. This is defined under the auth_providers section. See example below.
auth_providers:
– type: legacy_api_password
api_password: [your_api_password]
Update on Security. The above method of security is no longer recommend. Home Assistant have made several advances in implementing security in recent versions and you may choose an alternative secure way of posting data to Home Assistant using ‘long lived tokens’. The Llamalab Automate script I have created now supports long lived access tokens. Simply create an access token in Home assistant and take a copy of the security string provided for later use.
Step 3: Installing Llamalab Automate:
On your android device, install Llamalab Automate from the Google play store. Then go to the Llamalab community section in the app and search for a script called ‘Car Telemetry to Home Assistant’. Download the script posted by me (Robert Cunningham) and open it.
We are going to instruct Llamalab Automate to send data to your particular Home Asssitant instance. To do this we use the HTTP request block in Llamalab Automate. An HTTP request to home assistant would look like this:
https://[Your Home assistant server domain address]/api/service/mqtt/publish
Note: my Home assistant server connection is SSL Encrypted. Yours may or may not be. I’m not judging.
Llamalab Automate presents scripts in a visual friendly block diagram. Each block represents a task and then is linked to the next task by a line. The code is all visible for you to review. Here is what my script will do:
- At startup, get some information from you to communicate with your own instance of home assistant and store it on your device.
- Wait until a new log file called Torque.log appears on your android device. (when a file is created we know that the Torque app has connected to your ODB2 receiver and is recording data)
- Scan the header of the file to obtain the names of each PID you selected to log and store it.
- Scan the last line of the log file for the latest PID dataset (which is appended to the log every few seconds by Torque).
- Format the data into a JSON format message ready for acceptance by Home Assistant. (Home Assistant will pass this data to the MQTT server).
- Construct a HTTP Post request to the Home assistant services API, containing your user authentication and the payload.
- Confirm the data was received by Home Assistant.
- Repeat sending the data until the car engine is switched off (journey end).
There are a few additional features which you can also benefit from in my script:
- Scan the immediate area for bluetooth devices. (I use this to report who is in the car, but you don’t strictly need this).
- Sends information in the correct format to be used by the ‘owntracks’ integration to Home Assistant. This allows your car to show up on the map in home assistant.
Step 4: Inserting long lived access token into Llamalab Automate script:
If you are using a long lived access token in HA, simply run the Automate script and complete the questions. When asked for a token, paste in the access token you noted down from Home Assistant earlier. It should read as follows … Bearer xxxxxxx….(long list of characters). The information you inputted will be stored in a file called /torqueLogs/car_config.json. if you need to change this information, delete the file before you re- run the script. The token never leaves your device.
Step 5: First test:
OK, this completes the basic setup stage. We have configured Home Assistant to accept secure messages and publish them to your internal MQTT server. We have set up your android device to connect to the Cars ODB2 port, receive the data and log the data. We have configured the Llamalab Automate script to transmit the data in a suitable format to Home Assistant. With these basics in place, you should be able to test it out.
Run the Torque App and the Automate Script. If everything has gone well, you should be able to turn on your car engine and data should start flowing. Of course, I’m sure you will have to work out any little bugs in your setup. With the Automate script running you will begin to see messages in the Automate script log. If you are seeing messages like, ” Rest Post success:Torque data:200″, then this means that the messages are getting through to your Home Assistant server correctly. If you a seeing exception messages or “catch Failure” messages, you will need to debug the problem. Some tips from me are below:
- Remember that if you are not using SSL security on your Home Assistant server then the http blocks we looked at earlier need to be ‘http’ requests, rather than ‘https’ requests.
- Check Torque is creating a log file called Torque.log and that the LlamaLab Automate script is picking up that log file from the correct location on your android device.
- Check in the Llamlab Automate Log that Home Assistant is returning a HTTP post response of value 200. This essentially means that Home assistant received the data and the format of the data was acceptable to it.
- Check your MQTT server and search for the topic called ‘devices/[car name]/torque’. This should now contain a JSON packet of Torque data from your car.
- if the MQTT topic is updating, but there is no payload, investigate further on what data is being sent to HA from the script blocks.
I’m sure there might be a few stumbles along the way, and its impossible to predict what might have gone wrong for you, so you might need to debug your HA setup and the llamlab script, but if everything is OK it should now automatically start reporting telemetry from your car into your MQTT server..
Step 6: Home Asisstant Configuration
The last step should be familiar to an Home assistant User. The Home Assistant configuration needs a sensor to make the data available. This is easily done now by adding the following lines to the configuration.yaml file.
- platform: mqtt
name: “Quashqai Torque”
state_topic: “devices/quashqai/torque”
value_template: “{{ state_attr(‘sensor.quashqai_torque’, ‘GPS Time’) }}”
json_attributes_topic: “devices/quashqai/torque”
Note: Since I drive a Quashqai, this is what I have named my sensor. You should replace with the name you gave your car in the Automate script. Also, it is important to make sure GPS Time is the state attribute as it is always changing and therefore HA will always update the sensor on a state change.

Finally
So now we have the data in Home Assistant. I will leave you to decide how you present the data and what ingenious automations you come up with. I share my setup below to give you ideas. In a later post, I’ll show how I record the data to a database and present it in the grafana data visualisation tool.



Some longer term issues to note:
It’s been fun learning how to do this project, but I should make you aware of some feedback over the longer term.
- 2 years or more later. The android car stereo and ODB2 Bluetooth adapter have performed well without any intervention from me. It took a while to craft the llamalab script to make it reliable so please benefit from my learning.
- If the car engine is turned off and on in quick succession, you may get some broken trip reports as Torque App has cleared the log and started a new journey. So this can happen when you make a fuel stop. The data will still be captured but will be reported in Grafana as two trips.
- Llamalab Automate may fail on occasion to send data to Home assistant because your mobile network connection in your car is unreliable. I have made the Automate script resilient so the script should not crash, but you may get some gaps in the data.
Does not work. Do with the help 4a option. But the message “Login attempt or request with invalid authentication” comes from the Home Assistant”. Need help!
If you are using ‘api passsword’ in home assistant, then you are getting this message most likely because your
config file doesn’t match with the password you have put in the llamalab script. Try constructing a simple http request in your web browser first. Also, note that home assistant prefers you to use long lived access tokens now, which is option 4b. The latest version of the llamalab script is using the long lived access token method.
sorry, my mistake, I use 4b method with long lived access token and have this message “Login attempt or request with invalid authentication”
Try downloading the llamalab script again. Ive made some changes that should help.
Tried. Not help. All the same, HA writes the error that I wrote above. In the HA settings, I don’t have any restrictions on networks. I use DuckDNS and SSL. If it helps, here is a link to the logs. I changed the real address there, of course. https://yadi.sk/d/_esUNlcqoLBEBA
So your flow log shows a 401 error, which means you are connecting successfully, but HA does not like your authorisation code. I looked in your car_config.json file and see that your token is not correct. It needs to have “Bearer xxxxxx…” at the beginning. That’s bearer and then a space and then your token key. I think it should work for you then.
Could you please send me to my email (gp_astron@mail.ru )how should correct car_config.json file looks like. I don’t know word “Bearer” and Google translate didn’t help me in understanding. Sorry 🙂
See copy in your e-mail.
Also this link helps explain.. https://swagger.io/docs/specification/authentication/bearer-authentication/
Oh, now I understand 🙂 Thanks a lot, I will try it tomorrow.
Test it with “Bearer token” and it works! Thanks for your help!
Congratulations, incredible project. It works perfectly for me.
Now I have to see how to automatically start Torque and Automate when I turn on Android Car Radio.
i have a new automate script which I will publish soon which should do this for you. I found the latest version of Torque app was not auto starting anymore. ‘Llamalab Automate’ scripts should restart after rebbot if you choose that option in settings.
Hello – this really looks interesting. So does this work with the current version of Torque because the app states that webserver must respond with an “OK”? Does HA actually respond or is this something new? Also, I use NabuCasa which gives me a direct SSL connection to my HA device via some long, random URL; however, it doesn’t appear to work. When your script prompts for the Domain do you just use the “HA address” and not include “/api/service/mqtt/publish”?
This method uses a llamalab script to post the data direct to HA. It does not use the torque webserver posting method. When asked for the domain just write the domain, e.g. https://domain.com. the lamalab script ads the rest. This script does not post to nabu casa, but direct to your HA. You can set up your own long lived access token in HA to recieve a message. I guess you could change the automate blocks that do this, to point to nabu casa, but the url structure might be a little different.
I finally got data into my HA; however, I get the escape characters being sent via MQTT (see below)
{
“payload”: “{\”_type\”:\”location\”,\”tid\”:\”me\”,\”acc\”:,\”batt\”:77,\”conn\”:\”m\”,\”doze\”:false,\”lat\”:,\”lon\”:,\”tst\”:}”,
“topic”: “owntracks/homeassistant/mercedes”,
“retain”: “True”
}
And when I create a MQTT sensor in HA in never triggers. (see below)
owntracks:
max_gps_accuracy: 100
mqtt_topic: “owntracks/homeassistant/mercedes”
sensor:
– platform: mqtt
name: “Test Battery”
state_topic: “owntracks/homeassistant/mercedes”
unit_of_measurement: ‘%’
value_template: “{{ value_json.batt }}”
Are you having similar issues and do you think it’s related to the escape characters?
Great project and thanks for all the effort.
I tried it today, but the only MQTT message I get is:
/devices/Polo 6R/torque
{}
and another MQTT message with:
“time”: “actual time and date”
“occupants”: “3 MAC-addresses”
“speed”: “0”
If I open the TorqueLog, everything looks fine, except that all the data isn’t seperated in the rows, but all the data is in 1 cell.
If I import the log into a Torque viewer, it shows normal data.
It sounds like the block that is sending the torque data is maybe not posting the data correctly. But the block sending the other mqtt message is getting through, so you might need to debug the torque block in llamlab automate and check it is posting the data correctly. There are other blocks in lamalab useful for debugging lile the toast notification block which displays the contents of a variable.
Was there a solution to this? I am having the same issue – MQTT explorer shows the right topic (devices\focus) but displays “time” “occupants” “bytes_downloaded” “bytes uploaded” “lat” “lon” “acc” “speed”
I’m trying to find a way to review the automate script on my computer, but I was hoping someone else had a solution to this?
Thanks for taking the time to write this up. This could well be my next corona lockdown project.
Any suggestions for what would be the most basic suitable android phone to purchase 2nd hand? I’m purely Apple but I’ll concede this project will work better with a dedicated android phone in the car.
My daughter uses a motorola moto g6 Play 5.7-Inch Android 8.0 which is quite cheap and would do the job. An android head unit would be ideal though as it has and external gps and I find they tend to have better reading than a phone in the car.
@Robert Cunningham:
Super cool project. I’m a big fan of HomeAssistant (using it sinds v0.30, I thing it whas 2016 ).
A friend of mine told me last fryday that I can pull data from my car.
Me: realy not a car person, “what really, … data from my car?…” A few seconds later I was browsing your site a few minutes after that, I bought a “vgate icar pro bluetooth 4”
So, thx for sharing!
Great project!
Grtz, Donovan
Great to know my project is of use to you.
Hi, I’m testing this but the config doesn’t seem to work:
Invalid config for [sensor.mqtt]: invalid template (TemplateSyntaxError: unexpected char ‘‘’ at 14) for dictionary value @ data[‘value_template’]. Got ‘{{ state_attr(‘sensor.silverado_torque’, ‘GPS Time’) }}’. (See ?, line ?).
Nevermind, figured it out. Can’t copy and paste your config because the ” character is not the same as the one that HA expects.
Glad you figured out the problem.
Also ‘ should be ‘
Which Vgate Icar Pro model did you use? BT 3.0 or BLE 4.0?
My head unit does not use low energy Bluetooth. BT should be fine.
Hey, just came across this article and was amazed with the idea! Never thought to get my old 2008 cars data into HA! I might have a go at the android phone idea but I’m a bit worried about battery drain, do you think it would be possible to just have an NFC tag in the car somewhere and set the automate app to do something like “When I scan the tag, connect to the device, upload all files in the folder and then delete them all” ? Would then mean I can just send over a load of data… Read more »
yes, I should think this is easy to do but if I understnad you correctly, I’m not sure you can have any data to upload if your android device is not connected and collecting the data for the length of your journeys.
I don’t mind the phone connecting to the device but it’s more the battery drain of continuously transmitting that data back home over 4G. I don’t need it realtime in HA so it would be useful to just “automatically” upload that data at the end of a trip, or just upload whatever is new when NFC tag is tapped. If that clears up what I meant!
Yes, you could do this, but not with the automate script I have written. It was designed to write in real time. However you could hack my script with a bit of effort to upload all the data at the end of your journey. Personally I don’t think there is much battery drain using the real-time transmission and you do have power in your car.
Thanks for documenting this! I ran the script and inputted all my details but for some reason the Automate app logs only show:
It then stops there and runs but nothing looks to be coming into homeassistant/mqtt server. any ideas where else to look to see what is happening?
t looks as though the scripts is sticking at blocks 1708 and 1707. These blocks launch torque app and then wait to see if it launches. Possibly, you just need to go into the blocks and reselect the torque app for your device. If don’t want to use the script to start, you don’t need them and could bypass them by link block 1390 to 1709.
Ah ok thanks Robert! that definitely got it a little further, it’s still populating data into my mqtt server but I haven’t had a chance to dig more into the logs. Thanks for responding so quickly!
Hi Rob, would you know of an app that works on a PC? Thanks for sharing this awesome project!
-Mon
No I don’t. I think you could write a python program or look at node red.
Is there any straightforward way to utilize this if I run a broker seperate from HAs instance? I’ve gotten an external url configured and I’m running mosquitto on ubuntu if that’s any help. Thanks for any help!
You would need to expose your broker to the internet and then alter the automate script to update the broker directly. There are mqtt broker extensions that allow automate to do this.
Hello, I am trying to get this up and running however my phone wont allow me to check the privileges box for “appear on top….” I get the message its disabled as it slows your phone down.(its only a cheap android 10 unit I was going to leave in the car” I have followed all the steps and watched the video by “make it work” who uses your instructions. Upon starting the flow I get a “Stopped by failure” message, is this because of the unchecked privilege or have I got something else wrong too? I only see 1 sensor… Read more »
Switch on full logging and then run the script. Just before the stopped by failure log message you will see which block caused the problem. This will most likely lead you to the problem. Another thing to do is try that block function in a new script so you can really see what’s happening.
Hello i have this problem, my log, whats wrong im do 08-05 17:36:39.511 I 114@452: Flow beginning 08-05 17:36:39.511 I 114@1311: Fork 08-05 17:36:39.524 I 114@1535: File exists? 08-05 17:36:39.530 I 115@1309: Broadcast receive 08-05 17:36:39.539 I 114@1403: File exists? 08-05 17:36:39.547 I 114@1669: File read text 08-05 17:36:39.556 I 114@1670: Variable set 08-05 17:36:39.556 I 114@1671: For each 08-05 17:36:39.557 I 114@1672: Dictionary put 08-05 17:36:39.557 I 114@1671: For each 08-05 17:36:39.558 I 114@1672: Dictionary put 08-05 17:36:39.559 I 114@1671: For each 08-05 17:36:39.562 I 114@1672: Dictionary put 08-05 17:36:39.562 I 114@1671: For each 08-05 17:36:39.563 I 114@1672: Dictionary… Read more »
At a guess, it looks like block 1707 is not able to check torque is in the foreground. I would suggest you try looking at the priveledges for this automate script, or ammend the flow to Skipp this block as it is not strictly needed.
Ok, I deleted this block as you wrote, and I managed to connect to the car and ha, thank you for your help and a good job
This is fantastic, thank you so much!
Glad it’s of use to you.
I was struggling to make it work and I noticed that my token was ‘only’ 163 characters. maybe this is a bug when you copy it with android? Anyway I have downloaded the car_config_json and created a new token ( now with 183 characters) on the pc and edited the json file and uploaded it again.
Now all is working! 🙂
Also a tip if you made a mistake and you want to re enter the config just delete de car_config_json file which you can find on your phone in the torquelogs folder
You can also overwrite the config.🙂
anybody know why Home assistant config is saying this?
Integration error: sensors – Integration ‘sensors’ not found.
I cant seem to find torque addon or integration anywhere
I think I messed something up in the script in automate, is there any way to start it over?
I keep getting this error [javax.net.ssl.sslhandshakeexception: connection closed by peer]
I cant figure out why. can you help?
it seems my comment didn’t save yesterday.
I keep getting this error ” http post failure at block 1359 javax.net.ssl.sslhandshakeexception: connection closed by peer”
any idea what might cause this error?
I have HA external URL setup with duckdns. latest firmware on both supervisor and core.
mqtt also setup and checked with mqtt explorer.
are you still maintaining this script?
Only sporadically. It is very open for you to trial and error.
Its working quite well for me. Thank you for sharing all this! One thing, I cant seem to find how to upload ‘odometer’ or ‘total miles/km’ in the Torque app. I search through the list of things I can upload from Torque to HA but none of the options seem to be for total miles the car has driven. What am I missing? Anyone else have this issue or just me?
Your odb2 dongle can only access ECU data from the car. If the cars ECU data is not supplying that information, not much you can do. I imagine if you got hold of a much more sophisticated odb2 reader, you might fair better, but these are specialist equipment that garages use.
After a quick google search I found the below 🙁 anyone have a way of pulling odometer readings?
Why OBD-II dongles are bad at verifying mileage
Inaccuracy: It might surprise you, but on-board diagnostics dongles aren’t able to access a vehicle’s actual odometer reading. Instead, OBD dongles calculate a car’s approximate mileage information based on its location as well as the start and end of the driver’s trips.
Thanks for the script! It was working perefctly for a few days.. but suddenly, Torque Pro stopped to create “trackLog.csv” in sd card folder, but instead it creates it in secured location “Andorid/data/com.prowl.torque/files/torqueLogs” Any idea how to fix it?
Yes. I have the same problem. It appears to be the latest update to Torque. I have emailed the developer. Not sure if this is changed by design or by error at this point
You’re right, update is broken. I installed one version earlier and it is working
good to know! thanks I will not update.
Same here…. 🙁
I’m going crazy in these days because i didn’t find the tracklogs.cvs…
The author of Torque has provided an update that makes the log file accessible again.
it continues to show “file not found”, i have to try after installing a microsd, because at the moment it stores on my device… is this the error?
Can confirm that I’m still seeing the log in the wrong location. I’ve even joined the beta.
The dev let me know that the file has been moved to Documents/torqueLogs/trackLog.csv
I’m seeing it in the original location, but see below. The Torque app was updated recently which meant that my ‘car telemetry script’ couldn’t find log file data. The author of Torque app has issued another update which makes log data accessable again. I have introduced a new automate script which provides more consistensy and guidance in setup, as people often get stuck on the same issue’s. This is version 13 of the script and is available in the automate community space. I’m also working on a version over Xmas which should allow a user to select the file location… Read more »
I saw some odd behaviour with Torque when it reverted to making the logs accessible. Try turning off and on logging in Torque. For me the log is back in the original directory. However also see the blog update below: The Torque app was updated recently which meant that my ‘car telemetry script’ couldn’t find log file data. The author of Torque app has issued another update which makes log data accessable again. I have introduced a new automate script which provides more consistensy and guidance in setup, as people often get stuck on the same issue’s. This is version… Read more »
Hi Robert, brilliant project, thank you! The only issue I’m having is the file directory for Torque – for me, the trackLog.csv is stored in (root)/Documents/torqueLogs instead of (root)/torqueLogs as you have set in your Automate Flow. I was wondering if you would be able to have a dialog to ask the user what directory they would like to use because I’m having to go through and change the flow elements to look in Documents. Would appreciate the help!
Thanks for the feedback. See below. The Torque app was updated recently which meant that my ‘car telemetry script’ couldn’t find log file data. The author of Torque app has issued another update which makes log data accessable again. I have introduced a new automate script which provides more consistensy and guidance in setup, as people often get stuck on the same issue’s. This is version 13 of the script and is available in the automate community space. I’m also working on a version over Xmas which should allow a user to select the file location of the config file… Read more »
Hey, this is really cool, great job! Thank you so much for sharing. I am using it in my Android head unit and it works great, but found an issue in fork Parent_URI: after receiveing the BOOT_COMPLETED intent, it tries to read the value from config to determine whether Torque should be launched or not. At that momement, config file hasn’t been read yet, so Torque will not be launched even if set to true. So you might consider adding some delay before it (and hopefully config entries are loaded until that) or listen for some other intent you can… Read more »
Thanks for the feedback. I’ve been working on some updates. See below: The Torque app was updated recently which meant that my ‘car telemetry script’ couldn’t find log file data. The author of Torque app has issued another update which makes log data accessable again. I have introduced a new automate script which provides more consistensy and guidance in setup, as people often get stuck on the same issue’s. This is version 13 of the script and is available in the automate community space. I’m also working on a version over Xmas which should allow a user to select the… Read more »
Thanks for all your work on this! Still seeing the file here /storage/emulated/0/Documents/torqueLogs. Sounds like the next update will help.
New script uploaded today.
Apologies. I missed this message. Try the very latest version.
I’m curious – did you have any feedback from someone else using Nabu Casa? I do it out of support for development of Home Assistant and had migrated any external access needs through it. I’d prefer to not go direct just for this but I’ve been unsuccessful getting it to work unless I go direct.
I have not received any feedback I’m afraid. I don’t see why it should not work though. Perhaps you could experiment with some simple http posts first, to establish why nabu casa is rejecting your messages.
Thanks for all your work on this — incredible automation — Automate needs to give you some referral dollars as I bought the app just to see the complex flow in action! I’ll give this another go and see if I can tackle it.
👍
Had anybody had any success? I tried selecting both places and after 10 seconds it times out saying it cannot locate the file. I cant wait to show this and the idea I have to layer it over my arduino module controlled car and show my followers. You deserve more than just credit if I can get this working. No data shows on HAS yet but when it does I’m gonna be like a big kid.
Hi Rob, thank you for the great script, but I’m having an issue. I have my sensor and templates set up and data is being received to my MQTT broker but for some reason, the main sensor (GPS Time) is showing None on my dashboard and the template sensors are showing unknown and I have no idea how the debug this issue. Much appreciated any help!
In Torque app settings. Can you check that the option to provide GPS time in the log is enabled. You could also look directly in your log file to see if it is being added to each log line.
If the sensor cannot find a field in the mqtt payload called GPS time it will probably not load all the attributes.
I’ve been testing for a bit now and I just wanted to report that it’s working great! Thanks for all your work on this!
👍
Are you not experiencing the force close saying it cannot locate file? May I ask how you manage to get it to function?
Make sure you are using the latest script. If the script cannot see a file it will try again. The file must use the correct name.
Hello Robert, thank you very much four your script which makes a great and functional link between torque and HA 😉
Do you know if it is possible to push the automation by automatically launch Automate then Torque without any intervention just by starting car engine on?
My little improvements would be to avoid all the steps of validations and launches of apps 😉
This really depends on the hardware you are using. It is possible to set automate to start automatically and continue a script. It is also possible to launch torque from the script as my script does and then move it to the background. However problems arise if your Android device is restricting applications running in the background, which stops one of the apps working after a few minutes. You may find a launcher app that does this as well, but I have not found a reliable way to avoid android 10 or greater devices from dozing the apps.
Hi. Can’t connect to. Gives an error: Communication failure
In the logs writes:
08-02 17:59:37.970 I 7@1953: Failure catch
08-02 17:59:37.971 I 7@1790: HTTP request
08-02 17:59:38.070 F 7@1790: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
I tried to connect via http and https, same result.
I use the remote connect to my HA constantly so it’s not a problem with access.
Created the long token and putted it with “Bearer xxxxxx…”
I need a help with this please
Sounds like a certificate problem.
Probably not, but might you have the script for Tasker as well? I already use Tasker with several script so would prefer to have it in there.
Regarding your comment that you couldn’t find out how to prevent the apps from dozing above Android 10, but isn’t there an option in android to say that an app should never sleep and always allow background service?
Sorry. No tasker version. Sleepong problem might be to do with Joying head unit implmentatation of android code O think, so its a specifi problem to that device.
When I press ‘start’ and set it up, a 400 error occurs with the message “Check your security token” even though I entered it in the form of “Bear xxxxxxx…” in the box where token is entered. How do I solve this?
Pretty sure it should be ‘bearer’
Hi Robert,
That’s an amazing project, thank you for sharing this.
I purchased all the stuff, started to implement in HA, but I stuck at the configuration.yaml stage with the following errors:
– platform: mqtt
name: “Grande Punto”
state_topic: “devices/grande_punto/torque”
value_template: “{{ state_attr(‘sensor.grande_punto’, ‘GPS Time’) }}”
json_attributes_topic: “devices/grande_punto/torque”
Any idea what should I correct?
Thanks.
My sensors look like this:
– name: “Quashqai Automate”
state_topic: “devices/quashqai”
value_template: “{{ value_json.time}}”
json_attributes_topic: “devices/quashqai”
– name: “Quashqai Torque”
state_topic: “devices/quashqai/torque”
value_template: “{{ state_attr(‘sensor.quashqai_torque’, ‘GPS Time’) }}”
json_attributes_topic: “devices/quashqai/torque”
Also, home assistant syntax has changed. Use the below at the beginning of your sensor.
mqtt:
sensor:
Thanks. In the meantime with the help of google I managed to correct that original syntax to the same you just wrote.
I also have the Automate sensor, that works just fine.
My new problem however is with the torque sensor as that is only what I see in the sensor attributes. What could be the problem? Any idea?
Also, that’s all what I receive via MQTT:
Not sure, where the other details are? I see all I selected in the trackLog.csv file.
Try ammending sensor to:
value_template: “{{ value_json.time}}”
or
value_template: “{{ value_json.gps time}}”
I think the problem is more like that the data is not coming through mqtt. 🙄
Did you manage to resolve this? I get the same in my mqtt server. I saw the test message, and now just empty data.
I can’t believe there is still no way to use this script on iPhones. Not even a mention of it on the interwebs 😔
🙁
😭
Hi Robert, Few questions if you will: Automate seems to basically want full access to my android tablet. Is this normal ? How much access does your script need ? Does the trackLog.csv get overwritten by Torque every time (since we set to not rotate) and it is up to us to store it in HA for longer archival ? How do you manage storage in HA, does this not fill up HA very quickly ? Does a OBD dongle (i have the the OBDlink MX+ 13264) only update the ECU sensors? Is ECU what is coming from the car… Read more »
In addition:
If i add more pid’s later in torque, will the attributes automatically update (e.g. more attributes?) Is the sensor.automate for occupants similar to the one for torque? I believe it asked for head unit data and owl tracks, not sure which one i need to say yes to to get the occupants ? As i leave my tablet in the car, it actually keeps pairing to the ODB dongle, meaning it never goes to sleep and will drain the battery. I created a quick script in automate for this, that when the cigarette lighter port does not give a charge… Read more »
Hi Robert Thank you very much for your great work in this. I have tried to set it up this weke me but am running into an issue. I believe that the Automate script is looking for trackLog.csv, however Torque now appears to call this file trackTorqueLog.csv. Im assuming I’d need to update every reference to this file in the Automate Blocks as it does not appear to be a variable, but I can’t find a “Find & Replace” function in Automate and looking in each Block on a phone is very difficult. Do you have any advice for this… Read more »
The log file path is stored when you go through the initial config. It doesn’t appear to have changed on my unit. Rerun the script and make sure you choose the right directory for your logfile
Hello and congratulations for the work done, I completely followed and redone the procedure but unfortunately in mqtt explorer I receive the empty torque {} message, I don’t know where I’m wrong but the script from the automate log starts right at least that’s how it seems but I only receive an empty message .. can you tell me where I’m wrong?