How to obtain weather data?

Searching through the forums I’ve found a lot of data but also confusing information.

I’m looking for a way to pull in weather data to determine rain. If it rains turn on a virtual switch and if no rain turn off a virtual switch.

A couple of ways to do this..

If you just want rain (yes/no) then there are lots of homebrew ‘hacks’ to modify water sensors to use then as rain sensors.
Here’s one I made for smartthings but I now use it on HE

If you want other features and don’t own a PWS (personal weather station) then probably the quickest way to get the data is with an ‘Apixu’ driver.

You just use this code and create a new virtual device using this driver.

If you do have a PWS then you can use weewx (weewx.com) or you can push your data to Weather Underground (weatherunderground.com) then use my driver:
[Updated] Weather Underground Driver - New API

All of these weather devices can be used with one of my apps: ‘Weather Switch’ to turn on/off a switch at a certain rain level or just if there is any rain (or not)

http://hubitat.uk

Andy

Okay awesome. Looks like I have everything setup.

What is the threshold for rain? I put in 5? What is that, 5 inches of rain or more? I'm confused.

It’s just an number without a unit.
So if your device reports in mm then it would be 5mm as you have configured it.
If your device reports in inches then you may want to put 0.25 or similar

Andy

Does it pull it from this?

  • percentPrecip : 0.03

Is that the apixu driver?

You should look for the attribute which shows the amount of rain now or the rain rate

Yep.

I'm thinking it pulls from this. And takes the mm=7.6 data.

orecastPrecip : {date=2019-06-13, precipDayMinus2={mm=999.9, in=999.9}, precipDayMinus1={mm=999.9, in=999.9}, precipDay0={mm=7.6, in=0.3}, precipDayPlus2={mm=0.8, in=0.03}, precipDayPlus1={mm=7.6, in=0.3}}

When does this run? I want to see if it's engaging my virtual switch or not.

Is there a manual way to run it?

I have no idea! :slight_smile:

I didn’t write this driver.
You should contact the author on his thread if you have any questions regarding this.

Andy

Was referring to your app. When does it check the weather for rain?

It doesn’t
It monitors the device.
When the device attribute changes, it will react to that

Andy