This integration is developed and maintained by myself (edwork@) and a small group of contributors. We are not affiliated with Peloton. If you would like to show your support you're welcome to buy me a coffee!
Please join our community discussion here on the HomeAssistant Forms.
HomeAssistant-Peloton-Sensor is an integration for HomeAssistant that exposes your latest or current Peloton Workout session as a sensor. This can be useful to toggle lights, fans, or scenes according to your workout.
- Sensor state shows either
Complete
orIn Progress
- State Attributes include:
- Workout Type
- Ride Title
- Device Type
- Paused
- Description
- Start Time
- End Time
- FTP
- Duration Min
- Leaderboard Rank
- Leaderboard Users
- Output Kj
- Distance Mi
- Calories KCal
- Heart Rate Average Bpm
- Heart Rate Max Bpm
- Resistance Average
- Resistance Max
- Speed Average Mph
- Speed Max Mph
- Speed Average Kph
- Speed Max Kph
- Cadence Average Rpm
- Cadence Max Rpm
- Power Average W
- Power Max W
- Total Work
- Instructor
- Workout Image
- Heart Rate Bpm
- Resistance
This integration uses Pylotoncycle to poll Peloton's API. Keep in mind that polling won't be instant when creating Automations.
Download this repository and place the custom_components/peloton/
directory within a folder called custom_components/
in the root of your HomeAssistant Configuration directory. A forced reboot of HomeAssistant may be required in order for HomeAssistant to silence errors about missing dependancies (which will be installed upon reboot).
A simple sensor configuration is required:
sensor:
- platform: peloton
username: thedude
password: paSSw0rdz
- platform: peloton
username: thedudette
password: paSSw0rdz
This will give you a sensor named sensor.peloton_USERNAME
- allowing for multiple instances!
Sometimes it's easier to work with the state directly, which will retain state history via the recorder.
sensor:
- platform: template
sensors:
power_output:
friendly_name: "Power Output"
value_template: >
{{ state_attr('sensor.peloton_username', "Workout Type" ) }}
- Automate lights and fans when you start or end a workout, or when your output exceeds a certain threshold.
- Motovation - make HomeAssistant remind you to workout!
- Export your ride stats to InfluxDB.
- Configuration via the UI (required for official HASS integration).
- Expose more useful information by examining the entire JSON Object or other endpoints (PRs Welcome!)
Please feel free to critique the code as well as submit feature requests or additions! The Goal is to turn this into an award winning HomeAssistant Integration!