Virtual Switch Trigger stopped working


#1

1) Give a description of the problem
I have my routines like Good Morning and Good night set to a virtual switch. For example I have a virtual switch called Good Morning and I can say Hey google turn on Good Morning. Then I have a piston set to do certain things when that virtual switch turns on. It has been working for about a year. And now it stopped working in the logs it says Condition group #1 evaluated false (state changed). Can anyone help me with this? I have the same problem with Good night.

Here are the logs and pistons

2) What is the expected behaviour?
The piston should run once the virtual switch is turned on.

3) What is happening/not happening?
Nothing is running.

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach logs after turning logging level to Full
6/26/2020, 6:15:35 AM +530ms
+1ms ╔Received event [Good morning].switch = off with a delay of 74ms
+160ms ║RunTime Analysis CS > 21ms > PS > 91ms > PE > 48ms > CE
+163ms ║Runtime (37938 bytes) successfully initialized in 91ms (v0.3.110.20191009) (160ms)
+163ms ║╔Execution stage started
+170ms ║║Comparison (enum) off changes_to (string) on = false (1ms)
+172ms ║║Cancelling condition #2’s schedules…
+172ms ║║Condition #2 evaluated false (5ms)
+173ms ║║Cancelling condition #1’s schedules…
+174ms ║║Condition group #1 evaluated false (state changed) (7ms)
+176ms ║╚Execution stage complete. (13ms)
+177ms ╚Event processed successfully (177ms)


#2

It looks as though the switch may already be on? If so, it will not run the code. I wonder if a previous run of the piston was cancelled or failed and the switch was not turned off at line 51.

There have been a few posts this week with people having problems with waits, so may be related.


#3

I agree with @Paul1964, appears that the piston thinks the switch is already on. According to the log, the triggering event was actually an ‘off’ command. To combat these rare inconsistencies, I like to add a reset block:

Every day at 3am
-With Switch
-Turn off  

Very simple, but ensures the correct state of things. (Also, being in a timer block, the only time the reset block triggers is at the designated time slot, it does not get evaluated with the rest of the piston when triggered by the switch).


#4

All of my commands end with a off of all of my virtual switches, and I manually turned it off waited and then turned it back on.


#5

Perhaps show us a log when the switch turns on?


#6

Here is tonights log after the switch turned on

6/28/2020, 10:28:25 PM +750ms
+1ms ╔Received event [good night].switch = on with a delay of 102ms
+97ms ║RunTime Analysis CS > 21ms > PS > 26ms > PE > 50ms > CE
+100ms ║Runtime (40435 bytes) successfully initialized in 26ms (v0.3.110.20191009) (97ms)
+101ms ║╔Execution stage started
+107ms ║║Comparison (enum) on changes_to (string) on = true (0ms)
+109ms ║║Cancelling condition #2’s schedules…
+110ms ║║Condition #2 evaluated true (4ms)
+111ms ║║Cancelling condition #1’s schedules…
+111ms ║║Condition group #1 evaluated true (state changed) (7ms)
+113ms ║║Cancelling statement #3’s schedules…
+1005ms ║║Skipped execution of physical command [Basement Bathroom Light].off([]) because it would make no change to the device. (2ms)
+1006ms ║║Executed [Basement Bathroom Light].off (4ms)
+1012ms ║║Skipped execution of physical command [basement heater].off([]) because it would make no change to the device. (2ms)
+1012ms ║║Executed [basement heater].off (4ms)
+1017ms ║║Skipped execution of physical command [Basement Lights].off([]) because it would make no change to the device. (2ms)
+1018ms ║║Executed [Basement Lights].off (4ms)
+1023ms ║║Skipped execution of physical command [Bryson’s Bedroom Light].off([]) because it would make no change to the device. (3ms)
+1024ms ║║Executed [Bryson’s Bedroom Light].off (4ms)
+1480ms ║║Executed physical command [Canister Lights].off() (452ms)
+1480ms ║║Executed [Canister Lights].off (454ms)
+1486ms ║║Skipped execution of physical command [Chases Bedroom].off([]) because it would make no change to the device. (3ms)
+1487ms ║║Executed [Chases Bedroom].off (4ms)
+1493ms ║║Skipped execution of physical command [dining room light].off([]) because it would make no change to the device. (3ms)
+1494ms ║║Executed [dining room light].off (4ms)
+1499ms ║║Skipped execution of physical command [Front Door Inside Light].off([]) because it would make no change to the device. (3ms)
+1500ms ║║Executed [Front Door Inside Light].off (4ms)
+1523ms ║║Executed physical command [Hall Light].off() (21ms)
+1524ms ║║Executed [Hall Light].off (21ms)
+1529ms ║║Skipped execution of physical command [Hellcat clock].off([]) because it would make no change to the device. (2ms)
+1529ms ║║Executed [Hellcat clock].off (3ms)
+1532ms ║║An error occurred while executing the event: java.lang.NullPointerException: Cannot invoke method hasCommand() on null object
+1533ms ║╚Execution stage complete. (1433ms)
+1534ms ╚Event processed successfully (1534ms)


#7

Thanks. What happened wrong at this event?


#8

I do not know and this is for all of my webcore routines.


#9

The logs show the piston firing OK and attempting to turn off a number of switches. Some it skips because they are off already. However when it gets to the tenth switch (if I counted correctly) it throws an error and doesn’t seem to recover from it, which slightly surprises me as normally it will carry on regardless. Pistons check that devices have the commands you want to run before they attempt to run them and the error seems to suggest that there isn’t a device object for that device. So I would suggest checking out whatever that device is. Does it still exist in SmartThings? Has anything changed with it recently etc.