Having trouble making a piston react to a device's status


#1

Hi. I’m trying to make a piston turn on a switch called “Cleaned” (Switch 8) whenever my Neato Robot vacuum (Switch 15) has cleaned my house for more than 15 minutes.

I tried to make a piston based on Neato’s switch (on/off) status, it didn’t work, so @eibiyer helped me understand how to use the Evaluation Console to know a device’s status, and I used that to know which was the expression that the Neato communicated to SmartThings. It worked for a while but it doesn’t always work.

Every time I go to the Evaluation Console and ask it the device’s status, it shows me the current status (it only shows “cleaning” or “ready”). This has a 2-3 minute delay but then it shows the correct value.
These are the expressions that I tested on the Eval. Console:

And this is the current piston. I tried setting its trigger based on the switch’s status again, but it didn’t work. Any ideas of what could be happening here?

Thanks,
Rodrigo

Edit: It takes a minute or two for the expression to change from “cleaning” to “ready” or vice-versa, but I don’t know how this could affect the piston, a full house clean takes 37 minutes so ±3min shouldn’t be a problem.


#2

Just reporting back after my experience, after many tests I concluded that this method is extremely buggy, at least with my setup. It seems pretty simple but it works less than 10% of the times.

I tried a different method:

If Neato switch changes to ON
then
WAIT 15 minutes
If Neato switch is ON
(Then turn on switch and send push notification).

Now it’s working the way I intended :slight_smile:
R.


#3

You could also try a single trigger:

If Switch 15’s status stays ‘cleaning’ for 15 minutes


#4

Thanks, I’ll try that.

One question: Is there any way to make the piston send the notification only when the switch is turned off?

The original idea was great, if the switch turned off and also if it had been on for the last 15 minutes, it would send the push notification. I don’t know why it didn’t work, but if it worked it would have sent the notification at the end of the process, and now it’s sending it when 15 minutes have passed since the start of the process (even if the process takes 1 hour).

Thanks!
Rodrigo

EDIT: I’m guessing it didn’t work because when it checks the “if it was on for 15 minutes” the switch’s state is already off since maybe a second ago?