  # - alias: 'Lys Daniel dag - arbejdsdag - sunrise'
  #   trigger:
  #     platform: time
  #     at: '06:00:00'
  #   condition:
  #     - condition: state
  #       entity_id: binary_sensor.arbejdsdag
  #       state: 'on'
  #   action:
  #     - service: script.sunrise


  - alias: 'Lys Daniel dag - arbejdsdag'
    trigger:
      platform: state
      entity_id: binary_sensor.hue_motion_sensor_2_motion
      to: 'on'
    condition:
      - condition: numeric_state
        entity_id: sensor.hue_motion_sensor_2_illuminance
        below: 90
      - condition: state
        entity_id: binary_sensor.arbejdsdag
        state: 'on'
      - condition: time
        after: '06:30:00'
        before: '19:30:00'
    action:
      - service: homeassistant.turn_on
        target: 
          entity_id: light.daniels_vaerelse
        data:
          brightness_pct: 100

  - alias: 'Lys Daniel dag - ikke arbejdsdag'
    trigger:
      platform: state
      entity_id: binary_sensor.hue_motion_sensor_2_motion
      to: 'on'
    condition:
      - condition: numeric_state
        entity_id: sensor.hue_motion_sensor_2_illuminance
        below: 90
      - condition: state
        entity_id: binary_sensor.arbejdsdag
        state: 'off'
      - condition: time
        after: '10:00:00'
        before: '19:45:00'
    action:
      - service: homeassistant.turn_on
        target: 
          entity_id: light.daniels_vaerelse
        data:
          brightness_pct: 100
          
  # - alias: 'Lys Daniel aften'
  #   trigger:
  #     platform: state
  #     entity_id: binary_sensor.hue_motion_sensor_2_motion
  #     to: 'on'
  #   condition:
  #     - condition: numeric_state
  #       entity_id: sensor.hue_motion_sensor_2_illuminance
  #       below: 90
  #     - condition: time
  #       after: '20:00:01'
  #       before: '21:00:00'
  #   action:
  #     - service: homeassistant.turn_on
  #       target: 
  #         entity_id: light.daniels_vaerelse
  #       data:
  #         brightness_pct: 50

          

  - alias: 'Sluk lys i Daniel'
    trigger:
      platform: state
      entity_id: binary_sensor.hue_motion_sensor_2_motion
      to: 'off'
      for:
        minutes: 10
    condition:
      - condition: time
        after: '05:00:00'
        before: '22:00:00'
    action:
      - service: homeassistant.turn_off
        data:
          entity_id:
            - light.daniels_vaerelse

