Specify a Range in Variable?


#1

Not sure if I’m explaining myself correctly or not. But I’m trying to setup a piston that uses smart weather tile saying if wind goes above a certain speed to do X. Problem is these are the only options for wind.

So I was wondering if I could use changes to or even stays and then specify a range of wind speeds somehow?


#2

As far as I know, wind cannot be a trigger. (it literally changes speed every second)

Normally, I grab the wind speed on a timer (Every X min), then dump into a variable, and do my comparisons based on that variable.


#3

Also, the driver is probably not giving you an integer, you’ll need to integer() that value.


#4

Got an example?


#5

Is there a way to do that after the fact? So would I do something like if wind changes then set variable to weather station : wind then use the variable in something like if variable rises above? Question with that is I thought variables couldn’t be used as triggers?


#6

Not really one I can share… My wind piston has grown into a complex beast… It grabs the current wind speed every 10 minutes… stores it in a rotating array… and then does a bunch of math comparing the last 7 dataPoints from the previous hour. (high / low / average / trend etc)

Finally, it draws the tile, and dumps the current data into a fuel stream.


#7
  • Local variables can be used as conditions (IE: is greater than X)
  • Global variables can be used as conditions OR triggers (IE: rises above X)

#8

Thanks so much I didn’t know globals could do that. So would the example I used in my last comment work then?


#9

This trigger will be the challenge:

IF wind changes