codingcyclist / ha_strava

Pipe your Activity Data from Strava directly into Home Assistant
MIT License
76 stars 29 forks source link

sensor.strava_0_0 state / attributes #13

Open Proxx opened 3 years ago

Proxx commented 3 years ago

First of all.

I really like this integration. Great work

This is not an issue more a design question. My personal option is to have one sensor per activity. fill the state with eg. distance or name and use the attributes for the details. this way you have less sensors and all info combined per sensor.

codingcyclist commented 3 years ago

Hi @Proxx ,

I really like the idea of grouping all stats (distance, time, power, etc.) into a single sensor entity. What I wonder, though, is how users would then be able to display these sensor details in their Lovelace UI? I've tried both the entity- and the sensor card, but I could not figure out a way of displaying sensor detail values, instead of the default sensor state value. Do you have an idea for how to do that?

codingcyclist commented 3 years ago

@Proxx I just did some more research and figured that the HA's template platform (https://www.home-assistant.io/integrations/template/) would be a way to coerce state attributes like distance, time, power, etc. into distinct template sensors which could then be rendered to the UI using entity and/or state cards.

I think templating would make your idea work, but wouldn't you end up with the same number of sensors in the end? I mean you'd need to create a separate template sensor for every state attribute which you'd like to render to the UI, just as if that sensor was already there by default.

Please let me know if I'm missing something here. Otherwise I'll close this issue for now and open a feature request when several people bring up that idea again.