Help needed with rest sensor value_template unknown

I have several rest sensors, and just creating a new one to pull the collection date (dateNextVisit), no matter what I try with the value_template all I get is ‘unknown’, even when the same data is included in the attributes. I have used https://jsonpathfinder.com/ to get the path but still to no avail. Any help would be much appreciated!

  - resource: https://geoapi.dorsetcouncil.gov.uk/v1/Services/refuseday/10013286482
    scan_interval: 600
    sensor:
      - name: "Refuse TEST"
        json_attributes_path: "$.values[0]"
        value_template: "{{ value_json.values[0].dateNextVisit }}"
        icon: mdi:trash-can-outline
        force_update: true
        json_attributes:
          - "dateNextVisit"
          - "dayOfWeek"
          - "frequency"
          - "type"

needs to be

        value_template: "{{ value_json['values'][0].dateNextVisit }}"

because .values on a dictionary is a built-in function that supersedes a .values property on a dictionary. Therefore you need to access .values through getattr instead of dot notation.

Thanks @petro , much appreciated.