REST help please - get string value and display string value

Hi all’

I need some help displaying the value of a string received from a JSON request using REST, this is what I have:

- platform: rest
  resource: "http://192.168.0.1/json.htm?type=command&param=getuservariables&idx=1"
  method: GET
  value_template: '{{ value_json.result.0.value }}'
  name: Curtain Status

The JSON returned looks like this:

{
   "result" : [
      {
         "LastUpdate" : "2019-04-27 10:12:04",
         "Name" : "CurtainStatus",
         "Type" : "2",
         "Value" : "Open",
         "idx" : "1"
      }
   ],
   "status" : "OK",
   "title" : "GetUserVariables"
}

With the above configuration, I get the status as ‘Off’ in HA, but I would like to display the actual string value (“Open”) in HA.

Does anyone know how to display the string value, and not just On/Off please?

OK, found the issue - well, at least half of it - I included the sensor.yaml file under binary-sensors. I moved it to sensors and I tried value_template: ‘{{ value_json.status }}’ and I got “OK” - this is promising.

Now, does anyone know how to get to the ‘value’?

I tried value_template: ‘{{ value_json.result.0.value }}’ but the result is completely empty?

OK, found the answer and thought that I would post it here if anyone have the same issue. For the JSON I posted, the REST should be:

- platform: rest
  resource: "http://192.168.0.1/json.htm?type=command&param=getuservariables&idx=1"
  method: GET
  value_template: '{{ value_json.result[0].Value }}'
  name: Curtain Status

Note that you need to break into the first array with the [0] and then note that this is CaSe SeNsItIvE !

Was pulling my hair out on this but finally there!