Force bulb to remain on even after motion detector resets when switch is used to turn on bulb

I use a ST motion sensor to toggle a bulb whenever someone enters a particular room. In that room, there is also a Hue dimmer switch which is also used to toggle the same bulb.
I’m new to HA, and have run into a problem, I can’t resolve.
Whenever the ST sensor resets, and it may reset if someone is in the room and the ST does not detect any motion, the bulb is turned off. Sure I can turn the bulb on using the dimmer switch, but again the ST sensor may turn the bulb off again. This is not what I want. I’d like the bulb to remain on even after the motions sensor resets, if the dimmer switch was used to turn on the bulb. So, my question is this: Is there a way to prevent the bulb from being turned off in this situation? Is there a way to set a “flag” that can be checked by the automation that turns off the bulb? Or is there a better way? Automations are the only tool used for all the devices. I’ve found this post: Disable motion reset. But it seems to me, this should be simpler.
Thanks

I’m using custom component entity-controller for this.

I have an automation for this. I just don’t have access at the moment. I’ve been using it for years and have not needed to change. Basically i use a condition to only run if the light is off. So if the light is on then it does not run so it will never turn off the light.

I was able to get the automation. It might be able to be cleaned up a bit as I have not changed it in a while. Like Homeassistant turn on/off is not necessary, should be light.turn_on/off, etc, and you can probably remove a bit of the logic as it may not apply to you but you should be able to understand the flow and make it work for you.

- alias: Motion Lighting in the Office
  trigger:
  - platform: state
    entity_id: binary_sensor.motion_sensor_office_motion
    from: 'off'
    to: 'on'
  condition:
  - condition: numeric_state
    entity_id: sensor.ha_runtime_in_minutes
    above: 2
  - condition: state
    entity_id: light.office_lamps
    state: 'off'
  - condition: template
    value_template: "{{ states('sensor.hue_outdoor_motion_sensor_light_level')| int < 250 }}"
  action:
  - service: homeassistant.turn_on
    entity_id: light.office_lamps
  - wait_template: "{{ is_state('binary_sensor.motion_delay_office', 'off') }}"
  - condition: state
    entity_id: light.office_lamps
    state: 'on'
  - service: homeassistant.turn_off
    entity_id: light.office_lamps