I have been using the Strava integration and love it.
I’m needing a bit of motivation to get up and go in the morning so I have set up an automation for my Google Home to let me know the weather and also the last time I ran and what disance.
I am having a problem with the date element of this.
The sensor that shows the last date and time is sensor.strava_0_0 (friendly name).
So I first added this to TTS:
Your last running day was on the {{ state_attr('sensor.strava_0_0', 'friendly_name'}}
But my Google Home read it out wrong. Ten point zero eight blah blah blah
So I then tried creating a sensor
strava_last_date:
friendly_name: strava last activity
value_template: "{{ state_attr('sensor.strava_0_0', 'friendly_name') }}"
and splitting it:
Your last running day was on the {{states.sensor.strava_last_date.state.split(".")[0] }} of {{states.sensor.strava_last_date.state.split(".")[1] }} with a distance of {{states.sensor.strava_0_3.state}}
But this also gets read out kind of wrong.
How can I convert my sensor (sensor.strava_last_date) to a date? Once I get it into a date I could then start playing around with TTS saying ‘Your last running day was’ yesterday, or 2 days ago ect
Much appreciated if someone could give me a hand.