I am working on some automations and there are some where I want lights to revert to a status once my automation is done. For example, in my bedroom I have numerous smart lights and a drawer where I keep my medicine. My lights typically turn on to various level and some warm/bright based on the time of day, which is started by motion sensor detection. I have an automation which helps remind me to take my medicine and it is cleared when I open the drawer, which triggers a vibration sensor. To make sure the vibration sensor pickup the drawer opening, I have nearby light switch colors to denote it was successful. My challenge is when I have custom helpers which are holding lights at a specific level (such as when I have guests over) and it won’t revert the medicine light to the same level of all the other lights.
Basically, I would like the automation to run all the way through and then delay a couple of seconds and then (via code) trigger the motion sensor, which will then revert the light to match the rest of the lights.
Any help would be appreciated.