Simple automation not behaving as expected

Hi Jim, have a look at this: Motion activated lights automation

Side note: Why and how to avoid device_ids in automations and scripts