# IFTTT raining trigger from REST API

**URL:** <https://community.tempest.earth/t/ifttt-raining-trigger-from-rest-api/13040>\
**Category:** Developers\
**Created:** [April 3, 2021, 12:58am UTC](https://community.tempest.earth/t/ifttt-raining-trigger-from-rest-api/13040 "2021-04-03T00:58:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cranbrook180](https://avatars.discourse-cdn.com/v4/letter/c/7bcc69/32.png) [@cranbrook180](https://community.tempest.earth/u/cranbrook180)\
**Post date:** [April 3, 2021, 12:58am UTC](https://community.tempest.earth/t/ifttt-raining-trigger-from-rest-api/13040/1 "2021-04-03T00:58:10Z")

</div>

The weatherflow IFTTT service has a trigger for when a station determines that it is raining. I’d like to reproduce that functionality based on the REST API. Given the different rain properties in the returned json I’m just not how to leverage them properly for this.

Thanks in advance for the help

---

<div class="post-metadata">

**Author:** ![peter](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/peter/32/1365_2.png) [@peter](https://community.tempest.earth/u/peter)\
**Post date:** [April 3, 2021, 7:55am UTC](https://community.tempest.earth/t/ifttt-raining-trigger-from-rest-api/13040/2 "2021-04-03T07:55:13Z")

</div>

You have got two options. If you want a near-instant notification that it is raining you can use the Websocket and listen for `evt_precip` messages. These will be sent when it starts reading. [WeatherFlow Tempest API Websocket Reference](https://weatherflow.github.io/Tempest/api/ws.html)

If you want to use REST API requests, your best bet is to pay attention to the `rain accumulation` field in Sky (index 3 of the obs JSON) and Tempest (index 12 of the obs JSON) [responses](https://weatherflow.github.io/Tempest/api/swagger/). This gives the amount of rain accumulated over the previous 1 minute. You’ll want to look for when that value becomes non-zero (i.e. it has gone from not raining to raining).

Hope this helps

---

<div class="post-metadata">

**Author:** ![cranbrook180](https://avatars.discourse-cdn.com/v4/letter/c/7bcc69/32.png) [@cranbrook180](https://community.tempest.earth/u/cranbrook180)\
**Post date:** [April 3, 2021, 12:42pm UTC](https://community.tempest.earth/t/ifttt-raining-trigger-from-rest-api/13040/3 "2021-04-03T12:42:05Z")

</div>

Thanks so much Peter. I was aware of the Websocket approach. But, monitoring index 12 of the obs JSON is exactly what I was looking for.

Thanks again
