Setting a boolean based on context.user_id

Hello all!
I have an attic fan that I would like to set a boolean helper to get turned on only when it is manually turned on by Amazon echo or through the HA app. If it gets triggered by an automation, it should keep the boolean helper turned off.
With that being said, I’m having issues with my automation setting this helper, so I created an automation just to indicate if the entity is turned on and who did it…yet the user_id variable is none even when turned on by Amazon echo. I thought it would only get set to none when triggered by an animation. Any ideas of where I’m going wrong?

alias: Attic fan manually turned on
description: ""
triggers:
  - entity_id:
      - switch.attic_fan_1_attic_fan_2
    to: "on"
    trigger: state
actions:
  - data:
      title: User ID
      message: >-
        user_id: {{ trigger.to_state.context.user_id }} parent_id: {{
        trigger.to_state.context.parent_id }} id: {{ trigger.to_state.context.id
        }}
    action: notify.persistent_notification

which then gives this notification:

The context shown in you example is what would be expect if someone manually flipped the switch.

Action id parent_id user_id
Physical Not None None None
Automation Not None Not None None
UI Not None None Not None

That table is a bit oversimplified, and context.parent_id is not reliably set for automations, depending on what kind of trigger they use.

More details here: How to use context

This will help quite a bit. In my case, I will have to check only the parent_id to ensure it is set to anything other than none as I only want to identify if it was an automation that turned on the attic fan. Thank you!