Cuddle time automation :)

Hello everybody! I am so excited to be here and be a part of the Home Assistant community.

I am fairly new to all this and I want some help setting up an automation. Perhaps this is needed by many parents.

I am the father of two adorable children and we live in a 2-floor house, downstairs is the living room and upstairs are all the bedrooms.

I have a Philips Hue motion sensor installed in the corridor upstairs and I want to use it to create an automation to flash the lights in the living room downstairs if any motion is detected.

I am trying to bind this to a scene (I used the name Cuddle time name, haha) and run a script for flashing the living room lights twice and changing the scene to scene.relax afterwards.

I am trying to do this all with the UI editor. Currently I have a working script and scene.

The script is this:

flash_lights:
  alias: Flash lights
  sequence:
  - type: toggle
    device_id: 292a0c4101cb11eb9b0a756d9e7b9762
    entity_id: switch.big_lamp
    domain: switch
  - delay: '2'
  - type: toggle
    device_id: 292a0c4101cb11eb9b0a756d9e7b9762
    entity_id: switch.big_lamp
    domain: switch
  - delay: '2'
  - type: toggle
    device_id: 292a0c4101cb11eb9b0a756d9e7b9762
    entity_id: switch.big_lamp
    domain: switch
  - delay: '2'
  - type: toggle
    device_id: 292a0c4101cb11eb9b0a756d9e7b9762
    entity_id: switch.big_lamp
    domain: switch
  mode: single
  icon: mdi:lamp

And the scene is this:

- id: '1601065573729'
  name: Cuddle time
  entities:
    light.tv_lamp:
      min_mireds: 153
      max_mireds: 500
      effect_list:
      - colorloop
      - random
      brightness: 255
      hs_color:
      - 336
      - 76.471
      rgb_color:
      - 255
      - 59
      - 137
      xy_color:
      - 0.553
      - 0.253
      effect: none
      friendly_name: TV lamp
      supported_features: 63
      state: 'on'
    switch.big_lamp:
      friendly_name: Big lamp
      state: 'off'
    switch.side_lamp:
      friendly_name: Side lamp
      state: 'on'
    light.stairs_lamp:
      friendly_name: Stairs lamp
      supported_features: 41
      state: 'off'
  icon: mdi:account-switch
- id: '1601072904685'

Last but not least, the automation is this:

- id: '1601065839750'
  alias: Watchdog for Cuddle time
  description: Flash lights when motion is detected upstairs
  trigger:
  - platform: state
    entity_id: binary_sensor.hue_motion_sensor_1_motion
    to: 'on'
  condition:
  - condition: state
    entity_id: scene.cuddle_time
    state: 'on'
    attribute: entity_id
  action:
  - service: script.flash_lights
    data: {}
  - delay: '15'
  - service: scene.turn_on
    data: {}
    entity_id: scene.relax
  mode: single

What I am really trying to achieve here is to trigger the automation once the scene “Cuddle time” is clicked and if and when motion is detected from the motion sensor, flash the lights downstairs and then turn off the scene and turn on the Relax scene (phew, that was close kids).

Right now, what happens is the scene is loaded, the script runs and automation runs ok but the automation keeps staying on. I want it to run once and once the motion is triggered to activate another scene thus making the Cuddle time automation to not trigger anymore.

I hope all the above make sense. If you can think of a better way of doing please be my guest. I am in uncharted waters here.