A fully async Home Assistant integration for Zwift that provides real-time sensor data for riders.
- π΄ Real-time riding metrics: Heart rate, power, speed, cadence, altitude, and more
- π Fully async: No blocking I/O operations, minimal impact on Home Assistant
- β‘ Performance optimized: Custom async API client using aiohttp
- π₯ Multiple riders: Track yourself and other riders simultaneously
- π¨ UI Configuration: Easy setup through Home Assistant UI (no YAML required)
- π Binary sensors: Online/offline status for each rider
- π World awareness: Knows which Zwift world the rider is in
- π Progress tracking: Cycling and running level progress
- Open HACS in Home Assistant
- Click on "Integrations"
- Click the three dots in the top right corner
- Select "Custom repositories"
- Add this repository URL:
https://github.com/xpenno255/zwift_async - Select category: "Integration"
- Click "Add"
- Find "Zwift Async" in HACS and install it
- Restart Home Assistant
- Download the latest release from the releases page
- Extract the
zwift_asyncfolder to yourcustom_componentsdirectory - Restart Home Assistant
- Go to Settings β Devices & Services
- Click + Add Integration
- Search for "Zwift Async"
- Enter your Zwift credentials
- Choose whether to include your own rider
- Optionally add other player IDs to track
sensor:
- platform: zwift_async
username: !secret zwift_username
password: !secret zwift_password
players:
- 123456 # Friend's player ID
- 789012 # Another friend's player ID
include_self: trueFor each tracked rider, the integration creates the following sensors:
- Online (binary_sensor): Whether the rider is currently riding
- Heart Rate (bpm): Current heart rate
- Power (W): Current power output
- Speed (mph/kmh): Current speed
- Cadence (rpm): Current pedaling cadence
- Altitude (ft/m): Current altitude
- Distance (miles/km): Distance covered in current ride
- Gradient (%): Current gradient
- Level: Current cycling level
- Run Level: Current running level
- Cycle Progress (%): Progress to next cycling level
- Run Progress (%): Progress to next running level
- Watopia
- Richmond
- London
- New York
- Innsbruck
- Bologna
- Yorkshire
- Crit City
- Makuri Islands
- France
- Paris
automation:
- alias: "Notify when friend starts Zwift"
trigger:
- platform: state
entity_id: binary_sensor.zwift_async_online_123456
to: "on"
action:
- service: notify.mobile_app
data:
message: "Your friend just started riding on Zwift!"automation:
- alias: "New power PR"
trigger:
- platform: numeric_state
entity_id: sensor.zwift_async_power_123456
above: 350 # Your PR threshold
condition:
- condition: state
entity_id: binary_sensor.zwift_async_online_123456
state: "on"
action:
- service: notify.mobile_app
data:
message: "New power record: {{ states('sensor.zwift_async_power_123456') }}W!"type: entities
title: Zwift Status
entities:
- entity: binary_sensor.zwift_async_online_123456
name: Riding
- entity: sensor.zwift_async_heart_rate_123456
name: Heart Rate
- entity: sensor.zwift_async_power_123456
name: Power
- entity: sensor.zwift_async_speed_123456
name: Speed
- entity: sensor.zwift_async_cadence_123456
name: CadenceYou can find Zwift player IDs in several ways:
- Zwift Companion App: Look in your profile or friends list
- ZwiftPower: Your ID is in your profile URL:
https://zwiftpower.com/profile.php?z=PLAYERID - Integration: After setup, your own player ID is shown in the options flow
This integration is fully async and uses:
- Custom async Zwift API client with
aiohttp - No blocking I/O operations
- Concurrent API calls for multiple riders
- Automatic token refresh
- Smart rate limiting
Performance comparison:
- Old (blocking): 100-500ms per update
- New (async): <10ms per update
- Verify your Zwift username and password are correct
- Check if Zwift service is online: https://status.zwift.com
- Try logging in directly on Zwift to ensure your account works
The integration automatically handles rate limiting by:
- Increasing update intervals when throttled
- Starting at 15s (offline) / 2s (online)
- Auto-adjusting in 0.25s increments
logger:
default: info
logs:
custom_components.zwift_async: debug
custom_components.zwift_async.async_zwift_client: debugContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Based on the original Zwift Home Assistant integration by @snicker
- Uses the unofficial Zwift API documented by the community
- Inspired by zwift-mobile-api
This is an unofficial integration and is not affiliated with, endorsed by, or connected to Zwift. Use at your own risk. Zwift does not provide an official public API, and this integration may break if Zwift makes changes to their unofficial API.
- π Report a bug
- π‘ Request a feature
- π¬ Discussions
Enjoy your rides! π΄ββοΈπ¨