- alias: 'Turn Living Room Ceiling Light on when there is Movement'
  trigger:
    platform: state
    entity_id: binary_sensor.living_room_motion_sensor_occupancy
    from: 'off'
    to: 'on'
  condition:
    condition: or
    conditions:
      - condition: state
        entity_id: input_select.bed_mode
        state: 'on'
      - condition: state
        entity_id: input_select.bed_mode
        state: 'just on'
  action:
    service: light.turn_on
    target:
      entity_id: light.living_room_ceiling_light

- alias: 'Turn Living Room Ceiling Light off after last Movement'
  trigger:
    platform: state
    entity_id: binary_sensor.living_room_motion_sensor_occupancy
    from: 'on'
    to: 'off'
    for:
      minutes: 5
  condition:
    condition: or
    conditions:
      - condition: state
        entity_id: input_select.bed_mode
        state: 'on'
      - condition: state
        entity_id: input_select.bed_mode
        state: 'just on'
  action:
    service: light.turn_off
    target:
      entity_id: light.living_room_ceiling_light

- alias: 'Turn Kitchen Lights off when going to Bed'
  trigger:
    platform: state
    entity_id: input_select.bed_mode
    from: 'just on'
    to: 'on'
  action:
    service: light.turn_off
    target:
      entity_id: group.living_room_lights

- alias: 'Turn Living Room Ceiling Light on when there is Movement'
  trigger:
    platform: state
    entity_id: binary_sensor.living_room_motion_sensor_occupancy
    from: 'off'
    to: 'on'
  condition:
    condition: or
    conditions:
      - condition: state
        entity_id: input_select.bed_mode
        state: 'on'
      - condition: state
        entity_id: input_select.bed_mode
        state: 'just on'
  action:
    service: light.turn_on
    target:
      entity_id: light.living_room_ceiling_light

- alias: 'Turn Living Room Ceiling Light off after last Movement'
  trigger:
    platform: state
    entity_id: binary_sensor.living_room_motion_sensor_occupancy
    from: 'on'
    to: 'off'
    for:
      minutes: 5
  condition:
    condition: or
    conditions:
      - condition: state
        entity_id: input_select.bed_mode
        state: 'on'
      - condition: state
        entity_id: input_select.bed_mode
        state: 'just on'
  action:
    service: light.turn_off
    target:
      entity_id: light.living_room_ceiling_light

- alias: 'Turn Living Room Lights off when going to Bed'
  trigger:
    platform: state
    entity_id: input_select.bed_mode
    from: 'just on'
    to: 'on'
  action:
    service: light.turn_off
    target:
      entity_id: group.living_room_lights

Fix name of living room automation
Fix name of living room automation
