Movie scene automation

Hello I’m trying to make a scene that works only when sun is down, not just only when sun goes down. So It should trigger when I press play on my media player. Any work only when it dark same for stopping movie. Any ideas ?

Simple automation.

set the scene as you want it in scenes.

trigger - pressing play.
condition - sun below horizon.
action - scene activate

Here is mine, I don’t use the sun state but time of day:

alias: movie dim lights
description: ""
trigger:
  - platform: state
    entity_id:
      - media_player.atv_1_etg
    to: playing
    id: play
  - platform: state
    entity_id:
      - media_player.atv_1_etg
    id: pause
    to: paused
  - platform: state
    entity_id:
      - media_player.atv_1_etg
    to: idle
    id: idle
condition:
  - condition: time
    after: "19:00:00"
    before: "02:00:00"
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - play
        sequence:
          - service: scene.turn_on
            data:
              transition: 5
            target:
              entity_id: scene.film
      - conditions:
          - condition: trigger
            id:
              - pause
        sequence:
          - service: scene.turn_on
            data:
              transition: 5
            target:
              entity_id: scene.kveldsbelysning
      - conditions:
          - condition: trigger
            id:
              - idle
        sequence:
          - service: scene.turn_on
            data:
              transition: 5
            target:
              entity_id: scene.kveldsbelysning
mode: single