Others here may have a better solution, but I would use a WAIT right now and see how it works for you.
Piston is not repeating or triggering
I have been testing the wait which is why there are two. Neither works.
Oddly enough, another piston I have uses a device local variable an even though the piston executes it doesn’t do anything to the devices within the list. Maybe these are related.
Can you try something for me. I have had difficulty putting my devices into a variable and using the variable name in the code (like your line #17). Can you test just one light and replace lines #25, #33, #48 with a single light device name and not a variable? Then test that one light and include the log here.
I can but to be clear. I am getting notifications when I run the test (on this lastest piston) but the notifications repeat (as you mentioned previously).
I wonder if I have to save the device lists into a variable similar to my question a few years ago here. Variable loops in notification piston
Ex. I was able to get this piston to turn off the lights but only when I used individual bulbs in the piston and not use the device list.
3/21/2020, 11:43:50 AM +41ms
+1ms ╔Received event [3rd SYLVANIA BR30 RGBW].switch = off with a delay of 195ms
+9546ms ║Piston waited at a semaphore for 9266ms
+9549ms ║Runtime (52467 bytes) successfully initialized in 9498ms (v0.3.110.20191009) (9546ms)
+9550ms ║╔Execution stage started
+9585ms ║╚Execution stage complete. (36ms)
+9586ms ╚Event processed successfully (9586ms)
3/21/2020, 11:43:49 AM +966ms
+1ms ╔Received event [2nd SYLVANIA BR30 RGBW].switch = off with a delay of 252ms
+9560ms ║Piston waited at a semaphore for 9269ms
+9563ms ║Runtime (52467 bytes) successfully initialized in 9509ms (v0.3.110.20191009) (9561ms)
+9564ms ║╔Execution stage started
+9602ms ║╚Execution stage complete. (38ms)
+9603ms ╚Event processed successfully (9603ms)
3/21/2020, 11:43:49 AM +199ms
+0ms ╔Received event [Casa de Pines].time = 1584816230405 with a delay of -1207ms
+307ms ║Runtime (52403 bytes) successfully initialized in 252ms (v0.3.110.20191009) (306ms)
+308ms ║╔Execution stage started
+341ms ║║Executed [1st SYLVANIA BR30 RGBW].off (3ms)
+356ms ║║Executed [2nd SYLVANIA BR30 RGBW].off (14ms)
+370ms ║║Executed [3rd SYLVANIA BR30 RGBW].off (12ms)
+1239ms ║║Executed [1st SYLVANIA BR30 RGBW].off (4ms)
+1244ms ║║Executed [2nd SYLVANIA BR30 RGBW].off (3ms)
+1248ms ║║Executed [3rd SYLVANIA BR30 RGBW].off (4ms)
+1251ms ║╚Execution stage complete. (943ms)
+1252ms ╚Event processed successfully (1252ms)
I have had the same experience.
So it is working. Good. Maybe making the change to the device list as you have suggested will work. I am interested to see if it does!
I wonder why the device list doesn’t work? @WCmore or @Robin you two usually know these things. Any ideas on what the issue would be?
I would suggest using a single device, get the piston working, and then see if adding the additional lights will work.
I tried separate devices and slowly added them back. So this works now but it gives me 4 notifications in a row.
Also I am getting a not found in the push
Piston state: Device ‘1st SYLVANIA BR30 RGBW, 2nd SYLVANIA BR30 RGBW, 3rd SYLVANIA BR30 RGBW and Arabella RGBW was left on for more than 10 minutes @8:27 AM 23-Mar-20 MST’ not found
In piston “7vxg”, your variable
{lightOn} is a “device” type…
yet you are trying to write a “string” to it. (line 41)
Thanks. I’m still getting 4 notifications in succession when I just want to have them repeat every 10 minutes until the lights are off.
Two things…
- Why did you define lightOn as a device? Should that be a string variable?
- I am a fan of small, task specific pistons. Might you use your piston for an individual light instead of all of the lights together? Yes, you will have 4 small pistons. But they might be easier to debug that way.
- I think you are right. I didn’t notice i did that.
- the three lights are on the same switch ( the fourth is for testing with a light in a different location). But i do get what you are saying though!
Your piston will execute each time one of the devices changes state. So if you have four devices in your IF (your trigger in 7vxg above), then you may get 4 notifications. Each device that changes state may send a notification.
Is that a smart switch? If so, use that as your trigger device and only get a single notification when it is on. If not, and all three lights are smart bulbs (I presume they are), then you can still run 3 separate (but duplicate) pistons, one for each individual light. And use the single light as your trigger in each piston.
Edit : But doing that will send you at least 3 notifications if the 3 lights are controlled by the same switch.
Sorry no the same gang switch on the wall. All three are in my hallway so I want to group them together.