Strava Smart-Home-Integration, kostenlos und Open Source

Your Strava activities and stats in Gladys: sensors, scene triggers and dashboard widgets.
Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.
Bring your Strava activities into Gladys: sensors with your latest activity and your weekly, monthly and yearly distances, scene triggers when you finish an activity or beat a personal record, and two dashboard widgets.
Requires Gladys 5.1 or later and a Strava account (a free account is enough).
1. Create your Strava API application
Strava gives each user their own API application: the integration uses yours, so your data only travels between Strava and your Gladys.
- Sign in on strava.com and open Settings → My API Application.
- Fill in the form:
- Application Name: for example
Gladys; - Category:
Other; - Website: the address of your Gladys, or
https://gladysassistant.com; - Authorization Callback Domain: the host name you type in your
browser to open Gladys, without
http://, port or path — for example192.168.1.20orgladys.local. If you open Gladys through Gladys Plus, use the host name of that address instead.localhostis always accepted by Strava.
- Application Name: for example
- Upload any icon if Strava asks for one, then save.
- Keep the page open: you need the Client ID and the Client Secret.
2. Configure the integration
- In Gladys, open Integrations → Strava → Configuration.
- Paste the Client ID and the Client Secret, then save.
- Click Connect next to "Strava account": Strava asks you to authorize the application. Keep every permission ticked (the private activities one too, or your private activities are left out), then confirm.
- Back in Gladys, the status turns to "connected" and a Strava device appears in the Discovery tab: add it to get its sensors.
Options:
- Units: metric (km, m, km/h) or imperial (mi, ft, mph). Changing it updates the device definition: accept the update offered in the Discovery tab.
- Refresh interval: how often Strava is read, every 15 minutes by default (5 minutes minimum, Strava limits the number of requests).
- Weekly distance goal: all sports together, in km (or miles). Used by the "Strava weekly goal reached" trigger and the dashboard widget; 0 disables it.
3. Instant notifications with Gladys Plus (optional)
Without Gladys Plus, a new activity shows up at the next refresh. With Gladys Plus, paste your Gladys Plus Open API key in the "Gladys Plus webhooks" block of the Configuration screen: the integration then registers a Strava webhook, and Strava announces each new activity within seconds.
Strava allows one webhook per API application: use a dedicated application for each Gladys.
The Strava device
| Sensor | Unit |
|---|---|
| Last activity (name) / sport | text |
| Last activity distance | km or mi |
| Last activity moving time | minutes |
| Last activity elevation gain | m or ft |
| Last activity average speed | km/h or mph |
| Distance / moving time this week | km or mi / minutes |
| Run, ride, swim distances, last 4 weeks | km or mi |
| Run, ride, swim distances this year | km or mi |
The week starts on Monday, in the time zone of your latest activity. The 4 weeks and year totals are Strava's own: they only count run, ride and swim activities, and only the activities visible to everyone.
Scenes
The integration adds its own cards to the scene editor, under the Integrations category.
Triggers:
- New Strava activity — an activity was recorded or uploaded. Optionally
filter on the sport (run, ride, swim, walk or hike, other). The following
actions can use
{{triggerEvent.data.name}},sport,sport_type,distance,distance_unit,moving_time(minutes),elevation_gain,average_speed,pr_count,activity_idandurl. - Strava personal record — a new activity beat at least one of your
records (
name,sport,pr_count,url...). - Strava weekly goal reached — the distance of the week reached your goal,
once a week (
week_distance,goal,week_activities).
Each activity is announced once, even after a restart; the activities that existed before the account was linked are not announced.
Actions:
- Synchronize Strava — reads Strava now; returns
new_activities. - Get Strava statistics — distance, moving time, elevation gain and count of a period (this week, last 4 weeks, this year, all time) for one sport or all, to use in a message: "{{...distance}} {{...distance_unit}} this week!".
- Get the last Strava activity — name, sport, distance, time and link of your latest activity.
Every action also returns linked: false when no account is linked, so a
scene can check it instead of failing.
Example: "When a new run is recorded, send me a Telegram message with its distance, and flash the living room light if it was a personal record".
Dashboard
- Strava this week: distance, moving time, number of activities and elevation of the week, a 7-day distance chart, your weekly goal, the last activity and your yearly run and ride distances. Sync now refreshes right away, Open Strava opens your profile.
- Strava activities: your latest activities (3, 5 or 8, optionally one sport only); tap one for the details and a link to Strava.
Actions of the Configuration screen
- Test the connection — reads Strava and shows who is connected and the activities of the week.
- Synchronize now — refreshes everything right away.
- Unlink the Strava account — revokes the access on Strava and forgets the tokens. Click Connect to link an account again.
Troubleshooting
- "redirect_uri invalid" on the Strava page: the Authorization Callback Domain of your Strava application does not match the address you use to open Gladys. Set it to that host name (step 1).
- The status says Strava refused the access: the access was revoked on strava.com or the application changed. Click Connect again.
- The badge of the device shows an orange dot: the Strava request limit was reached; the next refresh catches up. Increase the refresh interval if it happens often.
- Check the integration logs from the Gladys UI (or
docker logson the host); start the container withLOG_LEVEL=debugfor the full detail.
You can revoke the access of the integration at any time from strava.com/settings/apps.
Strava is a trademark of Strava, Inc. This integration is not affiliated with Strava.
Konfigurationseinstellungen
Diese Einstellungen fragt Strava in seinem Konfigurationsbildschirm in Gladys ab.
| Einstellung | Typ | Pflichtfeld | Beschreibung |
|---|---|---|---|
| Create your Strava API application | section | Nein | On strava.com, open Settings > My API Application and create an application. As "Authorization Callback Domain", enter the host name you use to reach Gladys ({{gladys_host}}). Then copy its Client ID and Client Secret below, save, and click Connect. |
| Client ID | string | Ja | |
| Client Secret | secret | Ja | |
| Strava account | oauth2 | Nein | Save the Client ID and Client Secret first, then link your Strava account. Keep every permission ticked on the Strava page. |
| Preferences | section | Nein | Optional: with Gladys Plus, paste your Open API key in the "Gladys Plus webhooks" block to get your new activities within seconds instead of at the next refresh. |
| Units | select | Nein | |
| Refresh interval (min) | number | Nein | How often Strava is read, in minutes (5 to 240). |
| Weekly distance goal | number | Nein | In km (or miles in imperial units), all sports together. 0 disables the goal. |
So installierst du Strava in Gladys
- Öffne in Gladys Integrationen: Strava erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
- Klicke auf Installieren. Gladys lädt das Docker-Image (
ghcr.io/quentinlegay/gladys-strava:1.0.1) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration). - Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
- Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/quentinlegay/gladys-strava.
Strava 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
Strava 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 quentinlegay veröffentlicht und gepflegt, nicht vom Gladys-Kernteam.
- Alle externen Integrationen durchsuchen
- Die nativen Integrationen entdecken, die in Gladys eingebaut sind
- Deine eigene externe Integration bauen und veröffentlichen
- Quellcode auf GitHub — Quelle dieser Dokumentation