CoRE - Get peer assistance here with setting up Pistons

You should have a separate action with wait 16 seconds, follow up. You set up a chain effect there, each run triggers three more after it. Did that work on the long run?!

1 Like

This worked perfectly… Not a glitch.

Edit - I see what you’re saying… Odd that it worked great… I’ll change it and test it tonight. I did notice my logs were flooded when it was running…

1 Like

Should it wait 16 seconds or 24 since there are three actions?

1 Like

Ok, I revamped the piston (which was working great) to this. I’m hoping this will run more smoothly and will flood my logs a bit less.
I can’t test it until tonight, so if someone sets it up this way please let me know if this works.

1 Like

I am probably going to try @elf 's method first. A few reasons, 1) it seems simple, 2) my pistons that I want to loop are defined as Else If only because they don’t have internal triggers they are triggered only from other pistons. So I am not exactly sure I can easily use @bamarayne 's method… it is probably possible, but the nature of the triggerless pistons is a bit of a mystery to me still…

Thx will report back.

Think of these as the “run rule actions only” in rule machine.

1 Like

FYI, after some testing. the following will not work for a loop.

The loop needs to be contained to the individual action sets shown for it to loop. So the Loop After would need to be in the first set for it to work, therefore to get all the shown actions to loop you need to create 3 loops using this method.

@bamarayne

Does yours not continually loop until you turn off the ‘Holiday Lights’ switch? I need to loop a set number of times without a switch, I am probably going to try a variable like @ady624 suggested unless I can understand a better method.

The FOR and LOOP need to be in the same action. You can use one FOR…LOOP cycle for each action…

1 Like

Thank You Ady Makes sense.

Hey, does each action execute with a single timer or does each task get it’s own timer? Not sure if that’s the right nomenclature… but point being if I turn off 100 switches with one action, do I risk that action timing out, or does each switch off task get it’s own timeline to execute within?

Each action gets its own timeline. All timelines start at the time the piston is run and condition evaluation leads to that action group being “scheduled”. Whatever you do in an individual action gets converted to “command tasks” in the list of scheduled tasks. Each “task” in that queue has a time at which it needs to run. The Wait x seconds tasks simply delay that time for any other tasks following it, for example. If you add 100 devices, you’ll get 100 tasks. They all get scheduled one after the other. What I do though is I remove tasks one by one from the queue as I execute them. If I ever timeout, the queue remains and there is a “safety net” scheduled 60 seconds after the piston run that will pick up on the leftovers and resume them, setting another 60s safety net itself. It’s technically timeout-resistant… IF the ST jobs work fine…

2 Likes

@JH1
Yes, my loop runs until I turn off the switch. I haven’t tried any other ways because I ALWAYS build in redundant control of automations. I never rely on the system 100%

1 Like

Any ideas on why the shower light will not come on when I close the door??

If you disable the trace messages and enable the debug messages, you’ll find all the evaluations in the logs. You can then follow and see what’s happened.

Do you mean to set the variable to true right after the door was opens? Because the way you set it up, you wait a minute before you set that variable to true, which is a prerequisite to the light turning on when the door closes. Which means you need to open the door, wait 1 minute, then close the door, for the light to turn on…

Also, one of the tasks in an IF action is not set to mode Night. By the way, you can set the whole action to only execute in a certain mode, so that you don’t have to set the tasks individually… Check the action restrictions…

What am I doing wrong with variables? I am trying to set a variable and get it to increment to set a limit on the iterations a piston can re-run itself, but it does not appear to be incrementing…?

Piston is limited to run when the variable is restricted to less than or equal to 5. My intention is to increment the variable +1 each cycle of the piston… it appears to keep running endlessly and the variable does not appear to increment.

Use Follow Up in 30s instead of wait 30s, execute. You probably have a race condition with the piston running again too fast.

1 Like

Thanks Ady.

Made that change, still having some odd issue with it incrementing. Went from 2 to 3… but it ran literally 6 times. Not sure why it’s not incrementing or what stopped it at 6 cycles…

Nothing will stop that piston from stopping - it will just keep executing every 30 seconds. Are you saying the variable is not incrementing correctly:? Is it running twice by any chance? Logs?

1 Like

Oh it stops, something stops it. No it is running more than twice. I will try to gather the logs up.

Not completely familiar with the logs that help you so bear with me… BRB