Turn off Halloween blowups in high wind


#1

1) Give a description of the problem
I would like a way to monitor wind speed and turn off a switch when wind above a certain speed. (i dont own a

2) What is the expected behavior?
i have done other pistons with temp but not wind speed so looking for the best and easiest solution

3) What is happening/not happening?
Havent started this piston yet, looking for advise first

**4) Post a Green Snapshot of the piston![image|45x37]
NA

5) Attach any logs (From ST IDE and by turning logging level to Full)
NA


#2

have you looked at the weather information here and considered using the wind speed for this piston?

https://wiki.webcore.co/Weather#Wind_String


#3

As @bangali suggested, weather API should help you. Keep in my tho that depending on your location, the exactness of data might vary. I, for exemple, get wind spind that often vary by 15-20 km/h between each poll. Thus, you might what to implement a logic that check wether the wind seems sustained or not.


#4

Guess I need to back up a bit. I have done pistons with my devices at home using the basic piston, what do I need to do to call these wind variables?

Thanks for the help!


#5

the weather variables are system variables. so always available to any piston at runtime. think and refer to them as global variables except they are created, updated and managed by wC.


#6

So I need to first setup a global variable to pull wind speed?


#7

only if you need to store the value of wind speed from a previous execution. if you just need to evaluate it at piston execution time, just refer to those weather variables like any other read only system variable.


#8

Here’s a rough one… untested really as I am not sure how often the wind observation gets updated. I added a logging for the wind speed so you can see how often it gets updated. You can probably spice it up by adding time restrictions.

Edit: It was just pointed out that this wouldn’t subscribe to system variable change so I’d run it on a timer every so often if you want it to check the wind speed value in $weather. If you have WeatherTile installed, you can use that instead since the wind attribute can be subscribed to.


#10

Ok still being a complete n00bie here and was stupidly playing in CoRE and not WebCoRE. So I loaded your rough template in. If i am understanding it right it just checks if the wind goes up 3mph from whatever the current is?

Is there way to just say if current wind speed is grater than 15mph turn off? Also i did load the WeatherTile. Just have to figure out a way to test this out…or wait for real wind. :slight_smile:

Thanks for the help!


#11

Here’s another one I was playing with using WeatherTile… again, it can be improved/modified as you like.


#12

Ah that looks better since it’s subscribed to the weather event instead of checking with a timer.

So if wind speed goes over 5mph sustained for 2 mins it should turn off, right? Just making sure I am reading this all correctly.


#13

That’s the plan lol :slight_smile:


#14

First time I hear about WeatherTile. What is it? I’d like to know more if you can point me where I could read more. Thanks!


#15

Use the appropriate IDE url for your devices.


#16

Thanks! Do you happen to know the refresh rate? Being able to subscribe to it is nice but if the refresh rate is slower than what I’d do with a timer in webcore, there’s not much use isn’t it? Maybe there’s something I don’t see.


#17

No idea on the refresh rate but luckily the piston I was playing with is still running, it looks like the wind is getting an update every 30 mins… it looks like a timer with a refresh might do the trick.

10/10/2017, 2:52:38 PM +709ms
+1ms	â•”Received event [WeatherTile].wind = 9 with a delay of 94ms
+122ms	â•‘Current wind speed: 9

10/10/2017, 1:52:38 PM +860ms
+2ms	â•”Received event [WeatherTile].wind = 0 with a delay of 154ms
+163ms	â•‘Current wind speed: 0

10/10/2017, 1:22:38 PM +657ms
+1ms	â•”Received event [WeatherTile].wind = 1 with a delay of 163ms
+182ms	â•‘Current wind speed: 1

#18

Ok talk to me about a timer :slight_smile: I thought i could setup a piston to poll the weather tile but weather tile doesnt seem to be a option under polling.


#19

theres an updated version that i use for weather … nicer look and more data points:

edit: actually, i also use accuweather connect with this because individually neither of them provides all the data i am looking for.


#20

Thanks! I have the accuweather also but still new to this. I have added the RBoy app that refreshes weather tiles every 5 mins. Will see if that works…in about 4 mins from this post. :slight_smile:


#21

the smartweather station tile 2.0 supports polling … i think.