Hello,
I’m trying to parse some JSON data collected using the rest sensor platform however I’m unable to get the correct JSON data. Below the JSON data and the entry in the configuration.yaml.
The sensor is shown in the developer tools but the value is unknown. So I needs some help here as the documentation can’t help me any further. I’m only interested in the “samenv” value.
Thanks Rob
The JSON data retreived:
{
"liveweer": [
{
"plaats": "Elsloo",
"temp": "20.7",
"gtemp": "18.1",
"samenv": "Zwaar bewolkt",
"lv": "46",
"windr": "ZW",
"windms": "5",
"winds": "3",
"windk": "9.7",
"windkmh": "18",
"luchtd": "1016.4",
"ldmmhg": "762",
"dauwp": "8",
"zicht": "35",
"verw": "Enkele buien, in het westen en zuiden tijdelijk droger",
"sup": "06:37",
"sunder": "20:40",
"image": "bewolkt",
"d0weer": "bewolkt",
"d0tmax": "21",
"d0tmin": "13",
"d0windk": "3",
"d0windknp": "8",
"d0windms": "4",
"d0windkmh": "15",
"d0windr": "ZW",
"d0neerslag": "4",
"d0zon": "19",
"d1weer": "regen",
"d1tmax": "20",
"d1tmin": "13",
"d1windk": "3",
"d1windknp": "8",
"d1windms": "4",
"d1windkmh": "15",
"d1windr": "Z",
"d1neerslag": "90",
"d1zon": "20",
"d2weer": "regen",
"d2tmax": "19",
"d2tmin": "16",
"d2windk": "4",
"d2windknp": "12",
"d2windms": "6",
"d2windkmh": "22",
"d2windr": "W",
"d2neerslag": "80",
"d2zon": "20",
"alarm": "0"
}
]
}
The configuration.yaml part:
# Get weather state from weer.nl for home location
sensor:
- platform: rest
name: weernlsamenv
resource: http://weerlive.nl/api/json-data-10min.php?key=c9a1ebc79d&locatie=50.949,5.765
json_attributes_path: "$.[0]"
value_template: '{{ value_json[0].samenv }}'