Get temperature from Fibaro Home Center 2 sensor with nested JSON


Im trying to extract temperature value from a JSON generated on my Fibaro Home Center 2. The temperature is shown as “value” under “properties” (20.70) when calling my Fibaro motion sensor with;


   "interfaces":[  ],
  "parameters":[  ],


 - platform: rest
    name: Arbetsrum
    value_template: '{{ }}'
    unit_of_measurement: "°C"

Im getting a parser error in the log. I have looked at similar posts but I cant figure this out, I guess I need to set the value_json correctly but the above principle works with other JSONs.

Error parsing value: ‘value_json’ is undefined (value: , template: {{ }})

Can someone help me out? This could be useful for others moving or using Home Center 2 with HA.


The }, immediately affter value is the clue, it’s nested, so…

Nested JSON in a response is supported as well

  "sensor": {
    "type": "air",
    "id": "12345"
  "values": {
    "temp": 26.09,
    "hum": 56.73,
Just use the “Square bracket notation” to get the value.

'{{ value_json["values"]["temp"] }}'

You need this sort of thing. Yours would be [“properties”][“value”] i believe

Thanks for the quick answer! So thats how you do the nested JSON, great!

The yaml is now;

- platform: rest
   name: Arbetsrum
   value_template: '{{ value_json["properties"]["value"] }}'

However, I still get an error saying that the “value_json” is undefined? I must have missed something?

Error parsing value: ‘value_json’ is undefined (value: , template: {{ value_json[“properties”][“value”] }})


Check your indentation, it doesn’t look right to me.

Well the indentation is ok, I just missed the space between sensor and platform when I pasted the config.

Anyway, your suggestion works beautiful when I paste the whole JSON in the template tool and use the brackets just like in the config. It does not work “live” in Home Assistant… I will test test to store the result locally in a file to locate where the error occurs.

Something is fishy.


Well. For all of you that is stuck just like I was;

You need authentication! And I needed to reboot the Home Assistant server before I got it to work!

Code to extract the temp value from a Fibaro Motion Sensor;

  • platform: rest
    username: name
    password: password
    authentication: basic
    name: Fibaro Sensor
    unit_of_measurement: “°C”
    value_template: ‘{{ value_json[“properties”][“value”] }}’
    User-Agent: HomeAssistant
    Content-Type: application/json