I understand your situation and have faced a similar problem before. I found a solution that may work for you: I used an old phone with Torque installed and kept it in my car at all times. I ensured that no other phone was set up to connect to the OBDII. The phone was plugged into a charger and never fully discharged as there was never enough time between rides.
Additionally, the phone could connect to Wifi at home, or you could use your main phone as a hotspot for it.
While you could install this system on multiple devices, such as your family members’ phones, note that Home Assistant may recognize them as sensors from separate vehicles, which may not be ideal.
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
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.
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?
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.
- 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 %}
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.
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:
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?
Currently I use duckDNS but in http, so no way to integrate torque right?
Do you have any suggestion on how to setup enable https with 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).