# Logic - getting data from the weather API

**URL:** <https://community.homey.app/t/logic-getting-data-from-the-weather-api/67685>\
**Category:** Flows\
**Tags:** homey-bridge\
**Created:** [August 21, 2022, 10:46am UTC](https://community.homey.app/t/logic-getting-data-from-the-weather-api/67685 "2022-08-21T10:46:33Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Damian](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@Damian](https://community.homey.app/u/Damian)\
**Post date:** [August 21, 2022, 10:46am UTC](https://community.homey.app/t/logic-getting-data-from-the-weather-api/67685/1 "2022-08-21T10:46:33Z")

</div>

Hi

I’m new here and I have a question if I can do the following automation with Homey Bridge

1. Access to the weather provider’s API address

2. Receives the following answer from him

{“coord”:{“lon”:20.996,“lat”:52.177},“weather”:[{“id”:802,“main”:“Clouds”,“description”:“zachmurzenie małe”,“icon”:“03d”}],“base”:“stations”,“main”:{“temp”:27.78,“feels\_like”:29.13,“temp\_min”:24.69,“temp\_max”:30.4,“pressure”:1007,“humidity”:60},“visibility”:10000,“wind”:{“speed”:3.09,“deg”:120},“clouds”:{“all”:40},“dt”:1661078863,“sys”:{“type”:2,“id”:2000452,“country”:“PL”,“sunrise”:1661052552,“sunset”:1661104176},“timezone”:7200,“id”:753571,“name”:“Zbarz”,“cod”:200}

1. I would like the downloaded data, eg feels\_like, humidity

and in effect, for example, variable #weatherhumidity would be equal to 60

were saved as variables in Homey Bridge

Is it possible?explain the working of specific Flows in homey.

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [August 21, 2022, 1:45pm UTC](https://community.homey.app/t/logic-getting-data-from-the-weather-api/67685/2 "2022-08-21T13:45:52Z")

</div>

Hi,  
you can use built in Logic cards for http request (getting JSON as result) and parsing your JSON to extract the needed field as numeric tag. This example uses AdvancedFlows. Therer you can execute several action cards and use the result from the card before as input tag in the next tag. This way you can extract several JSON fiels into tags in only one flow. I think, these JSON cards are only available in AdvancedFlows and should be available on HomeyCloud, too.

![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/3/53f7ef7e0c71be92e4b04f7ab4e8d6653f511da5.png)  
The red arrows are showing the tags which are passes between the cards.

You can find these cards in the Logic area:

 ![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/c/6cb25ddda73c20a174a300cfd85e51da10aaf8d8.png)

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [August 21, 2022, 1:49pm UTC](https://community.homey.app/t/logic-getting-data-from-the-weather-api/67685/3 "2022-08-21T13:49:39Z")

</div>

I think Adv.Flows is a Pro only option, Ronny.

This AND card is available  
(An Http request’s status code is…)

 ![Screenshot_20220821-155233_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/c/ec5153477aeb76ab62000772f8d4e1820fca41df.jpeg)

But that isn’t useful for this case…

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [August 21, 2022, 1:54pm UTC](https://community.homey.app/t/logic-getting-data-from-the-weather-api/67685/4 "2022-08-21T13:54:11Z")

</div>

Oh, too bad. Then my example is not useable for cloud.  
Are http cards existing in HomeyCloud? The JSON cards aren’t.

PS: with the simple http cards you can get a http code, but the body too? But then you will have the JSON as string.

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [August 21, 2022, 1:59pm UTC](https://community.homey.app/t/logic-getting-data-from-the-weather-api/67685/5 "2022-08-21T13:59:25Z")

</div>

Yup, there’s a Get/Post/Put/Del http request action card with url, headers and body. But no receive option…

---

<div class="post-metadata">

**Author:** ![Damian](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@Damian](https://community.homey.app/u/Damian)\
**Post date:** [August 21, 2022, 2:06pm UTC](https://community.homey.app/t/logic-getting-data-from-the-weather-api/67685/6 "2022-08-21T14:06:17Z")

</div>

I only have that at homey bridge

 ![Zrzut ekranu 2022-08-21 o 16.04.39](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/d/cd401abf8dd7665a3afb9b10c505b53a43404945.jpeg)

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [August 21, 2022, 3:04pm UTC](https://community.homey.app/t/logic-getting-data-from-the-weather-api/67685/7 "2022-08-21T15:04:37Z")

</div>

Hm, I don’t think it’s possible on HomeyCloud. You can call a http GET, but I can’t see how you get the result because there is no trigger card in Logic part.

---

<div class="post-metadata">

**Author:** ![Damian](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@Damian](https://community.homey.app/u/Damian)\
**Post date:** [August 21, 2022, 3:19pm UTC](https://community.homey.app/t/logic-getting-data-from-the-weather-api/67685/8 "2022-08-21T15:19:12Z")

</div>

I did a workaround for this, I have a script that reads the data and puts it into variables using Logic Webhook, unfortunately each separately, and it has its limitations (max 5 calls per minute) but it seems to work fine.

I also have another question, do you know when Home Bridge will be the official version? Beta was due to end earlier this year, and it’s September.

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [August 21, 2022, 3:22pm UTC](https://community.homey.app/t/logic-getting-data-from-the-weather-api/67685/9 "2022-08-21T15:22:07Z")

</div>

> [@Damian](#):
>
> do you know when Home Bridge will be the official version

Only Athom could answer this… But as I read on Slack channel, Atom is extensivly testing HomeyCloud to end the beta state.

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [August 21, 2022, 5:01pm UTC](https://community.homey.app/t/logic-getting-data-from-the-weather-api/67685/10 "2022-08-21T17:01:54Z")

</div>

> [@Damian](#):
>
> I did a workaround for this, I have a script that reads the data and puts it into variables using Logic Webhook, unfortunately each separately, and it has its limitations (max 5 calls per minute) but it seems to work fine.

Nice to hear. Maybe share it here?

---

<div class="post-metadata">

**Author:** ![Damian](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@Damian](https://community.homey.app/u/Damian)\
**Post date:** [August 21, 2022, 7:29pm UTC](https://community.homey.app/t/logic-getting-data-from-the-weather-api/67685/11 "2022-08-21T19:29:35Z")

</div>

> [@Peter\_Kawa](#):
>
> Nice to hear. Maybe share it here?

My method is complicated, but it works

1. I have created an account at [SharpTools - Intuitive Dashboards, Powerful Automation](https://sharptools.io/?referralToken=e3142bcc-8e9c-4273-9ce2-5ac9138e6fab)

SharpTool works mainly under smartthings and has no direct integration with Homey.

1. I added weather API queries using rules and variables

2. SharpTools allows you to get a query (read and save as variables)

3. In the rules I ordered the read parameter to be saved as a variable

4. I inserted the variable at the end of the link that is generated in HomeyBridge in logic

5. Saves the parameter from the link as a variable in homey

6. Unfortunately, each parameter requires a separate link, you can make a maximum of 5 link calls per minute, so I recommend that you use a delay between inquiries, e.g. by 30 seconds.
