I am trying to modify an existing custom plugin for Strava to download more information rather than the distance I have run this year. At the moment, Lovelace and the History GUI will only display the year to date distance (State) whereas there are attributes with more information.
What I cannot work out is how to access the attributes returned. Or I am returning the wrong information if I want access to this data?
The Lovelace YAML I have tried appears below. The commented lines don’t work. Only sensor.strava_11527827 is working for me. Thanks
You could create a template sensor and extract the attribute you want with that and then you can display in lovelace. I display heaps of sensor attributes in lovelace this way. I am out at the moment but I can show you how later.
This code fails because hass.async_add_job() does not appear to like named arguments. I am still coming to terms with Python 3, yield, yield from etc… Any ideas on how to add a job with named arguments? Of do I need to edit async_add_job and get that propagated? Thanks.
And got this error:
Invalid config for [sensor.template]: invalid template (TemplateSyntaxError: expected token ‘end of print statement’, got ‘i_xdrive_condition_based_services’) for dictionary value @ data[‘sensors’][‘530ix_brake_fluid_date’][‘value_template’]. Got ‘{{ states.binary_sensor.530i_xdrive_condition_based_services.attributes.brake_fluid_date|int }}’ invalid template (TemplateSyntaxError: expected token ‘end of print statement’, got ‘i_xdrive_condition_based_services’) for dictionary value @ data[‘sensors’][‘530ix_brake_fluid_status’][‘value_template’]. Got ‘{{ states.binary_sensor.530i_xdrive_condition_based_services.attributes.brake_fluid_status|int }}’. (See /config/configuration.yaml, line 173). Please check the docs at Template - Home Assistant