Adding a loop to scenes

I would like to be able to repeat an action several times in a scene.
For example, I set my water heater to forced mode and, so as not to forget to turn it off, I want to receive a message every 20 minutes for 2 hours.
Rather than creating the action « wait 20 minutes » + « send a message » six times
I would like

Absolutely! Thanks for the suggestion, I’ve also had cases like that.

I also have the same issue with my alarm :+1:

Wouldn’t it be the same request?

It’s not the same purpose.
In your case, you restart a scene.
In my case, the loop is inside the scene.

I think you should set as the trigger
Scheduled trigger
Type : Interval
20 minutes

For the « for 2h » part, you can create a scene that will « turn on » a fake MQTT device, then « turn it off » after 2 hours.

In parallel, you run your « every 20 min » scene only if your fake device is on.

Hi @gaetanb76!

The loop in a scene is the While… Repeat… block, since Gladys 4.86.

For the water heater and a reminder every 20 minutes for 2 hours:

  1. You force the water heater to start.
  2. You add While… with the condition that must remain true during the reminders.
  3. In Repeat…: Wait 20 minutes, then Send a message.
  4. You set the maximum number of iterations to 6.

Without a condition, the loop does not start. The limit is a safety feature: once reached, the loop stops and the rest of the scene executes. You no longer have to paste « wait + message » six times.

I’m filing this topic under « Delivered requests ». If there’s still a case that doesn’t fit, open a new topic: it will be easier to follow.