How to make default Torque integration work in Home Assistant

I did some debugging and sound like torque is not calling https endpoints for some reason, HTTP works, I wrote a server app to just dump everything in terminal but saw nothing from torque on https

Anyone having problems adding multiple vehicles to Home Assistant using the Torque app? I seemingly can get either my wifeā€™s vehicle or my truck working but never at the same time?

I think it might be a home assistant issue as if I setup the emails to be the same it pulls in the data from both vehicles as if it were one vehicle, even with different bearer tokens and vehicle namesā€¦ If I set different emails it will only pull in one of themā€¦

Thank you so much for the guide, finally someone that explains it simply and it works right away. I looked into solutions that used tasker but seemed too much of a hustle for something that is already supported by torque itself.
I followed everything and made a couple of sensors to test if logging was working and it was connected do HA, and it works! Now I just need to plug it in the car and see data coming in :slight_smile:

Connected everything and it works! I was just wondering, does torque need to be awake in the background for the sensors to be visibile in home assistant? I experienced an issue where i would get sensor data, but then closing torque makes the sensor disapper entirely form HA (theyā€™re not even hidden).
Another issue/question, how can we make a dual car setup work? I know thereā€™s profiles in the app, but Iā€™m perfectly fine with setting up my phone and another one for the other car, but the sensors in home assistant? Will they be two separate set of sensors or will it try to merge everthing in the same sensor? Has anyone tried it yet?
If thatā€™s the case I think my only chance left is to go the tasker route thenā€¦but Iā€™m really too lazy to do it haha

There are three main scenarios for using Torque with Home Assistant. The solution mentioned here works well for the first two scenarios. However, for the third scenario, it is probably better to explore alternative solutions. (Assuming that you want to use it with one Home Assistant instance, which I believe is what most users want. Because the method above creates sensors with names beginning with ā€œsensor.vehicle_ā€¦ā€ no matter how many adapters/cars and phones you use, these names cannot be modified, so they basically mix with each other.)

  • Scenario 1: One driver (one phone) for one car

    • The above method is ideal for this scenario.
  • Scenario 2: Multiple drivers (one spare old phone replacing each driverā€™s main phone) for one car

    • The above method is good for this scenario, provided you use an old phone that remains in the car at all times (as described in more detail in one of my previous posts here).
  • Scenario 3: Multiple cars and one or multiple drivers and phones

    • In this case, a alternative method is likely more suitable. Consider using a solution like the one provided in this link. This alternative solution is more flexible as it creates unique sensors for each car and, if necessary, for each phone. However, please note that it requires a more complex setup compared to this official solution.

Iā€™m probably stupidā€¦ But which app in the play store is the right one? Thereā€™s many results if you search for torque

The tutorial was made using Torque Pro version of the app, but I think it should work with Torque Light version as well.

My problem was how to open the torque automaticly. Then I found an ā€œautomateā€ app script to do that. But that wasnā€™t battery friendly and eventually I didnā€™t use it any more.
Any solution? Basically I want to go into the car and donā€™t touch the phone. And things happen in the background automatically.

Torque can run continuously in the background, even starting automatically after your phone restarts. To enable this feature, go to Settings > Dash installation settings > Start Torque on reboot in the Torque app. Additionally, remember to disable ā€˜Battery optimizationā€™ for the Torque app. By following these steps, Torque will connect via Bluetooth to your OBDII adapter seamlessly in the background, eliminating the need to manually interact with your phone.

With only torque app and Ha, I get no unique ID so when I restart the HA I loose all the data of these sensor.No real way to get unique id only with torque app?

1 Like

Same problem for me here, do you already have a solution?

Would it be possible to add the sensors with their current names to config.yaml? so that they doesnā€™t disappear? then there is also a way to give the sensors a unique ID and a state class so that they are also stored in the recorder.

Or is there a easy way?

yeah seems kind of dumb that a reboot wipes all your sensors

When Bluetooth connects to OBD

template.yaml

  - sensor: 
    - name: "In the Car"
      unique_id:inthecar
      state: >
        {% if "13:E0:2F:8D:4B:A5 (Android-Vlink)" in state_attr('sensor.sm_xxx_bluetooth_connection', 'connected_paired_devices') %}
          on
        {% else %}
          off
        {% endif %}

Autostart ā€œTorqueā€ on phone (android)

service: notify.mobile_app_sm_xxx
data:
  message: command_launch_app
  data:
    package_name: org.prowl.torque
2 Likes

If this is in answer to my question, then I think my question was wrong.
Starting the torque app on the phone all works fine.
When I restart Home Assistant, all torque sensors are gone. in home assistant. As soon as I use the torque app again, they come back.

1 Like

Here as well. Any updates on this issue?

I got it working after some wiggling. Note that if you donā€™t use the default port, the URL must be in the format shown in the integration docs, including the @: https://@/HOST:PORT/api/torque. Iā€™m using HTTPS and set a bearer token.

If Torque canā€™t talk to HA, it will get stuck attempting to upload the logged data points when you try to exit out of the app (by tapping Back repeatedly).

In my case HA shows the created entities with names starting with what I set for the name: optional integration parameter in configuration.yaml.

Hi Neovision,
very well don tutorial, I have few confirmation to ask if possible:

  1. As far as I understood it seems mandatory to setup the connection between Torque and HA in https right? If you donā€™t input ā€œhttps://ā€¦ā€ in the Web Server URL the Bearer option stays greyed out isnā€™t it?
  2. Currently I use duckDNS but in http, so no way to integrate torque right?
  3. Do you have any suggestion on how to setup enable https with duckDNS?

Thanks in advance

  1. No, you can also use HTTP. The integration docs give you the minimum config needed for this.
  2. As per 1.
  3. Home Assistant Add-on: DuckDNS

Hi odwide,
thanks for your feedback, in the meanwhile I investigated and I update my remote access to work in HTTPS, I generate the long lasting token and I tested it via curl command:

curl -X GET https://mydomain.duckdns.org:443/api/torque  -H 'Authorization: Bearer <token>

and I get a message 500 server error but it means Iā€™m reaching the target. Then if I do the same with a wrong token I correctly receive 401 Unauth so the connection works. But unlikely the same configuration on Torque is not running fine, I donā€™t see, inside the app, the messages sent to the Web URL (see below image).

Any suggestion?

Thanks in advance

Where can I find that Web Upload Status section? I donā€™t see it in my app.

Check the Webserver URL in Torque and try with both formats: https://HOST/api/torque and https://@/HOST:PORT/api/torque