Trigger only once

Hello everyone
I’m here again:

Is it possible to have a trigger fire only once?
I mean I have a trigger that turns off the lights when I watch a movie on an android tv.
if I turn on the lights manually after a certain amount of time the automation turn them off, how can I solve the problem?

I would like that if the film starts the automation turn off the lights but if I turn them on manually the automation leave them on.

I don’t understand how to set the condition, can anyone help me?

I would say that wouldn’t happen if you use a state driven automation.
Are you using time pattern?

Thanks for the replay.

this is the code:

alias: NvidiaTV Soggiorno Play
trigger:
  - entity_id: media_player.android_nvidia_soggiorno
    to: playing
    platform: state
    for: '00:00:20'
condition:
  - condition: state
    entity_id: sun.sun
    state: below_horizon
  - condition: template
    value_template: >
      {{ state_attr('remote.soggiorno', 'current_activity') in [ 'Watch
      ShieldTV' ] }}
  - condition: template
    value_template: >
      {{ state_attr('media_player.android_nvidia_soggiorno', 'app_name') in [
      'Amazon Prime Video', 'Plex', 'Netflix', 'Disney+', 'HDHomeRun' ] }}
  - condition: template
    value_template: '{{ trigger.from_state.state != trigger.to_state.state }}'
action:
  - service: scene.turn_on
    entity_id: scene.soggiorno_spenta

This should only trigger once, or whenever you pause then play again, or switch episode.
You could add:

trigger:
  - entity_id: media_player.android_nvidia_soggiorno
    to: playing
    from: off    # or idle or whatever the state is when off.
    platform: state
    for: '00:00:20'

or

trigger:
  - entity_id: media_player.android_nvidia_soggiorno
    to: playing
    not_from: paused
    platform: state
    for: '00:00:20'

Thanks again.

I will try your code, but i see that it happens during the movie, not only when i paused and resume the movie

Look at the history of the media player what states it goes between when that happens.

Thanks for your advice!
I notice that some times the android tv drop to standby and then play on it’s own! Now i fix the problem! Thanks a lot!