New plugin: rain prediction sensor

See attached the files for a rain prediction sensor. The sensor is based upon a normal sensor. When rain is predicted within a configurable about of time, the sensor will be tripped. The sensor stays tripped until it stops raining. I personally use the sensor to close the sunshades and it works perfectly.

The sensor has two variables to configure (using the advanced tab)
RainTreshold: minimum amount of rain to fall before the sensor will be tripped. Default is value 78 which is just light rain
WarningTime: amount of seconds to warn ahead. Default 600 seconds (10 minutes)
Location: without a value, the sensor will use the configured lat/lon coordinates of vera. These can be overruled. example value:lat=56.1234&lon=4.12654

The variables below can be used by others (beside the ‘tripped’ variable)
RainAmount: amount of rain predicted
StartRain: time it will start raining
StopRain: time is will stop raining

How does it work:
The rain sensor uses data from buienradar.nl to get the rain prediction for given lat/long location. As far as I know this data is only available for the Netherlands. If other sites are available, it’s probably not hard to recode the plugin to support those sites also.

How to install:

  1. Unzip the archive
  2. Upload all files to vera using Apps->Develop Apps->Luup files
  3. Apps->Develop Apps->Create device
  4. At Upnp Device Filename: fill in ‘D_dutchRainAlarm.xml’
  5. Click ‘Create device’

Good luck

Maybe you can add a rain icon to the device (eg the one from the Humidity sensor)

Never mind, I see it has the motion icon

This would be awesome if you could add Weather Underground support… which is what the “World Weather” plugin uses.

I just read the code. The buienradar has a page with predictions in text form which makes it possible to make this plugin. So if weather underground has something like this it is possible.

this is what you need

What about a snow version ;-p

Where can I get this app?

bfromdruten terrific app, just what i needed to close and open my window covers (markies ;)).
is it true that by default (after installation and no rain) the device is marked as triggered ?

Again a plugin from bfromdruten for something I was looking for. :smiley: I noticed like speeksel it shows tripped after install and I found that is because startRain is zero in that case. Made a simple change as below on row 130. Now waiting for rain so see I did not brake anything else ;).

if (tonumber(startRain) > 0) and ((currentTime + warningTime) >= tonumber(startRain)) and ((tonumber(stopRain) >= currentTime) or (tonumber(stopRain) == 0)) then

Now get this in my blinds control as well.

cheers.

Hi,
I found that on UI7 you could not Arm/Disarm de rain alarm. For some silly reason you have to implement that action in UI7 where in UI5/6 that was implicit.

So on UI7 this should work with Arm/Disarm. Waiting on an alert to see if it all is working as expected.

Cheers Rene

Hi Rene,

Does this plugin work OK for you ? And does Buienradar give reliable predictions on when rain is going to start ? I am also Dutch and would like to use this plugin for opening my screens when before it’s going to rain.

Hi Mai,

I am using it on the latest UI7 version running just fine. Buienradar does give some false positives (not this plugin fault) so the screens go up when it is not raining. It has not yet happened that it did rain and my screens stayed down, but that can also be because the sun level I also use dropped below the threshold I have set. I have not found a better way to check for rain and don’t mind the few false positives.

Chrees Rene

Hi,

I just found that buienradar changed the URL for this service. This updated file should make it work again.

Go to Apps > Develop Apps > Luup Files > Upload and upload the attached file to your Vera.

Cheers Rene

Are there any settings required to use this plug-in? e.g. Location!
Just uploaded the zip file from the start of this topic along with the updated file in Rene’s post from 1st Nov. '16.
Unfortunately, alarm stays ‘0’.
Is the app still up to date with buienradar? Any guidance (Rene?) would be appreciated for identical application, i.e protecting fabric sun blinds 8)
Rgds
Dick

Is this topic, plug-in, dead or is there by any chance some experience to report to assist in getting this to work!

Hi,

It should work without any need for settings other then documented in the first post. It is still working for me.

Cheers Rene

Currently it rains. StartRain, StopRain are fileld in, so also RainAmount =170. With a Rainthrashold=1, Warningtime=1, IgnoreTripTime=2 - I still don’t get a trip, i.e Tripped=0.
What am I doing wrong? Any help would be appreciated.
Dick

Hi Dick,

Can you look at the Vera log file? You should see a regular http request to the buienradar api to get the data. You should see something like this
luup.call_timer:63: interval: time=2m, days={}
luup_log:63: RainAlarm refreshCache: http://gadgets.buienradar.nl/data/raintext?lat=52.088000&lon=4.959840
luup_log:63: RainAlarm Successful execution of URL rss=000|19:40 000|19:45 000|19:50 000|19:55 000|20:00 000|20:05 000|20:10 000|20:15 000|20:20 000|20:25 000|20:30 000|20:35 000|20:40 000|20:45 000|20:50 000|20:55 000|21:00 000|21:05 000|21:10 000|21:15 000|21:20 000|21:25 000|21:30 000|21:35

Cheers Rene

Oeps! The following error message emerged from suggested investigation rout:
07/19/17 19:16:07.636 luup_log:116: RainAlarm Unsuccessvful execution of URL returned status=-1 <0x75558520>
What next?

Hi Renee,
your info put me at work. I deleted the Location override details put into the plug in’s variable list. Now the plug in relies on the location settings of the VERA EDGE with the following result:
50 07/19/17 21:41:38.106 luup_log:116: RainAlarm refreshCache: http://gadgets.buienradar.nl/data/raintext?lat=52.270000&lon=5.140000 <0x7569e520>
50 07/19/17 21:41:38.124 luup_log:116: RainAlarm Successful execution of URL rss=000|21:30 000|21:35 000|21:40 000|21:45 000|21:50 000|21:55 000|22:00 000|22:05 000|22:10 000|22:15 000|22:20 000|22:25 000|22:30 000|22:35 000|22:40 000|22:45 000|22:50 000|22:55 000|23:00 000|23:05 000|23:10 000|23:15 000|23:20 057|23:25

Thanks a lot for putting me on the right footing!
Rgds
Dick

Glad you got it working.

Cheers Rene