Rest sensor syntax error

Hello, for some time (years) I have running a Rest-sensor that gets the temperature, RH% and PM from a sesnsor outside the house.
Since latest version (2025.12.4) of HA is quits working.

Is have 2 .yaml files:
1) rest sensor to send GET request from the API

platform: rest
name: "luchtpijp"
resource: http://xxx.xxx.xxx.xxx/data.json
scan_interval: 30
json_attributes:
  - software_version
  - sensordatavalues
 value_template: '{{value_json.luchtpijp}}'

2) templated sensor to format the actual sensor data

platform: template
sensors:
  luchtpijp_pm2_5:
    friendly_name: 'PM2,5'
    value_template: "{{ state_attr('sensor.luchtpijp','sensordatavalues')[0]['value']}}"
    unit_of_measurement: µg/m³
    icon_template: mdi:thought-bubble
  luchtpijp_pm10:
    friendly_name: 'PM10'
    value_template: "{{ state_attr('sensor.luchtpijp','sensordatavalues')[1]['value']}}"
    unit_of_measurement: µg/m³
    icon_template: mdi:thought-bubble-outline
  luchtpijp_temperature:
    friendly_name: 'Temperature'
    value_template: "{{ state_attr('sensor.luchtpijp','sensordatavalues')[2]['value']}}"
    unit_of_measurement: °C
    icon_template: mdi:home-thermometer-outline
  luchtpijp_humidity:
    friendly_name: 'Humidity'
    value_template: "{{ state_attr('sensor.luchtpijp','sensordatavalues')[3]['value']}}"
    unit_of_measurement: '%'
    icon_template: mdi:water-percent

This syntax still works on second HA (2025.11.3 running on RPi3) :face_with_monocle:

What is changed? Why doesn’t the Restfull show up on my integrations/entities?

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

The template sensor needs updated to latest syntax. Templates are their own main key in yaml now and are no longer rested as sub-keys underneath any other key. There is a post at the top of the forums all about this and someone even developed a custom integration to help migrate the sensors over to the new syntax. Eg -

template:
  - sensor:
      - name:

@tom_l is being mindful and I agree, please follow the forum guidelines and update your post when you can to follow the suggestions in the link he shared. It keeps the forum neat and tidy and easier to follow along for people who may encounter the same issue you have.

EDIT - Rest sensor syntax has changed, too. rest: is now a main key in the yaml, and like templates, can not be rested as a platform underneath any other key. Eg -

rest:
  - resource:
    scan_interval:
    sensor:
      - name:
        value_template:
        json_attributes:

Users have the option of defining a sensor using the RESTful integration (under the rest: key) or the RESTful Sensor integration (under the sensor: key).

Ahh, touché. Thanks for the correction. @Smeagel21 so as the official documentation shares, use the rest: key if you’re creating multiple rest sensors using the same endpoint. Not to be confused with multiple sensors under the template: key, which is done simply by adding another hyphen with name under the sensor: domain. Eg -

template:
  - sensor:
      - name:
        unique_id:
        state:

      - name:
        unique_id:
        state:

First let’s confirm the source of the data is functional.

Enter the resource URL in a web browser. Does it report data in JSON format?

If it does then check if it has a luchtpijp key.

Data is functional:

connection: close
content-length: 443
content-type: application/json
{"software_version": "NRZ-2024-135", "age":"29", "sensordatavalues":[{"value_type":"SDS_P1","value":"16.85"},{"value_type":"SDS_P2","value":"8.63"},{"value_type":"temperature","value":"4.80"},{"value_type":"humidity","value":"97.70"},{"value_type":"samples","value":"580"},{"value_type":"min_micro","value":"250424"},{"value_type":"max_micro","value":"270937"},{"value_type":"interval","value":"145000"},{"value_type":"signal","value":"-74"}]}

You have configured value_template to get the value of the luchtpijp key from the received JSON data.

In the JSON data example that you posted, there is no luchtpijp key. The three top-level keys in the JSON data are software_version, age, and sensordatavalues.

Thanks but couldn’t find a working solution there.
I’m using:

platform: rest

As mentioned by @petro this is also a legacy format and will likely deprecate in the future.

That wasn’t the point. I linked you to the section of the FAQ that shows you how to format your post correctly so that others can help you. Which you have now done. And so have they. In particular: Rest sensor syntax error - #8 by 123

Did you change the key in the value_template like @123 was indicating? Since you’re pulling the software_version and sensordatavalues as attributes, you should be able to simply change the value_template in the rest sensor to use the age key. So it’ll show like value_template: '{{value_json.age}}'. You can, as of now, keep using the current rest syntax as you are or you can change it and put it under the rest: key like I had mentioned. It would look like this -

rest:
  - resource: http://xxx.xxx.xxx.xxx/data.json
    method: GET
    scan_interval: 30
    sensor:
      - name: luchtpijp
        value_template: "{{ value_json.age }}"
        json_attributes:
          - software_version
          - sensordatavalues

Other than that, you’ll need to update each template sensor to the current syntax using the template: key, as the way you have it in the OP is now deprecated.