@sti0 I am using this component (jsonrest.py), but unfortunately it doesn’t seem to parse the values that are in an array?
I would like to read the vallues of a device (Youless LS120) that spits out JSON with values that it reads from my smartmeter:
[{"tm":1513196051,"net":-332.767,"pwr": 407,"ts0":1512921868,"cs0": 0.000,"ps0": 0,"p1": 616.196,"p2": 454.733,"n1": 430.932,"n2": 972.764,"gas": 350.759,"gts":1712132100}]
Or in a prettified-view:
[
{
"tm":1513196051,
"net":-332.767,
"pwr":407,
"ts0":1512921868,
"cs0":0.000,
"ps0":0,
"p1":616.196,
"p2":454.733,
"n1":430.932,
"n2":972.764,
"gas":350.759,
"gts":1712132100
}
]
As you can see the values are in a array.
I added the sensor like this:
- platform: jsonrest
resource: http://192.168.6.28/e
name: 'ls120_json'
scan_interval: 10
Unfortunately, the sensor isn’t added. When i use a different URL (which spits out JSON without array-brackets) it works like i would expect. However, that alternative page doesn’t contain all the values i need
Normally i would use something like value_template: '{{ value_json.[0].gas }}'
but i have no idea how to do it with this custom component.
Can you please enlighten me how to get these JSON values into HASS?