What is missing? Simulating room lighting

I wrote this rule and cant figure out why it isn't working. Light goes on and 10 seconds later it goes off.
I think the delay per mode should be a wait but there isn't a wait per mode. What am I overlooking?

Could be a few different things. Enabling all logging for the rule but in particular action logging will show you what the issue was that particular time. You have two main problems:

  • Your lights will turn off as soon as motion goes inactive (you probably want the delay in your ELSE and not your IF THEN--having a delay as the last action you run in one particular code path won't really do anything)
  • Nothing cancels your delay if motion becomes active again; this could be fixed by marking the delay as "cancelable," moving it to the ELSE as above, and putting a "Cancel Delayed Actions" somewhere before that, typically the first line in your rule or the first thing inside your IF THEN

Additionally,

  • You provided only your actions and not your entire rule, so there could be more going on, especially if your trigger is not "motion changed" as it must be for this kind of thing to work.

There are many examples of this kind of automation if you search the forum, though most newer ones will use a Wait instead. Of course, Room Lighting is an option too. :slight_smile:

Fixed me. It didn't occur to me moving the delay to the else. I semi-understand cancelable - I had turned that off trying to get it working.

Regarding RL, I have a problem that RL doesn't work for - so this is a workaround. RL seems to function the same as the public driver, it sets on / off but dim value doesn't take for a specific device, namely Jasco 43080 zigbee. Using a rule, it does work. There is something wierd for me on these jasco devices - you can't pre-set the dim value, and sending an on that includes the dim doesn't work - but sending an on, and sending setlevel does or something like that. I'm uninterested in trying to solve the why, just wanting to solve and this does it!