Pistons based on switches not working properly


#1

Hi. I’m having a problem that I’ve seen some times before, but now it’s happening more often.

Since almost a year I started using WebCoRE with my SmartThings Hub, some lights, blinds controllers, a vacuum cleaner and some more things. Most of my pistons are designed with many simulated switches that either enable the piston or makes it work in different ways.

For example, I have a switch Night Blinds that executes a piston that closes the blinds at night, which can be switched on manually, and it is also switched on by another piston at a certan time.

Another example is the robot vacuum cleaner, there’s a simulated switch called “neato run” that executes a piston that turns on the Neato in different modes (deep/normal/extra care) depending on other switches.

This system of switches that execute pistons has mostly worked fine for me. I’ve had some problems but my pistons were running smoothly until around a week ago, when I started noticing that more frequently, when a piston turns on a switch that is supposed to execute another piston, the piston doesn’t execute, and the action is not performed.

This used to happen to me but there was a reason, sometimes a piston would not turn off its starter switch after its action was completed, the starter switch would stay on all day, and when a piston tried to turn it on nothing would happen because the switch was never off, and the piston only starts when the “on” action actually happens.

This isn’t a problem anymore. I’m checking the ST history and the switches are turning of, BUT, when they are turned on by a piston, the action doesn’t perform. While writing this I noticed I should check at the moment of the problem if the piston last execution time changed, I’ll report back.

But anyway, it’s happening a lot. When I leave home I ask Google to turn off the switch that indicates my presence and defines the home/away statuses, the switch is turned off, the blinds start closing, but the Neato doesn’t run. I check the Neato Run switch and it is on. I check its history and it has just been turned on. I turn it off manually, turn it on, and the Neato starts cleaning.

Something similar just happened with the Night Blinds switch. I got a notification that is sent by the same piston that turns on the Night Blinds switch, so I was hoping to hear the blinds closing in the other room, nothing happened. I checked the Night Blinds switch, it was on, check its history, it had been off. Turn it off and back on, and the blinds start closing (and the piston that closes the blinds ends with turning the switch back off).

I have been doing some changes to my pistons but I have seen this happen more frequently than ever, to the point that at least once a day there is an automated action not being performed.

So, is anyone else experiencing anything similar? Any ideas on what could be causing this?

Thanks,
Rodrigo


#2

I have to ask for clarity… Are they “Virtual Switches” or “Simulated Switches”…?
(they act very differently, as seen in the link above)


If you are not sure, you can: Log into the IDE, and click on “My Devices”.

The “type” is shown in the second column:

pic


#3

This is usually on a “chatty” network… A command may have been sent, but not received by the device.
(which will, as you noted, affect the next cycle)


#4

All Simulated Switches. I had some Virtual switches in the past, don’t remember why I ended up changing all to Simulated.


#5

So, is there any solution to this?
This didn’t happen so frequently until a few weeks ago. It would happen maybe once a week or so. Now I feel every day there is a problem like this.
Is there any recommendation?

Thanks,
R.


#6

My last post is my guess… It only takes a single sloppy piston to cripple a SmartHome.

Look for:

  • Loops
  • Whiles
  • Triggers being controlled in the same piston (IF DeviceA changes, then change DeviceA)
  • Multiple pistons triggering on a single event (EventB should only trigger one piston)
  • Indirect Loops (IF DeviceC changes, then change DeviceD… IF DeviceD changes, then change DeviceC)
  • Vague pistons with no triggers, only conditions

Edit:

For the record, most of the examples above can be in any number of pistons. For example, the two pistons below look innocent by themselves, but they break a cardinal rule when studied together… (definitely a No-no)

Piston One:

IF DeviceC's switch changes
    Then Change DeviceD's switch
END IF

Piston Two

IF DeviceD's switch changes
    Then Change DeviceC's switch
END IF

See the hidden loop?
(a more exaggerated example can be found here)


#7

Yep, I understand that example… Could you show me a way to enable logs to check for these kind of things? Or show me if there’s any useful info being stored?
I only use SmartThings Classic app’s history to check how pistons are working, and I don’t see any loops there.
In the meantime I’ll re-check my pistons to try to find anything quirky.

Thanks,
Rodrigo


#8

Here is my “bird’s eye view” on Logs & Trace(since they are related)

Just keep in mind that the logs below each piston only relate to that piston.
(so it is still up to the programmer to keep track of how everything ties together)
AKA: How many things are trying to happen in the same second


#9

And with over 100 pistons and this aging brain, it gets more difficult every day. :slight_smile: