Create and apply scene depending on automation option

alias: "[Event] EmbySony Light Scenes"
description: ""
trigger:
  - platform: state
    entity_id:
      - media_player.emby_sony_cast_tv
    to: paused
    from: playing
    for:
      hours: 0
      minutes: 0
      seconds: 5
    id: emby_paused
  - platform: state
    entity_id:
      - media_player.emby_sony_cast_tv
    to: playing
    id: emby_playing
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: emby_playing
        sequence:
          - service: scene.create
            data:
              snapshot_entities:
                - light.living_room_lights
                - light.kitchen_table_lights
                - switch.kitchen_light_outlet_local
              scene_id: scene_livingroom_previous_state
          - service: light.turn_off
            data: {}
            target:
              entity_id:
                - light.living_room_lights
                - light.kitchen_table_lights
                - light.entrance_ceiling_lights
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.kitchen_light_outlet_local
      - conditions:
          - condition: trigger
            id: emby_paused
        sequence:
          - service: scene.apply
            data:
              entities: scene_livingroom_previous_state
mode: single

I am trying to get an automation to restore the previous lightning in the living room when a video is paused. I suspect the problem here may be the life cycle of the created scene during playback is empty.

Here is the process I am trying to achieve:

  1. Play a video
  2. Snapshot of light states
  3. Turn off lights
  4. Pause a video
  5. Restore snapshot in process 2

Is this possible or do I need to store the states in a helper instead?

Think i was using the wrong the service attribute. Scene.Activate seems to have worked.