Sensor piston help


#1

1) Give a description of the problem
I have a piston that will set the status LEDs on my HomeSeer switches if any of the water sensors detects water. I want to add some features to it:

  • Detect which sensors are wet, and include that information in the text message that is sent.

  • In the branch that sends updates every five minutes, do the same thing - detect which sensors are wet and include that information in the text message.

  • Generate a voice announcement over my Echo devices announcing that water has been detected, and at which sensors.

2) What is the expected behaviour?
See above

3) What is happening/not happening?
The piston works as written, I just want to add functionality.

4) Post a Green Snapshot of the piston

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

This would be done by adding a variable for the Line 32 devices to store to. Make a variable labeled wet device or similar. Make it a device variable but dont select a device. On the Line 32 IF when selecting devices, click the cog wheel and select the store matching devices to variable and select your previously made variable. So now that is storing that device into that variable that matches the wet state. From there you can include that variable in the text message to let you know which one tripped.

Reference same variable as above.

Just add another statement with action in the IF blocks you want to react on and select your speaking device. You could probably use the same message you are using for the SMS. Might even be able to make that message a variable string, apply that as the message in both SMS as well as speaking commands and you would have less code to write!


#3

Had some extra time so imported yours and made some of the changes I talked about. Also consolidated the sensors in a variable up top so you wouldn’t have to keep messing with device lines in multiple locations. Moved the 5 minute repeat into the first IF so that it could also pull the variable of which sensor tripped.

Fill out the Devices_To_Monitor variable with your water sensors and redo items that didnt transfer over for me like piston’s etc. See if this works for you.


#4

Awesome, thanks, I’ll try it out tonight!


#5

Finally getting to mess w/this … busy time of year! A couple of questions:

  1. Why did you add the delay at the start of the “got wet” routine?
  2. How do I add my Echos so I can use them as speakers? Currently they aren’t available in any way through my ST app so I can’t add them to webCore.

Thanks again for the help!


#6

That is in a WHILE block, so essentially, a SMS is sent every 5 minutes there is moisture…
(I usually do the SMS command first, and the WAIT second, for a quicker first alert)


This is the method that I use. It takes about a half hour to setup initially, but all future edits only requires a single character here in webCoRE to send a voice alert to Alexa (or any other speaker!)