# This is triggered when there is presence in my office.

alias: Office Presence
description: ''
trigger:
  - type: motion
    platform: device
    device_id: d625925187ddb17b32bf81908591a822
    entity_id: binary_sensor.motion_office_occupancy
    domain: binary_sensor
condition: []
action:
  - service: script.turn_on
    target:
      entity_id:
        - script.office_plug_on
        - script.lamp_office_on
        - script.office_pc_wol
mode: single


# This is used to turn on the light.

alias: Office Lamp Uit
sequence:
  - type: turn_off
    device_id: bb47d9d1f9c33f77e34b5a3960d4d268
    entity_id: light.lamp_office
    domain: light
mode: single

#####################################################################################################################################

This is what happens when there is *no* presence in my office. 

alias: Office No Presence
description: ''
trigger:
  - type: no_motion
    platform: device
    device_id: d625925187ddb17b32bf81908591a822
    entity_id: binary_sensor.motion_office_occupancy
    domain: binary_sensor
    for:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
condition: []
action:
  - service: script.turn_on
    target:
      entity_id:
        - script.office_plug_off
        - script.office_lamp_off


alias: Office Stekker Uit
sequence:
  - type: turn_off
    device_id: a842e154277f85f05d0e4eb8d1497c22
    entity_id: switch.tradfrioffice
    domain: switch
mode: single

mode: single