Troubleshooting help - piston skips some devices


#1

1) Give a description of the problem
I have a piston called: Secure House that I run at night. “Secure House” is a sim switch in SmartThings (So: Hey Google, turn on Secure House). When it runs, it turns off a bunch of lights (if they’re on) and locks two doors (in case I forgot). Then the sim switch turns back off.

I had a device, a zwave light switch, go offline a few days ago for some reason. So Secure House would work up until it reached the point in the list of devices in the piston where it was (which was now a string of numbers) and stop, not turning off any other lights after it in the piston.

I unlearned/relearned the switch, corrected the piston, but the piston still stops when it hits that point.

I BOLDED in the below error log where the error occurs.

2) What is the expected behaviour?
The piston shuts all lights/locks doors.

3) What is happening/not happening?
stops where device went bad and was relearned/reentered.

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
7/24/2020, 11:28:16 PM +635ms
+1ms ╔Starting piston… (v0.3.110.20191009)
+790ms ║╔Subscribing to devices…
+799ms ║║Subscribing to Secure House.switch…
+897ms ║║Subscribing to Alcove Fan…
+898ms ║║Subscribing to Alcove Light…
+899ms ║║Subscribing to Attic Light 1…
+900ms ║║Subscribing to Back Yard Light…
+901ms ║║Subscribing to Basement Door Light…
+903ms ║║Subscribing to Curio Cabinet Light…
+905ms ║║Subscribing to Dining Room Light…
+906ms ║║Subscribing to Dog Yard Light…
+907ms ║║Subscribing to Driveway Light…
+908ms ║║Subscribing to Front Door Light…
+909ms ║║Subscribing to Furnace Room…
+910ms ║║Subscribing to Garage Driveway Light…
+911ms ║║Subscribing to Garage Light…
+912ms ║║Subscribing to Kitchen Door Light…
+914ms ║║Subscribing to Kitchen Light…
+915ms ║║Subscribing to Left Deck Light…
+916ms ║║Subscribing to Living Room Light…
+917ms ║║Subscribing to Living Room Light Two…
+918ms ║║Subscribing to Right Deck Light…
+919ms ║║Subscribing to Sandblaster Light…
+920ms ║║Subscribing to Sink Light…
+921ms ║║Subscribing to Stair Light One…
+923ms ║║Subscribing to Stair Light Three…
+924ms ║║Subscribing to Stair Light Two…
+925ms ║║Subscribing to Studio Light…
+926ms ║║Subscribing to Upstairs Bathroom Light…
+927ms ║║Subscribing to Front Door Deadbolt…
+928ms ║║Subscribing to Kitchen Deadbolt…
+929ms ║╚Finished subscribing (149ms)
+954ms ║Cancelling condition #2’s schedules…
+955ms ║Cancelling condition #1’s schedules…
+977ms ╚Piston successfully started (975ms)
7/23/2020, 11:24:40 PM +399ms
+2ms ╔Received event [Secure House].switch = on with a delay of 124ms
+131ms ║RunTime Analysis CS > 27ms > PS > 50ms > PE > 54ms > CE
+134ms ║Runtime (38844 bytes) successfully initialized in 50ms (v0.3.110.20191009) (131ms)
+135ms ║╔Execution stage started
+142ms ║║Comparison (enum) on changes_to (string) on = true (1ms)
+144ms ║║Cancelling condition #2’s schedules…
+145ms ║║Condition #2 evaluated true (6ms)
+146ms ║║Cancelling condition #1’s schedules…
+147ms ║║Condition group #1 evaluated true (state changed) (8ms)
+149ms ║║Cancelling statement #3’s schedules…
+1336ms ║║Skipped execution of physical command [Alcove Light].off([]) because it would make no change to the device. (3ms)
+1337ms ║║Executed [Alcove Light].off (5ms)
+1343ms ║║Skipped execution of physical command [Back Yard Light].off([]) because it would make no change to the device. (1ms)
+1344ms ║║Executed [Back Yard Light].off (3ms)
+1350ms ║║Skipped execution of physical command [Basement Door Light].off([]) because it would make no change to the device. (2ms)
+1351ms ║║Executed [Basement Door Light].off (4ms)
+1371ms ║║Executed physical command [Curio Cabinet Light].off() (17ms)
+1372ms ║║Executed [Curio Cabinet Light].off (19ms)
+1378ms ║║Skipped execution of physical command [Dining Room Light].off([]) because it would make no change to the device. (2ms)
+1379ms ║║Executed [Dining Room Light].off (4ms)
+1385ms ║║Skipped execution of physical command [Dog Yard Light].off([]) because it would make no change to the device. (2ms)
+1386ms ║║Executed [Dog Yard Light].off (3ms)
+1391ms ║║Skipped execution of physical command [Driveway Light].off([]) because it would make no change to the device. (2ms)
+1392ms ║║Executed [Driveway Light].off (4ms)
+1398ms ║║Skipped execution of physical command [Front Door Light].off([]) because it would make no change to the device. (1ms)
+1398ms ║║Executed [Front Door Light].off (3ms)
+1404ms ║║Skipped execution of physical command [Furnace Room].off([]) because it would make no change to the device. (2ms)
+1405ms ║║Executed [Furnace Room].off (4ms)
+1411ms ║║Skipped execution of physical command [Garage Driveway Light].off([]) because it would make no change to the device. (3ms)
+1412ms ║║Executed [Garage Driveway Light].off (4ms)
+1417ms ║║Skipped execution of physical command [Garage Light].off([]) because it would make no change to the device. (2ms)
+1418ms ║║Executed [Garage Light].off (4ms)
+1424ms ║║Skipped execution of physical command [Kitchen Door Light].off([]) because it would make no change to the device. (2ms)
+1425ms ║║Executed [Kitchen Door Light].off (3ms)
+1431ms ║║Skipped execution of physical command [Kitchen Light].off([]) because it would make no change to the device. (2ms)
+1432ms ║║Executed [Kitchen Light].off (4ms)
+1439ms ║║Skipped execution of physical command [Left Deck Light].off([]) because it would make no change to the device. (4ms)
+1440ms ║║Executed [Left Deck Light].off (5ms)
+1456ms ║║Executed physical command [Living Room Light].off() (13ms)
+1457ms ║║Executed [Living Room Light].off (14ms)
+1463ms ║║Skipped execution of physical command [Living Room Light Two].off([]) because it would make no change to the device. (2ms)
+1464ms ║║Executed [Living Room Light Two].off (3ms)
+1465ms ║║An error occurred while executing the event: java.lang.NullPointerException: Cannot invoke method hasCommand() on null object
+1467ms ║╚Execution stage complete. (1332ms)
+1468ms ╚Event processed successfully (1468ms)
7/22/2020, 11:25:05 PM +159ms
+2ms ╔Received event [Secure House].switch = off with a delay of 124ms
+117ms ║RunTime Analysis CS > 26ms > PS > 43ms > PE > 47ms > CE
+119ms ║Runtime (38839 bytes) successfully initialized in 43ms (v0.3.110.20191009) (117ms)
+120ms ║╔Execution stage started
+126ms ║║Comparison (enum) off changes_to (string) on = false (0ms)
+128ms ║║Cancelling condition #2’s schedules…
+129ms ║║Condition #2 evaluated false (4ms)
+129ms ║║Cancelling condition #1’s schedules…
+130ms ║║Condition group #1 evaluated false (state changed) (7ms)
+132ms ║╚Execution stage complete. (12ms)
+133ms ╚Event processed successfully (133ms)


#2

So, after you re-added the devices, you edited the piston to update the pointers? You might need to do a ‘clear all’ and re-select all the devices to be sure the old pointer is cleared out.


#3

Oh ok thanks, I had just clicked on it and added the switch again. I’ll try what you suggested.


#4

i have similar piston doing a similar thing.
I’d say try to split devices and add 15 second WAITs.

device a, b, c, d, e, f, g
Do turn OFF
wait 15 seconds
device h, i, j, k, l, m, n
Do turn OFF
wait 15 seconds
etc


#5

After following @guxdude’s idea to resolve the error, I would also recommend @ike2018’s suggestion to improve reliability for future executions.

IE: You are currently trying to send 28 different commands in the span of 0.1 seconds!
(I usually allow 4 or 5 devices per second, at most)


#6

When switching lots of devices at the same time, ST likes to miss a lot of commands and has no built in checks to automatically retry…I like to use a ‘while loop’:

This will keep looping, reducing the list of devices ‘still on’, until all are off.


#7

Whew! Great ideas and help here - I do appreciate it and will follow up!


#8

I didn’t get a chance to do anything to the piston… And suddenly it started working again. Go figure.


#9

I believe this will happen more… It will work and not work, work and not work LOL


#10

screams into void


#11

On a spam piston like the first post here, I would barely expect a 95% success rate.
(if you are lucky)


#12

LOL yeah, I’ll go ahead and redo it. How many devices at a time, and how long between them, do you think?


#13

simplest if you use a ‘for each’ loop so it just does one at a time. Then you can play with the delay. Depending on the devices, you might get away with no delay at all or you can add up to 3 seconds which would be pretty safe.


#14

I generally shoot for 3-5 devices per second, at most.


#15

I honestly don’t mind a short delay - it’s just shutting off lights when I go to bed that I may have left on without meaning to, and making sure I locked two doors (I can hear them when they lock). The door lock thing is more of a triple-check - I walk by them and check before bedtime in my routine anyway.


#16

My “Go to bed” piston takes about 4 minutes before all is said and done. Lights turn dim… Some turn off… Time passes… More turn off… Voice alert about overnight weather… More time passes… More lights off… Babbling Brook sound effects begins… Time passes… More lights turn off, leaving two (as I crawl into bed)… Alexa starts “sleep timer”… More time passes… The final lights turn off, and my fans returns to regular cycles.

Also, during that time, if doors are unlocked, or windows are open, then a few other things may happen during that process.


Pro Tip:

Also, my SimSwitches are set during this process.
(IE: so my house knows I am asleep)
This is to ensure that no voice alerts disturb my beauty sleep, LOL


#17

Man. That sounds nice and peaceful. I’m coming over! :slight_smile:


#18

It took a bit of tweaking to get the time delays just right… but now, it’s like my SmartHome is “tucking me in” each night…

After I brush my teeth, I just say, “Alexa, Goodnight”… :zzz: