Restful web services Unknown value

I’m trying to work around the limitations of the new home assistant architecture where everything is in a container and i cant call other binaries on my server.

My plan now is to have an external piece of python code to allow communications between the containerised ha and the code i need to call to carry out tests

So far a have a rest server in an external python piece of code
if i call the python code with curl and dummy data it works,
curl -X GET -H "Content-Type: application/json" -d '{ "description": "lottery", "amount": 1000.0 }' http://TESTSERVER:5000

returns the following JSON
[{"a":"aval","b":"bval","c":"OK"}]
So all good

Again using dummy values i added the following


sensor:
  - platform: rest
    name: "Vehicle Report"
    scan_interval:  1
    resource: http://TESTSERVER:5000
    method: POST
    payload: '{ "device" : "heater" }'
    headers:
      User-Agent: Home Assistant
      Content-Type: application/json
    value_template: '{{ value_json.c[0] }}'
    json_attributes:
      - a
      - b
      - c

to my ha configuration.yaml, and it works
i can see the call and the payload being recieved

HAIP - - [11/Aug/2025 11:41:07] "POST / HTTP/1.1" 200 -
{'device': 'heater'}

In HA i can even see the attributes being returned

The problem is i cant use the values to let HA know the status of the item i will eventually be testing via value_template. i just get unknown

I’ve spent hours trauling the forums and it looks like while most agree i have the value-template correct there appears to be other options none of which i have managed to get working.
Any ideas ?

so i have changed he JSON response to remove the outer brackets, and it works.
Tha json response now looks like
{"a":"aval","b":"bval","c":"OK"}
If i wanted to leave the square brackets, what changes do i need to make the configuration.yaml ?

{{ value_json[0]['c'] }}

Your response:

[{"a":"aval","b":"bval","c":"OK"}]

is a list containing just one item. That item is a dict, and you want the value from the c key of that first item. Spaced out a bit more clearly:

[
  {
    "a": "aval",
    "b": "bval",
    "c": "OK"
  }
]

Developer Tools / Template is your friend here:

You won’t then be able to specify the json_attributes though: that expects the response to be a dict not a list.

Thanks very much. I have to admit i have never used the Template page. I will have a look.