Custom template for JSON issue

Hi I have json value that I got from a link:
https://www.prevision-meteo.ch/services/json/bellinzona

{
    "city_info": {
        "country": "Suisse",
        "elevation": "410",
        "latitude": "46.1926755",
        "longitude": "9.0354439",
        "name": "Bellinzona",
        "sunrise": "06:53",
        "sunset": "19:48"
    },
    "current_condition": {
        "condition": "Eclaircies",
        "condition_key": "eclaircies",
        "date": "10.09.2019",
        "hour": "11:00",
        "humidity": 77,
        "icon": "https://www.prevision-meteo.ch/style/images/icon/eclaircies.png",
        "icon_big": "https://www.prevision-meteo.ch/style/images/icon/eclaircies-big.png",
        "pressure": 1014,
        "tmp": 16,
        "wnd_dir": "SE",
        "wnd_gust": 27,
        "wnd_spd": 17
    },
....
}

So I wrote in the confguration.xaml file the following template:

sensor:
  - platform: rest
    name: bellinzona_meteo
    resource: https://www.prevision-meteo.ch/services/json/bellinzona
    json_attributes:
      - city_info
      - current_condition
    value_template: 'OK'
  - platform: template
    sensors:
      cityinfo_name:
        value_template: '{{states.sensor.attributes["city_info"][name]}}'
      cityinfo_sunrise: 
        value_template: '{{states.sensor.attributes["city_info"][sunrise]}}'
        device_class: timestamp
      cityinfo_sunset: 
        value_template: '{{states.sensor.attributes["city_info"][sunset]}}'
        device_class: timestamp
      currentcondition_humidity:
        value_template: '{{states.sensor.attributes["current_condition"][humidity]}}'
        device_class: humidity
        unit_of_measurement: '%'
      currentcondition_temperature:
        value_template: '{{states.sensor.attributes["current_condition"][tmp]}}'
        device_class: temperature
        unit_of_measurement: '°C'

What am I doing wrong?

The error was that I did not add correctly the value_template.

So if anyone need it, here is the value:

     value_template: '{{states.sensor.bellinzona_meteo.attributes["city_info"]["name"]}}'

the problem now is that unable to get the time, format iusse I think

To clarify for anyone entering the thread: He didn’t have quotes around the second getitem (["name"])

Also, another safer way to approach these templates:

{% set attr = state_attr('sensor.bellinzona_meteo','city_info')) %}
{{ attr['name'] if attr else None }}