How can I trigger a sensor within an automation

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.

Welcome to the forum! :grin:

Could we see the code from your automation? It may help people understand what you are looking for.

You can copy and paste the yaml from HA - when you paste it into a post, make sure it is as “preformatted text” (in the toolbar cogwheel menu). That makes sure the spacing is correct.

You can not trigger a sensor.
You can change your automation’s action part to a script or several of them and then have your original automation trigger the scripts as well as your new automation.