Turn off bug zapper if it might rain


#1

1) Give a description of the problem
(I want to create a piston that will turn off or not allow for the bug zapper to turn on during its normal on off period if its raining or if it might rain that day)

2) What is the expected behavior?
(bug zapper turns on @sunset and turns off at 11pm - but would like webcore to step in and turn off the bug zapper if its going to rain or if its raining)

I tried using twcweather but i cant figure out how to make it turn off a switch if its raining or will rain later.

*** I keep mentioning if it might rain since i rather not take a chance. If there is any chance of rain i would prefer for the bug zapper to just not turn on at all.

Any and all help is appreciated.
Thank You in advance.


#2

I would use $twcweather.forecast.daypart[0].wxPhraseLong https://wiki.webcore.co/TWC_Weather

Just remember :

Check for

“PM Showers”,
“PM Thunderstorms”,
“Rain”,
“Scattered Thunderstorms”,
“Showers”,
“Showers Early”,
“Showers Late”,
“Thunderstorms”,
“Thunderstorms Early”,
“Thunderstorms Late”

To paraphrase the code…

   If Time is between Sunset and 11 pm And
    $twcweather.forecast.daypart[0].wxPhraseLong is any of 
        PM Showers, PM Thunderstorms, Rain...
                Then with Bug_Zapper_Switch
                    Turn off

I am not sure if you can use the “is any of” comparison here. You may have to break it out into IF statements.


#3

Hi Pantheon,
Thank you so much for the advice. I will test it out and see how it works out.
Have a great day.


#4

Hm… I am trying to do the same. I would like the time lag to be less though and turn off the zapper as soon as rain starts. (Rain actually does not do anything to the zapper, it worked all of last summer - Just want to save energy when no bugs are around during rain)

I was thinking about monitoring if $twcweather.conditions.precip1Hour raises >0 and turn the zapper back on if it is =0 again. I am waiting for rain and testing …


#5

I can’t get this to work, anybody got a working piston they can share?
Thanks