External Json Formatting

Tags: #<Tag:0x00007f3f167b4808>

Good evening; this request for help is kinda split into two parts but all relevant:
1)I have an external JSON output shown below and looking to return the sgv value

[{"_id":"5d34d8b8b100bf215e0e7d55","sgv":46,"date":1563744309000,"dateString":"2019-07-21T21:25:09.000Z","trend":8,"direction":"NOT COMPUTABLE","device":"share2","type":"sgv","utcOffset":0,"sysTime":"2019-07-21T21:25:09.000Z"}]

I’ve been looking at the sensor: module in the configuratio.yaml to try and return the sgv value, in the example above this is 46 but not having much luck. I can return the whole json output but not the SVG value.

Once I have this sgv value I would like to change some leds to different colors

below 51 - blue
between 51 and 100 - cyan
between 101 and 200 - green
between 201 and 250 - orange
above 250 red

Lights are working with the following

light:
  - platform: flux_led
    automatic_add: true
    devices:
      192.168.1.25:
        name: bedroom_led

Any help would be amazing, its to help with my Sons type 1 diabetes and to have lights in his and our room change color to make him more aware during the night what his blood sugar is without too much disruption. Numbers on his phone/device mean nothing yet due to him only being three but colors he understands.

Next steps would be to get a google mini to announce the blues/reds so he can start to self manage too.

Thanks once again

When you createthe sensor/automation or whatever the end result is going to be you need to use the following template:

{{ value_json[0].sgv }}