Hi!
The issue you're experiencing — multiple instances of a scene running in parallel after a power outage or manual intervention — happens because Tuya Smart doesn't prevent the same scene from launching again if its trigger conditions are still true. In other words, the app has no memory of an already-running scene.
The solution is to use a binary variable (flag) that tracks whether the scene is already active. In Tuya, this can be simulated using a simple device like a smart plug or relay, where ON = busy and OFF = free.
Your scene should only start if the flag is OFF. As soon as it starts, set the flag to ON, and reset it to OFF at the end. This ensures only one instance runs at a time — even after power restoration.
Also note: after a power outage, depending on the default state of your devices (e.g., plug restored to OFF), the trigger condition may no longer be true, so the scene might not start at all. To handle this, you can detect power restoration by using a smart plug configured to automatically turn OFF when power returns. Then, create an automation triggered by the plug switching from ON to OFF. This way, you can reset your binary variable or restart necessary scenes reliably after power comes back.
This approach with binary variables and power restoration detection is useful not only for the issue you described but also for many other automation scenarios where you need to avoid overlapping runs or properly reset states after interruptions.
If your smart plug has a built-in hardware timer, it's better to use that instead of software delay actions. Delays can stack up or keep running even after the scene is disabled.
I’ve published a short write-up on the forum explaining the concept of binary variables in Tuya Smart. It doesn’t include examples, but it explains why they’re essential for building reliable automations.
Hope this helps — good luck with your setup!