Delayed turn-off stays active even after disabling the automation
I've got one L530 bulb that I want to use for two purposes:
1. as a light triggered by T100 motion sensor, set to turn on for 30 seconds and then turn off
2. as indication of opened window (T110) - when the window is opened, I need the bulb to be always light up in blue color and to stay blue until the window is closed
So I created these automations, while opening the window also completely turns off the first (light with T100) automation until the window is closed again. The problem is that if I walk to the room with the window, first automation is triggered, so the light turns on... Then if I open the window, it will turn blue and the first automation is successfully disabled, but it will still turn off the blue light 30 seconds after the first (now disabled) automation was triggered by motion sensor. I'm quite sure it's possible to avoid it because I already had another similar setup elsewhere (with T110 slightly modified for door lock mechanism - the bulb was red when someone was locked on toilet) and it worked without this flaw, but I'm not able to do it again... What am I doing wrong?
Thanks