A modern, fully async Home Assistant integration for Peloton using aiohttp.
- ✅ Fully async - Uses aiohttp instead of blocking requests
- ✅ No executor jobs - True async/await throughout
- ✅ Modern architecture - DataUpdateCoordinator pattern
- ✅ Config flow - Easy setup through UI
- ✅ Reauth support - Handles expired credentials gracefully
-
Copy the
peloton_asyncfolder to yourcustom_componentsdirectory:custom_components/ └── peloton_async/ ├── __init__.py ├── api.py ├── binary_sensor.py ├── config_flow.py ├── const.py ├── manifest.json ├── sensor.py └── strings.json -
Restart Home Assistant
-
Go to Settings → Devices & Services → Add Integration
-
Search for "Peloton (Async)" and enter your credentials
Once published to HACS, you'll be able to install directly from the HACS store.
- Workout Active - Shows if a workout is currently in progress
- Duration - Workout duration in minutes
- Current Workout Duration - Time elapsed in current workout (live updates during active workout)
- Time Remaining - Calculated time remaining in current workout
- Distance - Distance covered (respects user's unit preference)
- Calories - Total calories burned
- Total Output - Total power output in kJ
- Heart Rate Avg - Average heart rate during workout
- Heart Rate Max - Maximum heart rate during workout
- Speed Avg - Average speed (respects user's unit preference)
- Cadence Avg - Average cadence in RPM
All configuration is done through the UI. No YAML required!
The integration polls Peloton's API every 30 seconds. This provides near real-time updates during workouts without overwhelming the API.
- True Async - No blocking calls wrapped in executors
- Better Error Handling - Proper exception handling with retries
- Session Management - aiohttp sessions properly managed
- Cleaner Code - Simplified sensor creation and updates
- Modern Patterns - Follows current Home Assistant best practices
The api.py module provides a clean async interface to Peloton's API:
api = PelotonAPI(username, password)
await api.login()
workouts = await api.get_recent_workouts(limit=1)
await api.close()If you see authentication errors, go to Settings → Devices & Services → Peloton and click "Reconfigure" to enter new credentials.
The integration requires at least one workout in your history. Complete a workout and wait up to 30 seconds for the integration to update.
Check your Home Assistant logs for detailed error messages. The integration will automatically retry on temporary connection failures.
Since this uses the domain peloton_async, it can run alongside the original peloton integration without conflicts. This lets you test the async version while keeping your existing setup.
Want to extend this integration? The code is structured for easy modifications:
api.py- Add new API endpoints heresensor.py- Add new sensor types herebinary_sensor.py- Add new binary sensors here
MIT License - Feel free to modify and distribute
Based on the original pylotoncycle library and Home Assistant Peloton integration, completely rewritten for modern async patterns.