How to make default Torque integration work in Home Assistant

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?

1 Like

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:

5 Likes

How do i install that integration?

1 Like
  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!

1 Like

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?

a) most email senders don’t remove the plus. technically they could, but they don’t.

b) I don’t really care. I use the + when I feel it’s appropriate. it’s easy and free.

c) there are other uses for it. like if I want multiple accounts with the same service provider. or as in the case of this Torque integration I’d like to have different identifiers that resolve to the same email account.

1 Like

did anyone set this integration up with a local ip adress, like @ugfus1630 mentioned?
my setup would be that i activate a wireguard VPN when i enter my car and the data should be transmitted to the local ip of homeassistant.

at the moment, i see only “waiting to upload” like @appsgt69, but data is not yet sent to homeassistant. app is setup like in the tutorial at the beginning of this thread.

Any help would be appreciated.

Hello
my HA is installed on Docker and my ip addres is 192.168.1.250
but I am getting 192.168.1.1

2024-06-12 22:36:55.199 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 192.168.1.1 (192.168.1.1). Requested URL: ‘/api/[email protected]&v=9&session=51718254161979&id=f268ce77e8a205a600d740c83031ec2d&time=1718257022461&kff1005=-118.27152637&kff1006=34.15093709&kff1001=0.0&kff1007=0.0’. (Dalvik/2.1.0 (Linux; U; Android 14; SM-S928U Build/UP1A.231005.007))

thank you