Weather + Philips Hue = Rain Alert


#4

Long term looking for own weather station but short term just looking at using WU.

Have played with IFTTT and can get it to flash lights when condition changes to rain however cant get them to flash a certain colour (i.e. blue) they only flash what ever the current colour is.

Help would be appreciated :slight_smile:


#5

@lanky8804 Keep us posted about how satisfying is the result. Might only be my area but when I tried that work around I found it not reliable/fast enough.

As for help with coding, i might have time to look into it later today.

In a nutshell:

  1. Make sure you install webhook service in IFTTT
  2. Put your webhooks ID in the dashboard setting page
  3. Create your IFTTT recipe (or install the one bangali is referring to.
  4. Create your piston. You will want to add a condition where in location you choose IFTTT executes … then actions like set colour, turn on, flash, turn off, set colour back to normal
  5. For the testing part, add another trigger, like a timer (happens every each 30 seconds)

#6

Thanks for the advice, sound exactly what I’m after.

New to webhooks and linking into Piston so coding help would be appreciated.

Am i correct in this:
IFTTT
If condition changes to Rain Then Webhooks (not sure what setting to input)

WebCore
If IFTTT executes Value (name of IFTTT???) Then change Hue bulbs etc


#7

On top of my head, yeah.

I don’t know how the ifttt app is made, but you’ll most likely be able to pass values to webcore thru the webhook.

Those values will be exploitable under $args in webcore. Don’t know which value you might wanna pass, depends on the ifttt app. Could be rain intensity for exemple.


#8

ok, need some ideas about what to input on these as new to webhooks etc.

Ingredient would be ‘Condition’ from the drop down that appears.


#9

In the webcore snapshot you got the URL to paste into webhooks and use post method. Data format would be json if I’m not mistaking.

In webcore, compare value is where you got to put the ifttt app name/label can’t remember and not on iPad to check.


#10

Btw, thanks for posting snapshots it really helps to help you while being on the road :slight_smile:


#11

here is executing a piston from IFTTT:

then in the piston use these variables from $args:

EDIT: this one was not specifically for rain but its more about IFTTT executing a piston (THAT) with variables passed in, when a WU trigger (THIS) is sent to IFTTT.


#12

Thanks for the help, so have created this. Does it look ok (no rain atm)


Get Piston State
#13

sure thing. you dont need the if condition, since this piston will get executed by IFTTT only when WU condition changes to rain. so drag the with statement to outside of the if and then delete the if and it should work.


#14

So had some rain and piston didnt work.

@bangali so if i drag my with statement out of the IF. Do i not need the “IFFFT executes ‘Rain’” part either?

Think the IFFFT is working ok as get notifications on phone but piston and light not appearing to do anything??

The URL in the IFFFT is correct isnt it?


#15

if you drag the with outside, you dont need the if statement.

its custom to you, so cant tell. :slight_smile: but look at the example i posted and match it to yours generally in format though your values will be different.


#16

So this is now what it looks like:

How does it link to IFTTT? As that URL was in the IF statement part?

Sorry if these are stupid questions and thank you for your help :slight_smile:


#17

there are no stupid questions only dumb answers /jk so, if the answer below is not clear enough, just ask again.

the piston is not linked to IFTTT. IFTTT links to the piston thru the URL you provide to execute the piston when WU triggers rain on IFTTT.

EDIT: the instructions on how to execute a piston from IFTTT is under settings … this section:


#18

Ah ok that makes sense.

Have edited URL as that was incorrect from now understanding this, shall now wait for rain LOL.

Thank you once again.


#19

time for the rain dance? :slight_smile:

you are welcome.


#20

you probably know this already, but you can take the same fully formed URL that IFTTT would generate with the params and just run it from a new window on your browser. if you dont send the params the piston should still execute just not find the params.

EDIT: actually i see that you are not using the ifttt passed in param, so the piston should just run fine even without the param.


#21

also, looking at your ifttt image, you will need something like this in the body:

{“condition”:"{{Condition}}"}

if you wanted to use the condition arg, so you can refer to it as $args.condition in the piston.


#22

I know this thread is old, but seems silly to add a new one. I’m trying to do something similar, when it rains (conditions showing rain in the last hour) a smart outlet turns on, turning on the floor fan plugged into it (heavy enough rain and we get a little water in one spot of our basement and I want to dry the carpet as quickly as possible). Then turn it off a day after it stops raining. I don’t need it to turn on right away or anything, so I think the 1 hour check is fine. I just need something like this until we can get the basement leak fixed.

OK, silly question, but since Accuweather is a “thing” and it shows up in my WebCore, can something this simple work (unknown device 1 is Accuweather)? Thinking through the process it seems like it should work, but it also looks too easy. I can’t really try it considering we’re in the dead of winter.


#23

No worries making a new thread. Reviving an old one will only show for the people who have replied in here. Making a new one will show as new and more eyes potentially.

I would bring your second if (line 26) out as a top level if statement instead of being stuck in the else statement of the first. Other then that it looks fine but won’t know for sure without testing