Comments (7)
Please see release 0.7.0 - all problems discussed in this thread should be taken care of.
https://github.com/edwork/homeassistant-peloton-sensor/releases/tag/0.7.0
Thanks!
from homeassistant-peloton-sensor.
Yes - these Logger statements are too aggressive. I'll work on a hotfix, feel free to submit a PR in the meantime if you want to enhance logging in other areas too.
I do think there's an additional error that in already aware of. Since I've only really run this for bike sessions I've only looked at attributes for bike sessions. When meditating, boxing, walking, etc the attributes I'm explicitly asking for are missing causing the exception to be raised. When the exception is called it also stops looking for more attributes.
To fix this the attribute section needs rebased to tolerate failed attribute lookups and lookup different attributes for different types of workouts.
from homeassistant-peloton-sensor.
Ah yea ok I see how this works. My sensor is breaking at L115 because my last workout was a stretch and those don't have a distance summary. My wife's is breaking at L117 because although here last workout was cycling we don't have a heart monitor so those metrics are missing.
I can probably put in a quick fix for this in a bit. Although I think long-term as #25 progresses you might want to think about bumping these attributes out into their own sensors. That would give a few benefits:
- Users can individually disable sensors they don't need or can't use (like the heart beat one for me)
- More of this data can be easily exposed to users. I had no idea how much data was in this API until I started poking around for this bug. If each field was its own sensor its easier to expose far more of it since each user can just disable the sensors they don't care about. Can't really do that when the data becomes attributes on one sensor.
- Fits better with the new features around long-term statistics HA has been pushing, could be handy to see those kind of metrics for your peloton data over time.
from homeassistant-peloton-sensor.
lookup different attributes for different types of workouts
Actually FYI, this isn't safe. You can have a peloton membership without owning any of their equipment if you just like the classes. We did that for a while before we decided to get a bike, just did the classes using the app while on some random bike we got off facebook marketplace. When you do a class using the app like that it can't track most of the metrics like "Resistance", "Calories", "Speed", etc. even though we did a cycling class.
The simplest thing is obviously just to make it very fault-tolerant but then you won't get warnings when the API changes like you want. Alternatively you'd have to consider not just the type of exercise but probably also add some new config options like:
- Do you have a heart rate monitor connected?
- What peloton-connected equipment do you have? Bike, treadmill, etc.
It would be pretty tough honestly. There's lot of variations to consider if trying for true completeness. What if they have a bike and a treadmill but only one has a heart rate monitor? What are the API differences between V1 and V2 bike, enough that you have to separately prompt for version? etc.
from homeassistant-peloton-sensor.
Hi @mdegat01 I've issued a PR to fix the logs when you do not have a heart rate monitor. If @edwork accepts them then you can use the following in your config:
sensor:
- platform: peloton
username: tony1661
password: ********
hr_monitor: false
Let me know if that helps with your wife's issue on Line 117.
If you'd like to test before my PR before it gets merged (if it does), you can change your sensor.py file to have my changes: sensor.py
Also, my update also fixed the speed for people using KPH
from homeassistant-peloton-sensor.
Thanks all,
Regarding the speed logic, thanks for pointing this out. I'll make sure the changes are released soon.
Regarding the sensors crashing extra measurements I am working on a larger fix for this because it's not just limited to the heart rate sensor. For example when doing a stretch exercise on your phone, tablet, or TV there are a bunch of objects that don't populate causing further sensors to crash.
I am planning on putting each statement in a separate try-except where the except will throw a logger.debug message for those who have debugging enabled.
I'll try to have these changes finished soon, in the meantime look out for updates via HACS (shameless plug for this integration being in the default HACS repo now!).
from homeassistant-peloton-sensor.
@tony1661 I'm going to merge the PR for both the heart rate monitor setting + speed fix, but I may end up deprecating the setting in favor of the fault tolerant logic.
I won't push out a release yet but will continue testing with these changes. Keep an eye on the devel
branch for additional updates.
Thanks!
from homeassistant-peloton-sensor.
Related Issues (20)
- Not available in config flow HOT 5
- became unavailable HOT 3
- Heartrate HOT 6
- Add Workout Counter Sensor HOT 5
- Primary State HOT 3
- KeyError: 'ride' HOT 1
- Template not working properly HOT 13
- Values do not reflect actuals HOT 3
- This entity is no longer being provided by the peloton integration. HOT 8
- No power output? HOT 4
- During a Ride Countdown the primary binary_sensor goes unavailable HOT 2
- fail in version 2023.3 HOT 1
- Various Peloton HA Integration Errors in Log HOT 2
- Error after reinstall HOT 4
- Can't change password HOT 2
- Updating to 10.0: Index out of Range HOT 3
- End Time always = Start Time during workout HOT 2
- Entities have become unavailable HOT 1
- Peloton errors when starting workout HOT 4
- Current values/sensors don't drop to zero when not in use HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homeassistant-peloton-sensor.