That would be my preferred solution, although I’d probably use OpenWeather. There are some examples of how to do this with OpenWeather on the forum if you search.
This is my setup at the moment in the api settings. That does not do the job. Is there a really simple thing I don’t see? Can I select the value in some way so it just writes that? Would love for it to be that simple so I can add other sources the same way.
It was simply a question.
As you’re using a url that ends in .json then I would assume you’d use Custom JSON for the content type, but TBH I’m not going to spend any time reading the docs for your web service API.
You’re calling an API which returns a lot of data that needs to be parsed. That’s not a simple task, so the answer is no.
Thanks a lot Pete! Parsed was a new word on my list. That took me to postman for testing. And there i’m sucsesfully getting the specific value I want in the console.
bodydata = JSON.parse(responseBody)
value = bodydata.value[0].value
console.log(value)
If 3-d party service has a response, it is forwarded back to the device/pin you specified in the webhook. Webhook response can’t be parsed on the console (while that is a good thing to have), but it can be parsed on the hardware side. In other words, webhook response is fully forwarded to the hardware.
So if your service returns json, you have to parse this json on the hardware side. In order to test this, you can just print the value when hardware receives the data in specific pin:
You might want to look at thus example as a way of extracting one or two pieces of data from an API response.
Otherwise you can use the JSON library and use that to deserialise and extract the data.