Please help to get the sensors values from the API

Please find the API result below, I need to get the three values of eta fields below:

00:18:17
00:48:17
01:08:19

{
    "type": "ETA",
    "generated_timestamp ": "2020-05-26T00:25:04+08:00",
    "data": [
        {
            "seq": 5,
            "stop": "002438",
            "eta": "2020-05-26T00:18:17+08:00",
            "eta_seq": 1
        },
        {
            "stop": "002438",
            "eta": "2020-05-26T00:48:17+08:00",
            "eta_seq": 2
        },
        {
            "stop": "002438",
            "eta": "2020-05-26T01:08:19+08:00",
            "eta_seq": 3
        }
    ]
}

How can I do that?

{{ value_json.data[0].eta[11:-6]}}
{{ value_json.data[1].eta[11:-6]}}
{{ value_json.data[2].eta[11:-6]}}

Tested in the Template Editor:

Will you be using MQTT or REST to acquire the JSON data?

1 Like

REST to acquire the JSON data

OK, then you will need to use the RESTful sensor integration.

HI! could you please share your rest request ? I am trying to recover also a value and I am struggling with my configuration.yaml content