Automation - Determining Source of Trigger

I have installed the Emulated Hue component and am using it to turn on lights and switches via my Harmony Elite remote.

I would like to create an automation when a switch is turned on, but only want it to run when the switch is turned on through the remote (not through switching it manually or through the UI, so I can’t do it solely based on the switch state changing).

Is there a way to determine the source and use it as a condition or trigger in an automation?

Yes, using the new automation debugger. Create an automation to trigger from the switch state, then trigger it using the various methods and look at the Changed Variables section of the trigger debugger.

If there is a way to distinguish the trigger methods, it should be visible there, perhaps through the switch attributes.

Thanks for the idea, unfortunately it doesn’t seem there is anything (left is via the remote, right is toggling the switch directly)

For the one triggered by the remote (left hand view), trigger.to_state.context.user_id is null whereas there’s a value for the one triggered by the switch (right hand side).

Perhaps you can use that to differentiate between the two trigger sources. If the value is null then it was triggered by the remote.


NOTE

You may want to repeat the test a few times to confirm it consistently reports null when the remote is used.