Giter Site home page Giter Site logo

edwork / homeassistant-peloton-sensor Goto Github PK

View Code? Open in Web Editor NEW
76.0 10.0 15.0 370 KB

A platform which allows you to get current and past ride data from Peloton into HomeAssistant

License: Apache License 2.0

Python 99.01% Shell 0.99%
homeassistant homeassistant-integration peloton peloton-api peloton-client hacktoberfest

homeassistant-peloton-sensor's Introduction

Home Assistant Peloton Sensor

hacs_badge CodeQL Validation Dependency Validation HASSFest Validation

Development & Community

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!

"Buy Me A Coffee"

Please join our community discussion here on the HomeAssistant Forms.

Overview

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.

This integration creates one of the below sensors for each user. The "Workout" binary sensor registers itself as a device with all other sensors created as entities.

Sensor Name Sensor Type Unit of Measurement Attributes Notes
Workout Binary Sensor (Running) - Workout Type, Device Type, Ride Title, Ride Description, Workout Image, FTP, Instructor, Paused On/running when user is working out.
Cadence: Average Sensor rpm
Cadence: Max Sensor rpm
Calories Sensor kcal
Distance Sensor mi / k Uses unit of measurement specified in user's Peloton profile.
Duration Sensor min
End Time Sensor -
Start Time Sensor -
Heart Rate: Average Sensor bpm
Heart Rate: Max Sensor bpm
Leaderboard: Rank Sensor -
Leaderboard: Total Users Sensor -
Power Output Sensor Wh
Resistance: Average Sensor %
Resistance: Max Sensor %
Speed: Average Sensor mph / kph Uses unit of measurement specified in user's Peloton profile.
Speed: Max Sensor mph / kph Uses unit of measurement specified in user's Peloton profile.
Workout count Sensor These sensors are disabled by default.
Available types:
- Bike Bootcamp
- Cardio
- Cycling
- Meditation
- Row Bootcamp
- Rowing
- Running
- Strength
- Stretching
- Tread Bootcamp
- Walking
- Yoga

Under the Hood

This integration uses Pylotoncycle to poll Peloton's API. Keep in mind that polling won't be instant when creating Automations.

Integration Installation

Using HACS (Recommended)

  1. Search for and install "Peloton" in HACS.
  2. Restart Home Assistant.
  3. Set up the integration from your Home Assistant Integrations page.

Manually Copy Files

  1. Download this repository and place the custom_components/peloton/ directory within home_assistant_root/config/custom_components/.
  2. Restart Home Assistant.
  3. Set up the integration from your Home Assistant Integrations page.

Use Cases

  • 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.

To Do

  • Expose more useful information by examining the entire JSON Object or other endpoints (PRs Welcome!)

Final Thoughts

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.