# Rain Intensity in REST API

**URL:** <https://community.tempest.earth/t/rain-intensity-in-rest-api/8467>\
**Category:** Developers\
**Created:** [August 6, 2020, 12:57am UTC](https://community.tempest.earth/t/rain-intensity-in-rest-api/8467 "2020-08-06T00:57:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericrowespam](https://avatars.discourse-cdn.com/v4/letter/e/ac91a4/32.png) [@ericrowespam](https://community.tempest.earth/u/ericrowespam)\
**Post date:** [August 6, 2020, 12:57am UTC](https://community.tempest.earth/t/rain-intensity-in-rest-api/8467/1 "2020-08-06T00:57:42Z")

</div>

Apologies if this is somewhere that I can’t find… I’m trying to set some alarms when it starts raining (trying to get Alexa to yell at me if the door/windows are open), but I can’t find the rain intensity as shown in the app in the REST API. I’m currently doing it based on an increasing precip\_accum\_last\_1hr value, but this is less than ideal as it not only lags but could go down after the first hour. What am I missing? Is there another value in the REST API I could use for this?

---

<div class="post-metadata">

**Author:** ![GaryFunk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/garyfunk/32/5729_2.png) [@GaryFunk](https://community.tempest.earth/u/GaryFunk)\
**Post date:** [August 6, 2020, 1:01am UTC](https://community.tempest.earth/t/rain-intensity-in-rest-api/8467/2 "2020-08-06T01:01:07Z")

</div>

It is a calculated value.

---

<div class="post-metadata">

**Author:** ![ericrowespam](https://avatars.discourse-cdn.com/v4/letter/e/ac91a4/32.png) [@ericrowespam](https://community.tempest.earth/u/ericrowespam)\
**Post date:** [August 6, 2020, 1:47am UTC](https://community.tempest.earth/t/rain-intensity-in-rest-api/8467/3 "2020-08-06T01:47:06Z")

</div>

I see it now, thank you, based on 1 minute accumulation. It doesn’t look like that value is available via REST either, so it appears I’ll need to implement a UDP or Websocket listener. Odd though that it’s in the app that is obviously not using a UDP listener, but I can’t get that data via REST. I would have assumed the app was using the REST endpoints.

---

<div class="post-metadata">

**Author:** ![GaryFunk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/garyfunk/32/5729_2.png) [@GaryFunk](https://community.tempest.earth/u/GaryFunk)\
**Post date:** [August 6, 2020, 2:05am UTC](https://community.tempest.earth/t/rain-intensity-in-rest-api/8467/4 "2020-08-06T02:05:10Z")

</div>

It’s calculated in the application.

The applications use a combination of the REST API and web socket to retrieve the raw data.

---

<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:** [August 6, 2020, 7:55am UTC](https://community.tempest.earth/t/rain-intensity-in-rest-api/8467/5 "2020-08-06T07:55:42Z")

</div>

The 1 minute rain accumulation data is available in the REST API and the websocket - in the obs array it is index 12 for Tempest and index 3 for SKY. To get the current rain intensity, just multiply this value by 60.

You can view all the fields in the REST API here: [https://weatherflow.github.io/SmartWeather/api/swagger/](https://weatherflow.github.io/SmartWeather/api/swagger/). Click “Expand Operations” in the top right.

---

<div class="post-metadata">

**Author:** ![ericrowespam](https://avatars.discourse-cdn.com/v4/letter/e/ac91a4/32.png) [@ericrowespam](https://community.tempest.earth/u/ericrowespam)\
**Post date:** [August 6, 2020, 3:57pm UTC](https://community.tempest.earth/t/rain-intensity-in-rest-api/8467/6 "2020-08-06T15:57:18Z")

</div>

Aha - I get it now! Thanks everyone - I was overlooking the difference between station observation and device observation. I needed to be looking at the device observation to get the raw data like short term rain. Now I just need to wait a few hours for the next monsoon to blow through to test out the updated code. Thanks!

---

<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:** [August 6, 2020, 4:03pm UTC](https://community.tempest.earth/t/rain-intensity-in-rest-api/8467/7 "2020-08-06T16:03:51Z")

</div>

Glad you managed to find a solution. I didn’t realise you were using the station observation endpoint rather than the device observation endpoint. Either way, the 1-minute precipitation data is still available from the station observation endpoint. In the `obs` array there is a field called `precip`. This should be the value that you want.

For example, here is a snippet for the latest observation from my station. I have highlighted the precip field with \*\* \*\*.

```auto
"obs":[{"timestamp":1596729556,"air_temperature":27.0,
"barometric_pressure":1008.2,"station_pressure":1008.2,
"sea_level_pressure":1017.0,"relative_humidity":63, **"precip"** :0.0,
"precip_accum_last_1hr":0.0,"precip_accum_local_day":0.0,
"precip_accum_local_yesterday":0.0,"precip_minutes_local_day":0,
"precip_minutes_local_yesterday":0, .....]

```
