RESTful JSON dictionary to sensors

I’m trying to generate some sensors from a JSON I receive via REST but it does not really work

this is my sensor config:

- platform: rest
  name: bsb-lan
  resource: http://192.168.1.6/JQ=8700,8830
  json_attributes:
    - 8700
    - 8510
  value_template: "OK"
- platform: template
  sensors:
    outside_temperature:
      value_template: "{{ state_attr('sensor.bsb-lan', '8700')['value'] }}"
      device_class: temperature
      unit_of_measurement: "°C"
    collector_temperature:
      value_template: "{{ state_attr('sensor.bsb-lan', '8510')['value'] }}"
      device_class: temperature
      unit_of_measurement: "°C"

my json looks like this:

{
  "8510": {
    "name": "Kollektortemperatur 1",
    "dataType_name": "TEMP",
    "dataType_family": "VALS",
    "error": 0,
    "value": "26.8",
    "desc": "",
    "precision": 0.1,
    "dataType": 0,
    "readonly": 1,
    "readwrite": 1,
    "unit": "°C"
  },
  "8700": {
    "name": "Außentemperatur",
    "dataType_name": "TEMP",
    "dataType_family": "VALS",
    "error": 0,
    "value": "23.5",
    "desc": "",
    "precision": 0.1,
    "dataType": 0,
    "readonly": 0,
    "readwrite": 0,
    "unit": "°C"
  }
}

I’ve got the code from RESTful Sensor - Home Assistant but the sensors are still empty and in the logs is written:

[homeassistant.helpers.template] Template variable warning: 'None' has no attribute 'value' when rendering '{{ state_attr('sensor.room_sensors', '8700')['value'] }}

Does anyone have any idea whats wrong here? Help much appreciated!

If you do this, is it working ?

 "{{ state_attr('sensor.bsb-lan', '8700')[0]['value'] }}"

Thanks for the hint but unfortunately it does still not work. The sensor is now “unavailable” and in the logs I receive:

2022-07-21 22:52:56 ERROR (MainThread) [homeassistant.helpers.template_entity] TemplateError('UndefinedError: None has no element 0') while processing template 'Template("{{ state_attr('sensor.bsb-lan', '8700')[0]['value'] }}")' for attribute '_attr_native_value' in entity 'sensor.outside_temperature'

Any other idea?

Go step by step, what is the output of this ?

"{{ state_attr('sensor.bsb-lan', '8700') }}"

I’ll get value_template: "None" here.