RESTful Sensor with json

Hi.
My internet box give me data on this url : http://ip.ip.ip.ip/api/v1/wan/xdsl

Data look like that :
[{“wan”:{“xdsl”:{“state”:“Connected”,“modulation”:“G.993.2-17A”,“showtime”:46243,“atur_provider”:“BDCM”,“atuc_provider”:“BDCM”,“sync_count”:1,“up”:{“bitrates”:8000,“noise”:141,“attenuation”:0,“power”:48,“phyr”:0,“ginp”:1,“nitro”:"",“interleave_delay”:0},“down”:{“bitrates”:50000,“noise”:76,“attenuation”:227,“power”:141,“phyr”:0,“ginp”:1,“nitro”:0,“interleave_delay”:0}}}}]

How to make a sensor, showing me if the state is “connected” or not, for example?
Thanks, and sorry for my bad english…

use this in your template to extract the value of “state”:

{{ value_json[0][‘wan’][‘xdsl’].state }}

So the sensor would be like:

- platform: rest
  resource: http://ip.ip.ip.ip/api/v1/wan/xdsl
  name: Some Name
  value_template: "{{ value_json[0]['wan']['xdsl'].state }}"

Thanks !
I forgot [’ ** ']. Now it’s working.

Just an FYI, you could also use:

  value_template: "{{ value_json[0].wan.xdsl.state }}"

You only need to use square brackets when indexing into a list, or if the key name starts with a numeric digit or contains spaces.