Hi everyone, would love to get some help how to do this if it’s at all possible!
The Swedish weather service has an API that I manage to call using node-red and filter out the latest values from their huge json response so it looks like this:
{“validTime”:“2018-02-12T19:00:00Z”,“parameters”:[{“name”:“msl”,“levelType”:“hmsl”,“level”:0,“unit”:“hPa”,“values”:[1001.7]},{“name”:“t”,“levelType”:“hl”,“level”:2,“unit”:“Cel”,“values”:[0.6]},{“name”:“vis”,“levelType”:“hl”,“level”:2,“unit”:“km”,“values”:[22]},{“name”:“wd”,“levelType”:“hl”,“level”:10,“unit”:“degree”,“values”:[233]},{“name”:“ws”,“levelType”:“hl”,“level”:10,“unit”:“m/s”,“values”:[5.1]},{“name”:“r”,“levelType”:“hl”,“level”:2,“unit”:“percent”,“values”:[94]},{“name”:“tstm”,“levelType”:“hl”,“level”:0,“unit”:“percent”,“values”:[1]},{“name”:“tcc_mean”,“levelType”:“hl”,“level”:0,“unit”:“octas”,“values”:[8]},{“name”:“lcc_mean”,“levelType”:“hl”,“level”:0,“unit”:“octas”,“values”:[8]},{“name”:“mcc_mean”,“levelType”:“hl”,“level”:0,“unit”:“octas”,“values”:[0]},{“name”:“hcc_mean”,“levelType”:“hl”,“level”:0,“unit”:“octas”,“values”:[0]},{“name”:“gust”,“levelType”:“hl”,“level”:10,“unit”:“m/s”,“values”:[11]},{“name”:“pmin”,“levelType”:“hl”,“level”:0,“unit”:“kg/m2/h”,“values”:[0]},{“name”:“pmax”,“levelType”:“hl”,“level”:0,“unit”:“kg/m2/h”,“values”:[0.2]},{“name”:“spp”,“levelType”:“hl”,“level”:0,“unit”:“percent”,“values”:[73]},{“name”:“pcat”,“levelType”:“hl”,“level”:0,“unit”:“category”,“values”:[1]},{“name”:“pmean”,“levelType”:“hl”,“level”:0,“unit”:“kg/m2/h”,“values”:[0.1]},{“name”:“pmedian”,“levelType”:“hl”,“level”:0,“unit”:“kg/m2/h”,“values”:[0.1]},{“name”:“Wsymb2”,“levelType”:“hl”,“level”:0,“unit”:“category”,“values”:[6]}]}
Is it possible to make a mqtt sensor for this json that for each picks out the name, unit and value?