# \[Solved\] Precipitation probability

**URL:** <https://community.openhab.org/t/solved-precipitation-probability/8007>\
**Category:** Off-Topic\
**Tags:** weather, webview\
**Created:** [February 26, 2016, 8:23am UTC](https://community.openhab.org/t/solved-precipitation-probability/8007 "2016-02-26T08:23:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![NCO](https://community.openhab.org/user_avatar/community.openhab.org/nco/32/55938_2.png) [@NCO](https://community.openhab.org/u/NCO)\
**Post date:** [February 26, 2016, 8:23am UTC](https://community.openhab.org/t/solved-precipitation-probability/8007/1 "2016-02-26T08:23:29Z")

</div>

All,

I would like to integrate the rain probability into the web layout of my weather webview.  
Unfortunately this doens’t seem to be very popular and I did not find any help yet.  
I tried to integrate the following as a start but it did not work.  
`<td class="temp-min">${forecast(4):Precipitation.probability(%.0f)}&deg;C</td>`

Does anybody have this in place already?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [February 26, 2016, 7:30pm UTC](https://community.openhab.org/t/solved-precipitation-probability/8007/2 "2016-02-26T19:30:22Z")

</div>

It might be that the binding or the weather service you are using doesn’t support getting that value that far out into the future. Have you tried it with forecast(1) or forecast(2)? The syntax doesn’t look off to me.

---

<div class="post-metadata">

**Author:** ![NCO](https://community.openhab.org/user_avatar/community.openhab.org/nco/32/55938_2.png) [@NCO](https://community.openhab.org/u/NCO)\
**Post date:** [February 27, 2016, 7:15am UTC](https://community.openhab.org/t/solved-precipitation-probability/8007/3 "2016-02-27T07:15:57Z")

</div>

You might be right, I gonna try that.  
In general it works as an item at least for tomorrow (forecast 1).

---

<div class="post-metadata">

**Author:** ![NCO](https://community.openhab.org/user_avatar/community.openhab.org/nco/32/55938_2.png) [@NCO](https://community.openhab.org/u/NCO)\
**Post date:** [February 27, 2016, 7:36am UTC](https://community.openhab.org/t/solved-precipitation-probability/8007/4 "2016-02-27T07:36:11Z")

</div>

I am using Wunderground an obviously it provides the precipitation data at least until forecast 4.  
However, the result in my webview looks like the syntax is not recognized:  
 ![](https://community-openhab-org.s3-eu-central-1.amazonaws.com/original/2X/c/c232dcc761301c2fa97f900d6064ad6122ed3d73.png)

Any other suggestion?

---

<div class="post-metadata">

**Author:** ![geva](https://community.openhab.org/user_avatar/community.openhab.org/geva/32/70821_2.png) [@geva](https://community.openhab.org/u/geva)\
**Post date:** [February 29, 2016, 12:25pm UTC](https://community.openhab.org/t/solved-precipitation-probability/8007/5 "2016-02-29T12:25:06Z")

</div>

You should try turning up the verbosity of the weather binding logging to see what it is coming back with them the call to update the item is made.

---

<div class="post-metadata">

**Author:** ![NCO](https://community.openhab.org/user_avatar/community.openhab.org/nco/32/55938_2.png) [@NCO](https://community.openhab.org/u/NCO)\
**Post date:** [March 3, 2016, 10:34am UTC](https://community.openhab.org/t/solved-precipitation-probability/8007/6 "2016-03-03T10:34:27Z")

</div>

Thanks, @geva

I get an error, but it doesn’t help a lot:

```
2016-03-03 06:14:14 [ERROR] [b.w.i.gfx.WeatherTokenResolver] - Invalid weather token: forecast(1):Precipitation.probability(%.0f)
java.lang.RuntimeException: Invalid weather token: forecast(1):Precipitation.probability(%.0f)

```

---

<div class="post-metadata">

**Author:** ![geva](https://community.openhab.org/user_avatar/community.openhab.org/geva/32/70821_2.png) [@geva](https://community.openhab.org/u/geva)\
**Post date:** [March 3, 2016, 11:02am UTC](https://community.openhab.org/t/solved-precipitation-probability/8007/7 "2016-03-03T11:02:23Z")

</div>

Having a look on the[Weather Binding wiki page](https://github.com/openhab/openhab/wiki/Weather-Binding), I see that the probability of precipitation is of decimal type, and you are referrencing it as a float. I wonder if this has anything to do with the invalid token message you are getting.

```auto
Number Precip_Probability "Precip probability [%d %%]" {weather="locationId=home, type=precipitation, property=probability"}
// new total property in 1.8, only Wunderground

```

I guess the other thing I am seeing is that the type mentioned in the item definition is all lowercase, whereas you are using an uppercase ‘P’ in your token name. You might try changing it to…

```auto
<td class="temp-min">${forecast(4):precipitation.probability(%d)}%</td>

```

---

<div class="post-metadata">

**Author:** ![NCO](https://community.openhab.org/user_avatar/community.openhab.org/nco/32/55938_2.png) [@NCO](https://community.openhab.org/u/NCO)\
**Post date:** [March 3, 2016, 12:14pm UTC](https://community.openhab.org/t/solved-precipitation-probability/8007/8 "2016-03-03T12:14:35Z")

</div>

Thanks so much!!!  
Both have been required to solve the issue!

---

<div class="post-metadata">

**Author:** ![geva](https://community.openhab.org/user_avatar/community.openhab.org/geva/32/70821_2.png) [@geva](https://community.openhab.org/u/geva)\
**Post date:** [March 4, 2016, 8:50am UTC](https://community.openhab.org/t/solved-precipitation-probability/8007/9 "2016-03-04T08:50:31Z")

</div>

👍 execllent!
