Hi. I have a sensor that outputs this in attributes:
'0':
destination_name: Wimbledon
scheduled: '06:47'
estimated: '06:47'
time_to_station: 1m 8s
platform: Westbound - Platform 3
'1':
destination_name: West Croydon
scheduled: '06:50'
estimated: '06:50'
time_to_station: 3m 28s
platform: Westbound - Platform 3
'2':
destination_name: Wimbledon
scheduled: '06:50'
estimated: '06:50'
time_to_station: 4m 12s
platform: Westbound - Platform 3
LastUpdate: '2022-02-03T06:40:33.036074'
remaining: '0:1:8'
scheduled: '06:47'
estimated: '06:47'
destination_name: Wimbledon
platform: Westbound - Platform 3
station_name: East Croydon
data:
- title_default: To $title
line1_default: at $time
line2_default: $studio
line3_default: ''
line4_default: ''
icon: mdi:train
- title: Wimbledon
airdate: '2022-02-03T06:47:41Z'
fanart: >-
https://tfl.gov.uk/tfl/common/images/logos/London%20Tramlink/Roundel/TramlinkRoundel.jpg
flag: true
studio: Westbound - Platform 3
- title: West Croydon
airdate: '2022-02-03T06:50:01Z'
fanart: >-
https://tfl.gov.uk/tfl/common/images/logos/London%20Tramlink/Roundel/TramlinkRoundel.jpg
flag: true
studio: Westbound - Platform 3
- title: Wimbledon
airdate: '2022-02-03T06:50:45Z'
fanart: >-
https://tfl.gov.uk/tfl/common/images/logos/London%20Tramlink/Roundel/TramlinkRoundel.jpg
flag: true
studio: Westbound - Platform 3
icon: mdi:train
friendly_name: Wimbledon
I like to take the 3 values from the estimated values and create a text notification that says something along the lines of “the next train is in x minutes, then the following trains are in y and z minutes.”
I know how to do the notification but I can’t find a way to get this value converted to minutes until. By playing around I did see I could do this to get the string with the time but I am stuck after this.
{{states.my_train_sensor.attributes['0'].estimated}}, {{states.my_train_sensor.attributes['1'].estimated}}, {{states.my_train_sensor.attributes['2'].estimated}}