Rain Alert UK

Hi guys,

I'm looking for a way for Hubitat to know when it's raining at my location in the UK and then to flip a vSwitch that checks for open windows and doors using @Cobra 's great open contacts app.

I've been reading through the forums this morning and between the weather services that don't support the UK and the deprecated apps that you can no longer get API keys for i'm not sure which way to go.

I have had IFTTT alerts for rain setup for ages but they don't do anything except sent me a pushover notification when it's raining at my house. Is there a way to make that IFTTT notification flip a hubitat switch through WebHooks etc? or is there a more hubitat centric way to do this?

I have a physical device that I use
It's not cheap, and a little bit of soldering is involved but it works perfectly
(Even for a few drops)

I use this with 'check open contacts' and also an app I use to control my conservatory skylight windows.

I connected one of these:

to a z-wave contact sensor..

Then I used a cheap Chinese voltage regulator so that I could power it all from a little 12v dc PSU
(I put the contact sensor and voltage reg inside a little waterproof box and glued the rain sensor on the top)

Andy

1 Like

Have you considered creating a met office api driver?

That would be great if I had any experience in coding :wink: i'm looking to get into learning to create my own drivers etc but currently i'm trying to work full time and home school a 5 year old so haven't time to learn Groovy hahaha

yeah I'm working full time a home school 3 of the darlings. The wife has really clamped down on my play time

I bought my Hubitat in lockdown as the wife kept saying, "why can't your smart tech do xyz...."

So I bought Hubitat and now it can do pretty much anything she wants haha, I just need to find a way to get these rain alerts live then I can move onto whatever the next project is,

I need to understand webhooks better as I have WeatherUnderground live rain alerts coming to my phone from IFTTT so i'm wondering if I can use that to trigger a switch on Hubitat.

I use one of those too ..... it's definitely cheaper now than when I bought it 3 or 4 years ago (somewhere over £70 IIRC).

These are really good devices because they contain a heating element too. What that means is that they can also reliably detect "not raining" as well, because the heating element helps to dry out any wetness that's sat on the contacts.

I used more passive sensors in the past and they would often take several hours to dry out which meant that they weren't very reliable. Those also tended to go rusty quickly as well, whereas this one is still going strong after many years.

Also have a mixture of rain gauges (Oregon and Netatmo) which tend to be a bit hit and miss too (as you have to interpret a movement in measurement as raining "now").

1 Like

Holy moly, for most of you guys this probably isn't a big deal but for me this was the first thing i've "built" for myself in Hubitat. AS mentioned I have rain alerts through WeatherUnderground in IFTTT. This afternoon I've managed to link through WebHooks to MakerAPI for when the rain alert is issued by IFTTT, then webhook flips a switch.

This is the part i'm still not sure about, I have makerAPI working in that I can drop the URL and change the command to on?{ACCESS_TOKEN}

The part i'm not sure about is in IFTTT I don't know if I need to be specifying a Method/Content Type etc. So long as the URL i've put in there is accessed MakerAPI will switch on the switch and then Hubitat switches is off automatically a second later. I've built this into Rule Machine so that when the virtual switch is flipped by MakerAPI it issues a Pushover notification and also, using EchoSpeaks says "Rain is due Starting Security Check" and then it flips the virtual switch for The Open Contacts app from Cobra.

1 Like

OK so I checked the IF section to be a virtual button in IFTTT to test it and fired it off with it set to GET and the rest blank and it triggered just like I wanted. So i've set the IF portion to be WeatherUnderground rain alert and hopefully when it next rains it should trigger the alert in Hubitat.

Care to go into detail in how you did it?

As an easier way couldn't you just create a new recipe in IFTTT to say if the weather underground indicates rain, then flip virtual switch in Hubitat

That is essentially what i’ve done, if WeatherUnderground issues a rain alert to IFTTT for my location then IFTTT will access a MakerAPI url from hubitat that flicks a virtual switch.

Ah ok, but there is a Hubitat skill built in IFTTT so you could bypass the webhook and use the skill direct. Unless I'm missing something

Well done though. One of the fun things about this stuff is finding our own ways of doing things, even if webhooks were a bit ott this time you now know how to configure them, they open up a world of possibilities for stuff that doesn't directly integrate.

1 Like

Ahh, well that is handy! Didn’t know that!

I set it up, bit several times I found it was raining for 10 minutes before the notification

Same, think that’s a weatherunderground problem

It's a shame because it almost does what I want, and the Hubitat and IFTTT portion are working great, I just need something to trigger the weather alert more reliably. I think I might invest in an actual outdoor rain detection device to get 100% accuracy. Could then take IFTTT out of the equation as well potentially.

I guess they will never be specific to your location unless you get the specific device.

The only way to get data specific to your location is to host some kind of device.
Either a rain sensor of some kind or a weather station

Andy