Zum Hauptinhalt springen

Teslemetry Smart-Home-Integration, kostenlos und Open Source

Teslemetry-Integration für Gladys Assistant

Tesla-Autos und Powerwall über Teslemetry: Laden, Klima, Schlösser, Solar, Energieflüsse.

Info

Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.

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:

  1. Install Tesla Wall Connector from the Gladys store and enter the charger's address in its Configuration tab.
  2. Your charger device, its history and the dashboards that show it are kept: the new integration uses the same device identifiers.
  3. 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​

  1. In the Teslemetry console, create an access token with access to your vehicles and energy sites. Copy it.
  2. In Gladys, open the Configuration tab of the Teslemetry integration, paste the token in Teslemetry access token, check the other settings, save.
  3. Open the Discovery tab: each car and each energy site is listed. Add the ones you want.
  4. 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​

SettingWhat it does
UnitsUnits 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 languageEnglish, 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 carsHow 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 dashboardOff 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​

FeatureDetails
Battery level%
RangeRated range, in miles or km
Charging stateCharging, connected, paused by the car, paused by the charger (no power), idle
Charging powerkW, AC or DC (Supercharger)
Charge limit50 to 100 %, adjustable
ChargingStart / stop charging
Charging currentAmps requested from the charger, adjustable (handy to charge on solar surplus)
Plugged inYes / no
ClimateOn / off
Climate set temperatureAdjustable, 59–82 °F (15–28 °C)
Inside / outside temperature°F or °C
LockedLock / unlock
Sentry ModeOn / off
OdometerMiles 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.

FeatureDetails
Solar productionW
Home consumptionW, 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 / dischargingW, two features (both positive)
Powerwall charge%
Grid connectedOff during an outage (the house runs on the Powerwall)
Operation modeSelf-Powered or Time-Based Control, adjustable
Energy indexesCumulative 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.

WhatWhenCost
Real-time stream (cars, Powerwall, daily energy totals)Continuously, one connection for the whole accountIncluded in the subscriptions, no credit
Car read at startupOnce per car when the integration startsFree from Teslemetry's cache; up to 2 credits if the car is awake and its cache older than about 20 minutes
Backup car readAn 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 statusEvery 15 / 10 minutes, only while the stream is downExpected free (read calls, unverified)
Command (charge, climate, lock, charge limit, reserve…)When you ask1 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=debug for the full detail. Tokens are never logged.

Konfigurationseinstellungen​

Diese Einstellungen fragt Teslemetry in seinem Konfigurationsbildschirm in Gladys ab.

EinstellungTypPflichtfeldBeschreibung
Bevor du loslegstsectionNeinDiese Integration greift über Teslemetry auf dein Tesla-Konto zu, einen kostenpflichtigen Dienst, der die offizielle Tesla Fleet API weiterleitet (kein Tesla-Entwicklerkonto nötig). Erstelle ein Teslemetry-Konto, verknüpfe dein Tesla-Konto, füge deinem Auto den virtuellen Schlüssel hinzu, erstelle dann in der Teslemetry-Konsole ein Zugriffstoken und füge es unten ein. Das Lesen der Daten weckt dein Auto nie; ein Befehl an ein schlafendes Auto weckt es.
Teslemetry-ZugriffstokensecretJaIn der Teslemetry-Konsole erstellt, mit Zugriff auf deine Fahrzeuge und Energiestandorte.
EinheitenselectNeinEinheiten der Fahrzeugwerte (Entfernungen, Temperaturen), so wie Szenen sie vergleichen. Das Dashboard rechnet immer in die Einstellung jedes Benutzers um.
Sprache der GerätenamenselectNeinSprache der Funktionsnamen neuer Geräte (Gladys behält einen Namen, sobald das Gerät erstellt ist).
Ersatzabfrage der AutosselectNeinDie Autos werden in Echtzeit über den Teslemetry-Stream verfolgt. Wenn ein waches Auto nichts sendet (ältere Modelle, Streaming aus), werden seine Daten in diesem Takt gelesen. Nie, während es schläft.
Hausverbrauch an das Energie-Dashboard sendenbooleanNeinFügt jedem Powerwall-Standort einen Verbrauchszähler des Hauses (kWh) hinzu, aus dem Gladys Verbrauch und Kosten berechnet. Gladys ordnet ihn deinem Hauptstromzähler zu: Lass es ausgeschaltet, wenn dein Stromzähler schon in Gladys ist, sonst wird das Haus doppelt gezählt.

So installierst du Teslemetry in Gladys​

  1. Öffne in Gladys Integrationen: Teslemetry erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
  2. Klicke auf Installieren. Gladys lädt das Docker-Image (ghcr.io/guim31/gladys-tesla:1.3.0) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration).
  3. Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
  4. Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/guim31/gladys-tesla.

Teslemetry benötigt Gladys >=5.1.0. Der Katalog in Gladys wird stündlich aktualisiert, eine neue Version ist also spätestens eine Stunde nach ihrer Veröffentlichung verfügbar.

Du nutzt Gladys noch nicht? Es ist kostenlos und Open Source: folge der Installationsanleitung, um loszulegen.

Über externe Integrationen​

Teslemetry ist eine externe Integration: eine Community-Integration, die als Docker-Container verpackt und auf GitHub veröffentlicht wird. Gladys installiert sie mit einem Klick und führt sie in einer vom Kern isolierten Sandbox aus. Sie wird von guim31 veröffentlicht und gepflegt, nicht vom Gladys-Kernteam.

Abonniere den Newsletter von Gladys Assistant

Ein paar E-Mails im Monat zu neuen Releases und Neuigkeiten aus dem Projekt. Verschickt von Pierre-Gilles Leymarie, dem Gründer des Projekts. Jederzeit abbestellbar 🙂