Cancel automation if a user or HomeKit makes manual change

Hello!
Is there a way to retrieve the user that last changed an entity in an automation via templating?
Specifically I want to cancel an automation depending on which user made the last change to an entity state. The information is stored here in the “history” but I can’t find how to access it with templates.

I have a “master dimmer” that controls the brightness of all of my lights. (With different thresholds/scales for different lights).
I intend to build an automation that will fade up the master dimmer in the morning, and fade it off in the evening.
I would like to build some checks into the automation though - ideally if any light state has been manually changed by a specific user (or via HomeKit) it should just cancel the automation altogether.

:star_struck: Awesome, thanks!!