Global variables and Callbacks

Take a look at Edge Drivers! They run locally and allow automations to run the same way (depending on the Automation config)

There are different samples than can help you get started:

2 Likes