Relaunch the scene x times

I have a scene that notifies me on my speakers if I have a water leak at my hot water tank.
But my wife made a pertinent remark.
The scene would need to restart every y minutes.

So waiting y minutes is doable. But restarting the same scene x times isn’t possible, right?

When you put a condition on a sensor, it will always be true…
Example:

Thanks for this solution, but the goal is that I run it x times and not every time haha

You can make a counter that is incremented and that only triggers the scene if the counter is < X

  • Create a virtual device
  • Set to 0 by default in a scene
  • On each execution, set the device to the previous value + 1

Another scene triggers on the device’s new value if the value < 4 (for example) :slight_smile:

2 Likes

That’s a very clever solution… but it only makes sense to a developer’s brain! :sweat_smile:

1 Like

After that, it doesn’t work.
As soon as we reset the virtual device to 0, we’ll fall back into the < x condition and restart the scene

Not necessarily, you can check that it’s < 4 AND different from zero

Right now I don’t see how to do an « and » in the triggers :thinking:
I can’t make conditions like counter != 0
Because when it gets reset to 0 I won’t enter this scene anymore

You can create 3 scenes:

Scene No. 1

Trigger: If balloon leaks

Actions:

  • Control a device, counter = 1

Scene No. 2

Trigger