Integración domótica Teslemetry, gratuita y de código abierto

Coches Tesla y Powerwall con Teslemetry: carga, climatización, cierres, solar, flujos de energía.
La documentación de esta integración la escribe su autor y, por ahora, solo está disponible en inglés.
Follow and control your Tesla cars, your Powerwall and your solar panels from Gladys through Teslemetry: battery, range, charging, climate, locks, Sentry Mode, and the energy flows of your home in real time.
Developed without the hardware: feedback welcome. This integration was built without a car, a Powerwall or a Teslemetry account, and tested on sample API answers adapted from the Home Assistant Teslemetry integration's tests and the Tesla Fleet API documentation. If something looks wrong, please say so on the Gladys forum.
This integration is not affiliated with Tesla, Inc. or Teslemetry.
It is named after the service it goes through. Other ways to reach a Tesla (Tessie, TeslaMate, the Fleet API directly…) may get their own integration.
Wall Connector: now its own integration
Version 1.1.0 of this integration (then called "Tesla") also read the Tesla Wall Connector on the home network. The charger now has its own integration, Tesla Wall Connector, which needs no Teslemetry at all. If you had set one up:
- Install Tesla Wall Connector from the Gladys store and enter the charger's address in its Configuration tab.
- Your charger device, its history and the dashboards that show it are kept: the new integration uses the same device identifiers.
- Scenes that used the Wall Connector triggers, and the Tesla Wall Connector widget, must be set up again with the new integration.
Until then, this integration shows a reminder in its connection status and logs, and leaves the charger alone.
How it connects
Tesla's official API (the Fleet API) is meant for developers: each user would have to register a developer application, host a public key on a web domain and sign every command. Teslemetry does all of that for you and gives you a single access token. It is a paid service with a subscription per vehicle and per energy site (see teslemetry.com/pricing), with a monthly allowance of command credits included.
Reading data never wakes your car. A sleeping car keeps its last known values in Gladys; only a command you send (start charging, climate, lock…) wakes it up.
What you need
- Gladys 5.1 or later.
- A Teslemetry account linked to your Tesla account, with a subscription for each car and energy site you want in Gladys.
- For commands: the Teslemetry virtual key added to each car (Teslemetry guides you through it, it takes a minute from the Tesla app).
- For real-time car data: Fleet Telemetry streaming, which recent cars support (it needs a recent software version; pre-2021 Model S and Model X do not stream). Cars without streaming still work, from Teslemetry's cached data.
Setup
- In the Teslemetry console, create an access token with access to your vehicles and energy sites. Copy it.
- In Gladys, open the Configuration tab of the Teslemetry integration, paste the token in Teslemetry access token, check the other settings, save.
- Open the Discovery tab: each car and each energy site is listed. Add the ones you want.
- Optional: click Test the connection to see what Teslemetry gives access to, and whether the real-time stream is connected.
The integration also turns on, in Teslemetry, the streaming of the few car values it reads (battery, range, charging, climate, locks, Sentry Mode, odometer, display units). It only adds fields, it never removes yours.
Settings
| Setting | What it does |
|---|---|
| Units | Units of distances and temperatures as stored and compared by scenes: the car's own display setting (default), miles and °F, or kilometers and °C. The dashboard always shows each user's preferred units, whatever you pick. |
| Device names language | English, French, German or Spanish names for the features of new devices. Gladys keeps a feature's name once the device is created. |
| Backup refresh of the cars | How often an awake car that streams nothing is read (30 or 60 minutes, or never). Never while the car sleeps. |
| Send the home consumption to the energy dashboard | Off by default. Adds the home consumption index to Powerwall sites (see below). |
Changing Units on a car you already added: the Discovery tab offers an Update for it. Until you accept, the car keeps being published in its former units, so nothing gets mixed up.
Your cars
| Feature | Details |
|---|---|
| Battery level | % |
| Range | Rated range, in miles or km |
| Charging state | Charging, connected, paused by the car, paused by the charger (no power), idle |
| Charging power | kW, AC or DC (Supercharger) |
| Charge limit | 50 to 100 %, adjustable |
| Charging | Start / stop charging |
| Charging current | Amps requested from the charger, adjustable (handy to charge on solar surplus) |
| Plugged in | Yes / no |
| Climate | On / off |
| Climate set temperature | Adjustable, 59–82 °F (15–28 °C) |
| Inside / outside temperature | °F or °C |
| Locked | Lock / unlock |
| Sentry Mode | On / off |
| Odometer | Miles or km |
| Online (awake) | On when the car is awake, off while it sleeps or is out of coverage |
The car's location is never read by this version of the integration.
Your Powerwall and solar panels
Each energy site gets the features of what it has: a solar-only site has no battery features, a Powerwall without panels no solar ones.
| Feature | Details |
|---|---|
| Solar production | W |
| Home consumption | W, as measured by the gateway |
| Grid (import +, export −) | W, signed: positive when you draw from the grid, negative when you send power to it |
| Battery charging / discharging | W, two features (both positive) |
| Powerwall charge | % |
| Grid connected | Off during an outage (the house runs on the Powerwall) |
| Operation mode | Self-Powered or Time-Based Control, adjustable |
| Energy indexes | Cumulative kWh: solar production, grid import and export, battery (home: see below) |
Backup-only is not offered: Tesla withdrew it on many sites. A site set to it from the Tesla app shows "Backup-only" in the energy widget.
The home consumption index is off by default: turn on Send the home consumption to the energy dashboard in the settings, then accept the Update of the site in the Discovery tab. Gladys then computes the consumption per half hour and its cost from it, with your energy contract. Gladys attaches it to the main electric meter you set in the energy settings: if your utility meter is already in Gladys, the Powerwall measures the same house, so leave the option off rather than counting the house twice. The index keeps counting while the option is off, so turning it on later does not start from zero. The indexes start counting when the integration is installed: Tesla does not give lifetime totals, they are built from the daily totals Teslemetry streams.
Dashboard
Two widgets (Gladys 5.1+), each set up with the device it shows:
- Tesla vehicle: battery, range, charging power and cabin temperature in real time, the charging, climate, locks, Sentry Mode and online status, and buttons to start or stop the climate, start or stop charging (when the car is plugged in), lock or unlock (unlocking asks for a confirmation).
- Tesla energy flow: solar, home, grid and Powerwall in real time, the last 24 hours as a chart, the grid status, operation mode, backup reserve and Storm Watch.
Scenes
Triggers (each one optionally limited to one car or one energy site):
- Tesla started charging, Tesla charging complete, Tesla plugged in, Tesla unplugged — with the battery level.
- Grid outage (Powerwall) and Grid restored (Powerwall) — with the Powerwall charge, and whether the outage is an intentional "go off-grid".
Action:
- Set the Powerwall backup reserve — for example 100 % when a storm is announced, back to 20 % after.
Every car feature above can also be used in scenes the usual way ("when the battery is below 30 %", "start the climate at 7:30", "set the charge limit to 90 %"…).
Data freshness and Teslemetry costs
What follows are Teslemetry's published rules (2026). They could not be
measured on a real account during development: to see your own costs, the
integration writes a line in its logs for every billed call, with your
remaining balance (Teslemetry credits: … cost 1, balance 498), and Test the
connection shows the balance.
| What | When | Cost |
|---|---|---|
| Real-time stream (cars, Powerwall, daily energy totals) | Continuously, one connection for the whole account | Included in the subscriptions, no credit |
| Car read at startup | Once per car when the integration starts | Free from Teslemetry's cache; up to 2 credits if the car is awake and its cache older than about 20 minutes |
| Backup car read | An awake car that streamed nothing for the chosen delay (30 min default) | Same as above. Never for a sleeping car, and never for a car that streams |
| Vehicle list, Powerwall status | Every 15 / 10 minutes, only while the stream is down | Expected free (read calls, unverified) |
| Command (charge, climate, lock, charge limit, reserve…) | When you ask | 1 credit; if the car sleeps, it is woken first (about 20 more credits) |
In practice, with a streaming car, the integration's own cost is the commands you send. Teslemetry's monthly allowance is 500 credits per vehicle and per energy site: about 500 commands to an awake car, or about 24 to a sleeping one. Gladys acknowledges a command after 4 seconds even if the car is still waking up; the command goes on and its result shows when the car answers.
Limitations
- Developed without a car, a Powerwall or a Teslemetry account (see above).
- No location, no navigation, no trunk, windows or seat heaters in this version.
- Gladys has no signed battery power: the Powerwall power is split into "charging" and "discharging". The backup reserve has no device feature either: it is shown in the energy widget and set with the scene action.
- Older cars without Fleet Telemetry are refreshed from Teslemetry's cache only (every 30 or 60 minutes while awake).
- Feature names are set when the device is created and do not follow later language changes.
Troubleshooting
- "Teslemetry refused the access token": the token was mistyped, revoked or expired. Create a new one in the Teslemetry console.
- "A subscription is required": the car or site has no active Teslemetry subscription.
- A command fails with "vehicle unavailable": the car is out of coverage, or the virtual key is not installed on it.
- Car values only change every 30 minutes: the car does not stream. Check that streaming is on for it in the Teslemetry console and that its software is up to date.
- The integration logs everything it does: open its logs from the Gladys UI,
with
LOG_LEVEL=debugfor the full detail. Tokens are never logged.
Parámetros de configuración
Estos son los parámetros que Teslemetry te pide en su pantalla de configuración en Gladys.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| Antes de empezar | section | No | Esta integración accede a su cuenta de Tesla a través de Teslemetry, un servicio de pago que retransmite la API Fleet oficial de Tesla (no necesita una cuenta de desarrollador de Tesla). Cree una cuenta de Teslemetry, vincule su cuenta de Tesla, añada la llave virtual a su coche y, a continuación, cree un token de acceso en la consola de Teslemetry y péguelo a continuación. La lectura de datos nunca despierta el coche; un comando enviado a un coche dormido lo despierta. |
| Token de acceso de Teslemetry | secret | Sí | Creado en la consola de Teslemetry, con acceso a sus vehículos y sitios de energía. |
| Unidades | select | No | Unidades de los valores del vehículo (distancias, temperaturas), tal como las comparan las escenas. El panel siempre convierte según la preferencia de cada usuario. |
| Idioma de los nombres de dispositivos | select | No | Idioma de los nombres de funcionalidades de los nuevos dispositivos (Gladys conserva un nombre una vez creado el dispositivo). |
| Lectura de respaldo de los coches | select | No | Los coches se siguen en tiempo real mediante el flujo de Teslemetry. Cuando un coche despierto no envía nada (modelos antiguos, flujo desactivado), sus datos se leen con esta frecuencia. Nunca mientras duerme. |
| Enviar el consumo de la casa al panel de energía | boolean | No | Añade un índice de consumo de la casa (kWh) a cada sitio Powerwall, a partir del cual Gladys calcula el consumo y el coste. Gladys lo asocia a su contador eléctrico principal: déjelo desactivado si su contador ya está en Gladys, o la casa se contará dos veces. |
Cómo instalar Teslemetry en Gladys
- En Gladys, abre Integraciones: Teslemetry aparece en el catálogo junto a las integraciones nativas, con una insignia de comunidad.
- Haz clic en Instalar. Gladys descarga la imagen Docker (
ghcr.io/guim31/gladys-tesla:1.3.0), la ejecuta en un entorno aislado del núcleo y genera la interfaz de la integración (dispositivos, descubrimiento y configuración). - Abre la pantalla de Configuración de la integración, rellena los parámetros y guarda.
- También puedes instalarla directamente desde la URL de su repositorio: https://github.com/guim31/gladys-tesla.
Teslemetry requiere Gladys >=5.1.0. El catálogo de Gladys se actualiza cada hora, así que una nueva versión está disponible como máximo una hora después de publicarse.
¿Todavía no usas Gladys? Es gratuito y de código abierto: sigue la guía de instalación para empezar.
Sobre las integraciones externas
Teslemetry es una integración externa: una integración comunitaria empaquetada como contenedor Docker y publicada en GitHub. Gladys la instala con un clic y la ejecuta en un entorno aislado del núcleo. La publica y mantiene guim31, no el equipo principal de Gladys.
- Explorar todas las integraciones externas
- Descubrir las integraciones nativas incluidas en Gladys
- Crear y publicar tu propia integración externa
- Código fuente en GitHub — fuente de esta documentación