How to make default Torque integration work in Home Assistant

For the App you need to go in “Adapter Status” in the main menu and then on the bottom you’ll find it.

For the URL in my case HA is behind NAT so it’s a must to use the https://@HOST:PORT/api/torque (your “@/HOST” it’s a typo I guess")

Thanks

1 Like

Sorry, I better read the integration doc, you’re right if you use the port the format shall be “https://@/HOST:PORT/api/torque”. I’ll have a try in next days and feedback.

Hi,
Just to say - Thank You!

This integration works relatively straightforward for me following the manual.
I use OBDII WiFi and it is OK.

See below some notes that could help you:
I tried torque lite and it didn’t work for me, I think set bearer token was missing or unavailable or just didn’t work for me. Torque pro is ok.
I failed with old phone with android 6. When connect to WiFi it drops the mobile data.
with android 13 there is no problem. wifi is connected to OBDII and the phone keep the 4G data live.(android 13 no extra settings required)
to connect to home assistant I use Nabu Casa.
Thanks again!

At the end I tested yesterday with the correct fomat for HTTPS and it worked!

Many thanks to all

Hi,

any idea on local network? I have no cloud access for my HA. I set the server addr as “https://192.168.1.7/api/torque” and when I close the torque app it is trying to upload the logs, showing “Uploading logs, Still uploading - 21 log entries left…” but nothing happen.

Also tried @192.168.1.7/api/torque, @/, and 8123 port etc… many variations, but not working. I followed the tutorial regarding the rest of point, so added the config to yaml, create and set the token etc…

The way I want to use that I am driving a car with running torque app and when I arrive home, my phone connects to local wifi and upload the log when I close the app (as it is trying now, but not working). Or maybe over tailscale network to loging online, but it is also 192.168… so local address.

Any idea how to do that?

Sorry for the late and a bit off topic reply.
I had a similar problem with my mi band 4, that feeds info to home assistant but when it’s not online the sensors disappear.
For that I’ve created an helper (specifically an input number) so I’m using that combined with an automation that sets that helper to the state of sensor if it changes. This basically gives me the last known value of that sensor, so that i can use that to display it in the UI or even make automation. This also preserves the history of the sensor a lot better. Now that you’ve reminded me I could try to get back on torque and try on that too.

I found this gem that allows Torque readings to survive HA reboots:

4 Likes

How do i install that integration?

  1. Disable the official integration

  2. Copy only the folder torque_logger from the Github project into the folder custom_components in your home assistant:
    homeassistant-torque/custom_components at main · junalmeida/homeassistant-torque · GitHub

  3. All configuration is the same as the official integration EXCEPT the API URL we put into Torque app (item 10 in OP’s tutorial):
    https://your-homeassistant.ui.nabu.casa/api/torque_logger

[edit] fixed instructions per Rafael Lascano feedback, thanks mate!

Excelente, i´l try it. Do i have to uninstall the official integration or just disable it?

Sorry, I think we don’t need to disable the official integration as it is simply a sensor on configuration.yaml and I’m seeing that I have it in place on my HA.
So it’d be just steps 2 and 3 I listed above

Just to add to the discussion, I followed all the instructions and it just didn’t work.

The problem turned out to be that I used a “+” (eg xyz+torque.at.gmail.com) in my email address. Torque was not url encoding the “+” so the email address was arriving at home assistant as xyz<space>torque.at.gmail.com.

The “email address” is just a unique (ish) identifier string that needs to be configured the same in the Torque app as in the HA configuration, it doesn’t need to be a valid email address so I just changed the “+” to an “_” (eg xyz_torque.at.gmail.com) and it all works perfectly.

I suspect many people who are having problems are having them for this reason.

This is a bug in the Torque app.

Also, Torque sends the updates using http GET requests which is a bad idea, so nil points to them for that.

oh, and the HA website won’t let me enter anything that looks like an email address hence the .at.gmail.com

Who uses a + in an email address? That’s like having a blank space or a comma in a password. Allowed? Sure, but you are setting yourself up for trouble.

I think that Torque uses whatever schema (HTTP or HTTPS) you set in the web server upload URL.

Where in HA you can’t enter the email address? That goes in configuration.yaml where you can add anything.

Excellente.

Just one aditional question: on step 3) yo said all configuration is the same as the official integration EXCEPT the API URL we put into Torque app (item 10 in OP’s tutorial): *https://your-homeassistant.ui.nabu.casa/app/torque_logger**.

Is there a chance that the correct url is with “api” instead of “app”?. I mean like this:
https://your-homeassistant.ui.nabu.casa/api/torque_logger*

Whoopsie, my bad!

That’s exactly the url <nabu>/api/torque_logger

Excellent!! Working just great. Thanks a lot!

1 Like

lots of people because the + causes the rest of the email address to be ignored by email servers.

so anyone who wants to track who sold their email address to 3rd parties for example provides their email address as <real_email>+<some_identifier>@emaildomain.com

this is very, very commonly used.

Interesting, I didn’t know that. Although they say that the trick is well known and many services automatically strip out the “plused” section.

it’s the fact that most (all?) services strip out the plused section is what makes this useful. with gmail/hotmail it means I can provide a different email address (or at least a different string used as an email address) to every organisation that I deal with.

then I can track who is selling my email address.

But if the spam service removes the identifier how can you tell who sold your email?