Custom Component to integrate Activity Data from Strava into Home Assistant.
When configuring the Strava API, the Authorization Callback Domain must be set to: my.home-assistant.io
- Gives you access to up to 10 of your most recent activities in Strava.
- Pulls Recent (last 4 weeks), Year-to-Date (YTD) and All-Time summary statistics for Run, Ride, and Swim activities
- Creates a camera entity in Home Assistant to feature recent Strava pictures as a photo-carousel
- Supports both the metric and the imperial unit system
- Activity data in Home Assistant auto-updates whenever you add, modify, or delete activities on Strava
- Exposes 13 sensor entities for each Strava activity
- Easy set-up: only enter your Strava Client-ID and Client-Secret and you're ready to go
For every Strava activity, the Strava Home Assistant Integration creates a device entity in Home Assistant (max 10 activities). Each of these virtual device entities exposes thirteen sensor entities:
- Date & Title
- Activity type
- Start geo co-ordinates
- Elapsed Time
- Moving Time
- Pace
- Speed
- Distance
- Heart Rate (Average)
- Heart Rate (Max)
- Calories
- Cadence (Average)
- Elevation Gain
- Power
- Kudos
- Trophies
Since every Strava activity gets its own virtual device, you can use the underlying sensor data in your Dashboards and Automations, just as you'd use any other sensor data in Home Assistant.
To use the Strava Home Assistant integration, your Home Assistant Instance must be accessible from an External URL (i.e. Remote Access). Without remote access, the integration won't be able to pull data from Strava. To learn how to set up Remote Access for Home Assistant, please visit the Official Documentation
If you use Nabu Casa then do this configuration from your Nabu Casa URL. You can find this under Configuration -> "Home Assistant Cloud"
After you've set up remote access for your Home Assistant instance, click here or head over to your Strava Profile and go to Settings
> My API Application
.
Follow the steps in the configuration wizard, and eventually obtain your Strava API credentials (ID + secret). We need those credentials during the final installation step.
!!! IMPORTANT !!! The Authorization Callback Domain must be set to: my.home-assistant.io
As of now, the Strava Home Assistant Integration can only be installed as a custom repository through the Home Assistant Community Store (HACS). The installation process is super easy
- Install HACS follwing the instructions here
- Add this repository https://github.com/craibo/ha_strava in
HACS
>Integrations
as a Custom Repository - Add the HA Strava integration using the
+Explore & Download Respoitories
button
Now is the time to fire up the Strava Home Assistant Integration for the first time and make a connection between Strava and your Home Assistant Instance.
From within Home Assistant, head over to Configuration
> Integrations
and hit the +
symbol at the bottom. Search for "Strava Home Assistant" and click on the icon to add the Integration to Home Assistant. You'll automatically be prompted to enter your Strava API credentials. It'll take a few seconds to complete the set-up process after you've granted all the required permissions.
Upon completion of the installation process, the Strava Home Assistant integration automatically creates device- and sensor entities for you to access data from your most recent Strava activities. Per default, only sensor entities for the two most recent Strava activities are visible in Home Assistant.
You can always adjust the number of Strava activities you wish to track from within Home Assistant (min 1; max 10).
Just locate the Strava Home Assistant Integration under Configuration
> Integrations
, click on CONFIGURE
, and use the slider to adjust the number of activities. After you've saved your settings, it might take a few minutes for Home Assistant to create the corresponding sensor entities and fetch the underlying data. The activities available in Home Assistant always correspond to the most recent ones under your Strava profile.
Three configurations for the distance unit system are available.
Default
uses the Home AssistantUnit System
configurationMetric
uses kilometers (km) and meters (m) for distancesImperial
uses miles (mi) and feet (ft) for distances
This setting is selectable on configuration of the Strava integration and from the Strava Home Assistant Integration under Configuration
> Integrations
, click on CONFIGURE
.
If your activity titles are constantly showing the area as Unknown Area, this is likely a result of the geocode.xyz api throttling. You are able to register for a free geocode.xyz account which will provide you with an API key. This key will reduce the throttling applied your geocoding queries.
- Go to https://geocode.xyz/new_account to register your account.
- Copy the provided API key
- Paste the API Key in the configuration of the Strava Home Assistant Integration found here:
Configuration
>Integrations
, click onCONFIGURE
.
NOTES
- Changing the unit system setting will require a restart of Home Assistant to be fully applied.
- Due to the way that some sensors track statistical data, chaging this after the inital integration setup may result in some staticstical data not showing correctly.
Forked from https://github.com/madmic1314/ha_strava (project abandoned).
Originally forked from https://github.com/codingcyclist/ha_strava (project abandoned).