Hello and welcome to Gladys!
Your two issues have an explanation. I’ll address them in order.
1. Sudden Shutdown
The « Turn off the lights » action in Gladys simply sends {"state": "OFF"} to zigbee2mqtt/<your bulb>/set. It’s Zigbee2MQTT that applies the transition, or not. In principle, when the transition option is set on the device, Z2M transforms this OFF into a gradual decrease to 0, then turns it off.
To find out where the problem lies, turn off the bulb directly from the Z2M interface. If it’s also instant, Gladys is not to blame: it’s between Z2M and the bulb. Then check that the transition value (in seconds) has been saved.
In any case, the most reliable way is to request the transition directly in the message: it then takes precedence over the device option. In your scene, replace « Turn off the lights » with the action « Send a Zigbee2mqtt message »:
- Topic:
zigbee2mqtt/NAME_OF_YOUR_BULB/set (the name as it appears in Z2M, including the zigbee2mqtt/ prefix)
- Message:
{"state": "OFF", "transition": 3} (3 seconds of fade)
You need one action per bulb. If your GU10s are in a Z2M group, one message to zigbee2mqtt/GROUP_NAME/set is sufficient, and they will turn off exactly at the same time. The same trick works for dimming, for example {"brightness_percent": 20, "transition": 2}.
2. The Delay That Doesn’t Restart from Zero
The scene does not resume where it left off. Each movement starts a new execution of the scene, in parallel with the one already running, and Gladys does not cancel the previous one.
I assume your scene looks like « Movement → turn on → Wait 2 min → dim → Wait 30 s → turn off ». When you move during the dimmed phase, the new execution turns the light back on. But the old one is still in its « Wait 30 s », and it turns off at the end. Moreover, 2 minutes later, the new execution will dim the brightness, which can turn the lamps back on low: setting a brightness turns on a Z2M bulb.
The solution is to stop counting time with « Wait » and let the trigger do it. The « Device State Change » trigger has an option for this: « Run the scene after the condition has been valid for: ». The timer is canceled as soon as the sensor goes back to « Motion detected », and it restarts from zero at the next « No motion ».
You should therefore split it into 3 small scenes:
Scene A – Hallway: Turn on
- Trigger: « Device State Change » → hallway detector = Motion detected
- Actions: your day/night logic. For example, a « If… Then… Else… » condition containing a « Temporal Condition »: Then strong brightness, Else weak brightness.
Scene B – Hallway: Dim
- Trigger: hallway detector = No motion, checking « Run the scene after the condition has been valid for: 2 minutes »
- Action: dim the brightness
Scene C – Hallway: Turn off
- Trigger: hallway detector = No motion for 150 seconds (2 min + 30 s, because the two timers start at the same time)
- Action: the Zigbee2mqtt message
{"state": "OFF", "transition": 3} seen earlier
Result: if you move during the dimmed phase, scene A turns the light back on and the timers for B and C are canceled. When you stop, they restart from zero: 2 minutes at full, then 30 seconds dimmed, then fade off.
Two tips:
- In B and C, also check « Run only when the threshold is crossed ». The timer then only starts when switching from « Motion detected » to « No motion ». If the sensor returns « No motion » later, the dimming will not be restarted, and your lamps will not turn back on low.
- The timer only starts when the detector sends « No motion », and each detector waits a certain time before sending it. On some models, this time is adjustable in Z2M (option
occupancy_timeout). The actual delay is therefore this time plus your 2 minutes: adjust accordingly.
The duration in seconds in the trigger and the Zigbee2mqtt action are available in the current version of Gladys (5.1.3): make sure to update if needed.
Keep us posted!