Flash a light in response to a leak detected


#1

Baz2473 thank you for the help that you have already provided me.

I am trying to do this simple piston and yet I not able to fully succeed.

This is doubly frustrating in that in my career (retired 11 years) I did a lot of embedded system, real-time, interrupt driven programming (in “C” and/or Assembly) where our time utilization budgets were tight and needed to be carefully managed. That said, I find that the Wiki and my knowledge of the IoT system is not sufficient to get me where I need to be.

Piston Sketch:
Detect if either of my two leak sensors is wet and if so flash an outlet.
A leak is already being detected and reported via SMS and Push Notification so that part is fine.
However, I would like to add a local annunciation with a flashing light.
I’m able to trigger the flash task but not able to make it persist during the wet event (or at least for 30 minutes after the wet event trigger).

If you are so inclined, your help is very much appreciated.

Be well.

Cheers,
Ray


#2

You should be able to take this attached example and modify for your use. In this piston I get a PUSH message after the light has been on for 10 minutes and then every 10 minutes if it remains on. The message also calculates how many minutes for each message since the switch was originally on.

Basically you’re looking to do a repeat loop. To get repeat loop commands you want to turn on Advanced Statements by clicking on the cog in the upper right in edit mode.


#3

Sorry I forgot to include what I have but is not working. However, I will also look at what you have suggested. Thanks

I’m still a bit of a rooky so be patient.


#4

We’re all here to help each other. No worries.


#5

Are you trying to flash a smart bulb, a dimmer, or a switch? I strongly recommend against flashing switches since that will drastically shorten their life span (they include mechanical relays). Some smart bulbs like the Osram full color bulbs provide a native flash function called blinkOn() / blinkOff() that makes the bulb flash indefinitely. As for the simulated flash in webCoRE - have you tried increasing the number of cycles to a higher number? That will make the bulb flash seemingly indefinitely, which should stop when the condition changes.


#6

Thanks, that’s an apt piece of information regarding the output module having a relay.

I will get what I have working, as is, stretch the one/off duty cycle (to minimize cycles, also leaks hopely are not a frequent occurrence) and change to a fully semiconductor driven lamp in the future.

Thanks for your feedback.


#7

Why does this not continue to run/flash until the control variable is decremented to zero?


#8

Try changing from dynamic to integer.

Also a for loop might be more suited for this


#9

Example posted above.


#10

Why not use a while loop?

While
Water sensor is wet, light (outlet) flash

See the second chunk of this Piston, the while loop, it may help.

Basically we have a closet where the cat box is. We want to know if it gets closed, and reminded if it stays closed.

This does exactly that.
The first chunk isn’t meant to be obnoxious as sometimes we close the door for a reason, after an hour, every hour it’s meant to be a neusence so we go open it.


#11

I suggested the for loop because he had the counter in there


#12

This is useful information, thanks. I have a piston that fires off some flashing lights in my house but I’m unable to stop the flashing once it starts. This piston is only going to fire very sporadically, in a rare alert condition, so I don’t anticipate it will kill the switch too prematurely.

If you use the simulated flash command to have a light switch flash say 50 times… how exactly do you stop before it flashes all 50 times if the alert condition changes? Is that even possible, or should i “hard-code” a faux flash while loop using Turn On/Turn Off commands with a break when the alert condition changes?