Oh my goodness! I can’t actually believe it! Sticking to what we’ve been talking about (I feel introducing “similar” code, with ‘else’s’, is confusing and a distraction) and I don’t how to say this gently, but you’re wrong. And I won’t insist on an apology from you WCmore, because I understand how human relationships and even geopolitics can be destructive when people stick to certitudes of opinion, but an apology in private would not be mentioned again. 
In order for this not to go to the Supreme Court, I am openly and freely sharing the logs from my plus eighteen month piston that “doesn’t work”, where I continuously click switch 52, and the local variable stays doesn’t break.
07/06/2020, 09:32:31 +364ms
+0ms ╔Received event [Home].time = 1591515152141 with a delay of -777ms
+252ms ║Volume_change changed to true after 5 minutes
+257ms ║Volume_change changed to true after 5 minutes
+260ms ╚Event processed successfully (260ms)
07/06/2020, 09:32:21 +896ms
+1ms ╔Received event [Zzzzz MUTE MUTE].switch = off with a delay of 150ms
+256ms ║Setting up scheduled job for Sun, Jun 7 2020 @ 9:32:32 AM CEST (in 9.99s)
+347ms ╚Event processed successfully (346ms)
07/06/2020, 09:31:43 +602ms
+2ms ╔Received event [Zzzzz MUTE MUTE].switch = on with a delay of 189ms
+304ms ║Setting up scheduled job for Sun, Jun 7 2020 @ 9:32:32 AM CEST (in 48.236s)
+315ms ╚Event processed successfully (315ms)
07/06/2020, 09:30:19 +407ms
+1ms ╔Received event [Zzzzz MUTE MUTE].switch = off with a delay of 174ms
+349ms ║Setting up scheduled job for Sun, Jun 7 2020 @ 9:32:32 AM CEST (in 132.386s)
+360ms ╚Event processed successfully (360ms)
07/06/2020, 09:29:18 +231ms
+0ms ╔Received event [Zzzzz MUTE MUTE].switch = on with a delay of 112ms
+255ms ║Setting up scheduled job for Sun, Jun 7 2020 @ 9:32:32 AM CEST (in 193.655s)
+266ms ╚Event processed successfully (266ms)
07/06/2020, 09:28:44 +116ms
+1ms ╔Received event [Zzzzz MUTE MUTE].switch = off with a delay of 176ms
+391ms ║Setting up scheduled job for Sun, Jun 7 2020 @ 9:32:32 AM CEST (in 227.635s)
+401ms ╚Event processed successfully (401ms)
07/06/2020, 09:28:07 +718ms
+1ms ╔Received event [Zzzzz MUTE MUTE].switch = on with a delay of 172ms
+284ms ║Setting up scheduled job for Sun, Jun 7 2020 @ 9:32:32 AM CEST (in 264.14s)
+337ms ╚Event processed successfully (337ms)
07/06/2020, 09:27:25 +723ms
+1ms ╔Received event [Zzzzz MUTE MUTE].switch = off with a delay of 120ms
+2266ms ║Done 9 to 1300
+6382ms ║Done 9 to 1300
+6460ms ║Setting up scheduled job for Sun, Jun 7 2020 @ 9:32:32 AM CEST (in 299.959s)
+6469ms ╚Event processed successfully (6469ms)
And if even more proof was needed, in my next post I’m going recreate exactly the same piston as the OP, with my suggestion’s of course, with logs, showing it working.