Skip to main content

Torque Pro smart home integration, free and open source

Torque Pro integration for Gladys Assistant

Your car's OBD2 data from the Torque Pro app in Gladys: trips, fuel, battery, arrival home.

Torque Pro is an Android app that reads your car through a Bluetooth or Wi-Fi OBD2 adapter plugged under the dashboard. It can upload what it reads to a web server while you drive: this integration makes Gladys that server. Each phone running Torque becomes a car in Gladys, with its speed, engine, fuel and battery, its distance from home and whether it is driving; scenes start when a trip starts or ends, when the car arrives home, or when its battery is low.

Developed without the hardware: feedback welcome. No car was used: the tests replay uploads in the exact format of Torque Pro, against the Docker image of the integration, not yet on a real Gladys instance. Tell us how it works with your car on the issues.

What you need​

  • Gladys Assistant 5.2.0 or later.
  • An Android phone with Torque Pro (the paid version: Torque Lite cannot upload) and an OBD2 adapter that works with it.
  • To receive data on the road, away from home: Gladys Plus (the uploads go through its webhook relay). Without it, the phone reaches Gladys only on your home network (or through your own VPN or reverse proxy).

Getting started​

1. Install the integration​

In Gladys, Integrations → Install from GitHub, address https://github.com/guim31/gladys-torque. The integration starts two containers: the integration itself and a small receiver that answers Torque on a port chosen by Gladys. The configuration screen shows the address to use, in the "Connect Torque Pro" section.

2. Choose a token​

In the configuration, enter a secret token of at least 8 characters (letters, digits, - or _). Every upload without it is refused.

3. Set up Torque Pro​

In Torque Pro, open Settings → Data Logging & Upload (names can differ a little between versions):

  1. Select what to log: tick the values you want in Gladys (speed, engine RPM, coolant temperature, fuel level, engine load, control module voltage, GPS latitude and longitude, trip distance, fuel used, trip average litres per 100 km).
  2. Upload to webserver: tick it.
  3. Webserver URL:
    • at home, on the same network as Gladys: http://<Gladys address>:<port>/<token>, as shown by the configuration screen, followed by your token;
    • from anywhere, with Gladys Plus: paste the Open API key of Gladys Plus in the "Gladys Plus webhooks" block at the bottom of the configuration screen, then copy the URL it shows. No token is needed: this URL contains your Open API key, keep it secret.
  4. Web logging interval: 5 seconds or more is plenty (Gladys keeps one value every 15 seconds); with Gladys Plus, prefer 10 seconds or more.
  5. User email address: optional, see "Accepted Torque e-mails" below.

Torque only uploads while it logs: tick Automatically start logging (or start it from the menu) so a trip is recorded as soon as the adapter connects.

4. Add the car​

Drive (or just start the engine with Torque connected): the car appears in the Discovery tab of the integration, named after the vehicle profile of Torque. Add it to Gladys. A phone is one car: the car is the one the phone travels in.

Configuration​

  • Secret token: required for the uploads received on your home network.
  • Accepted Torque e-mails: empty, every upload with the right token is accepted; otherwise only those whose "User email address" in Torque is in the list (separated by commas).
  • Gladys house: the house whose location gives the distance from home (the first located house when empty).
  • Home radius: a car closer than this to the house is at home (150 m by default).
  • End of trip after: minutes without any upload before a trip is over (3 by default).
  • Battery low below: the voltage of the "Car battery low" trigger.
  • Share coordinates with Gladys: off by default, the GPS position never leaves the integration (only the distance from home). On, the widget and the scene action get an OpenStreetMap link to the position.
  • Language of the names and texts: the language of the feature names (fixed when the car is added) and of the texts the integration writes.

The devices​

Each car has these features, filled by what Torque sends (a value your car or adapter does not provide stays empty):

FeatureUnitTorque value
Speedkm/hOBD speed, or GPS speed
Engine speed (rpm)rpmEngine RPM
Coolant temperature°CEngine coolant temperature
Fuel level%Fuel level (from the engine ECU)
Engine load%Engine load
Battery voltageVVoltage of the control module, or of the OBD adapter
Average consumption (L/100 km)L/100 kmTrip average (from L/100 km, km/L or MPG)
Fuel used on the tripLFuel used (trip)
Trip distancekmTrip distance
Distance from homekmFrom the GPS position (needs a located house)
At homeyes/noWithin the home radius (needs a located house)
Drivingyes/noTorque uploads; no after "End of trip after"
Last uploaddateTime of the last upload
Trip startdateStart of the current or last trip

Miles, mph, °F and miles per gallon are converted. Values are published every 15 seconds at most, only when they change; speed and RPM go back to 0 when the trip ends.

Forget the cars not added (action of the configuration screen) removes from the Discovery tab the cars you did not add.

Dashboard​

The Cars widget lists every car added to Gladys, with its status (driving, at home, parked), its last upload time and its fuel level. Tap a car for its battery voltage, coolant temperature, distance from home, trip and, if you share coordinates, a map link.

Scenes​

Triggers​

  • Car starts a trip: Torque starts sending again after a stop. Variables: car name, start time.
  • Car ends a trip: nothing received for the "End of trip after" delay. Variables: duration, trip distance, fuel used, average consumption (-1 when unknown).
  • Car arrives home: the car was away and is now within the home radius. Variables: car name, arrival time.
  • Car battery low: the voltage stays below the threshold of the configuration on two uploads in a row, while Torque is connected. Once per drop: it fires again only after the voltage went 0.3 V above the threshold.

Each trigger can be limited to one car. The features themselves (speed, fuel level…) can also start scenes with the usual "device value" trigger of Gladys.

Action​

Get the status of a car returns a sentence such as "Clio is parked, 12 km from home, fuel 40 %." for a message or a voice answer, and the values (driving, at home, distance, fuel level, battery voltage, last upload, map link if shared).

Scene ideas​

  • "Car arrives home" → turn on the outside lights after dark, open the garage notification.
  • "Car ends a trip" with the fuel level below 15 % → send a reminder to fill up.
  • "Car battery low" → a message: "Check the battery of the car".

Troubleshooting​

  • The configuration screen shows {{port:torque_http}}: the receiver has not started yet; reload the page after a few seconds.
  • No car in the Discovery tab: check the URL in Torque (with the token at the end), that "Upload to webserver" is ticked and that Torque is logging. Opening the URL in a browser of the phone answers "Not a Torque upload (no id)" when the address and token are right, "Unauthorized" when the token is wrong.
  • Nothing on the road: on mobile data the phone cannot reach your home network: use the Gladys Plus webhook URL.
  • A value stays empty: tick it in "Select what to log"; not every car provides every value (fuel level especially).
  • Logs: integration page, "Logs" tab (more detail with LOG_LEVEL=debug).

Limits​

  • One car per phone: a phone used in two cars shows them as one device (named after the last Torque profile).
  • The values are those Torque reads: an adapter or a car without a PID leaves the matching feature empty. Electric vehicles are not specifically handled.
  • On the road, data reach Gladys only through Gladys Plus (or your own VPN or reverse proxy); the Gladys Plus relay answers Torque in a few seconds at most.
  • Torque Pro is a third-party app; this integration is not affiliated with Torque or its developer.

Configuration settings​

These are the settings Torque Pro asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
Connect Torque ProsectionNoIn Torque Pro: Settings → Data Logging & Upload → Webserver URL. At home (same network as Gladys), enter http://{{gladys_host}}:{{port:torque_http}}/ followed by the token below. From anywhere, use the Gladys Plus webhook URL shown at the bottom of this screen instead (no token needed). Then tick "Upload to webserver".
Secret token (at least 8 characters)secretYes
Accepted Torque e-mails (optional)stringNo
Home and tripssectionNoA car is at home when its GPS position (sent by Torque) is within the radius below around your Gladys house. A trip ends when nothing has arrived for the delay below. The battery low trigger fires when the voltage stays below the threshold while Torque is connected.
Gladys house (optional)stringNo
Home radius (meters)numberNo
End of trip after (minutes without upload)numberNo
Battery low belowselectNo
Share coordinates with Gladys (map links)booleanNoOff: only the distance from home leaves the integration. On: the widget and the scene action get an OpenStreetMap link to the position.
Language of the names and textsselectNo

How to install Torque Pro in Gladys​

  1. In Gladys, open Integrations: Torque Pro appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/guim31/gladys-torque:1.0.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration).
  3. Open the Configuration screen of the integration, fill in the settings, and save.
  4. You can also install it directly from its repository URL: https://github.com/guim31/gladys-torque.

Torque Pro requires Gladys >=5.2.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.

Not running Gladys yet? It is free and open source: follow the installation guide to get started.

About external integrations​

Torque Pro is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by guim31, not by the Gladys core team.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂