Homey Community Forum

Http request

With the help from @Rocodamelsheki I got the help to try get a value from json, and Better logic and so far it looks ok.
Problem is, that I can`t figure out to put in the right value.
The value is the temperature, marked with yellow and flow attached

I`m a fool for this :wink:

@robertklep ^^

I think it should be $.weather.temperature.current.c

@robertklep that gives this

The JSONpath Robert suggested if right.

The Url you use gives the following answer back:

“406 Security
Incident
Detected

40
6 Security Incident
Detected

Your request was
blocked. Please try again later (or
don’t).


Xc-
8rndSo2JGnHwZFNNnBQAAADQ</bo
dy>”

So the actual request fails when sent from Homey. The same request works when sent from example web browser. My knowledge ends here :smiley:

Looks like it is my provider, I Will leave it for that for now until i`ve set up my own web server

Thanks for help for now :blush:

This is the json file I get from weeelive.nl. To get the data I use this flow

For my own needs i added three tags in the call. First and second tags are the longitude and lattitude. This way i can update my place of beiing very easy. Third tag is the api key. Just for sure if they change the key.

Then I have to extract the data this way

In my case $data[3].temp gives the position where temp(temperature) can be found in the json file. [3] stand in my case for the third position and temp stands for the variable temp in the json file

hello @Marcel_Ubels,

I have a question, and I’m not getting anywhere with JSON.

I would like to add a condition to my sprinkler that if the predicted amount of rain from the national weather service is greater than 0, the sprinkler will not start.

I have the url for the query to the weather service for the next 5 days:

http://daten.buergernetz.bz.it/services/weather/district/6/bulletin?format=json&lang=de

This is the result, where I need the value marked in yellow:

How can I query it and then save it in a variable which I can then include as a condition in the flow?

I have installed the app HTTP request flow cards, but I don’t quite check it :frowning: Must be with GET JASONpathis…

Do i have to install betterlogic by force or can it be done with the normal logic variables?

Thanks

Philipp

First you have to make a flow to get the data from your weather service. This is the Get json Trigger object. In that flow you give this get request a name. For me it was Weerupdate12uur. You can give it any name you want, but with that name we can extract the variables in the next flow. In the following flow you call Weerupdate12uur and extract it into variables. You have to use better logic.
It is a bit trial and error how to. You could try
$.data[0].rainto

hello @Marcel_Ubels,

i’m to stupid :slight_smile:

I created 2 flows, the first calls the weatherdata.

I’m not sure what to insert in the search field and in the green json field als variable? Do i have to make a variable first in better logik?


Thanks a lot

You first have to make in better logic the variable Regenmenge heute. The get request i called it Niederschlagmenge because i assume you can only put in one word and not more words.

Then the flows this way

The tricky part is to find out if $.data[0].rainto is correct

The number 0 stands for the place where the variable can be found. I had a json file with a 24 hour forecast. At 08:59 the 9 hour forecast was found at 0, the 10 hour forecast at 1, etcetc

hello @Marcel_Ubels,

i did exactly how you sayed:

But i always get this error message:

Thnaks

Philipp

Can u also try to start the flow instead of test the flow?

1 Like

it works, i pressed test, thanks