# Turns on lights at sunset 
  - alias: 'Lys i glasskab i forgang'
    trigger:
      - platform: sun
        event: sunset
    condition: 
      - condition: time
        before: '21:30:00'
    action:
      service: homeassistant.turn_on
      entity_id: light.sonoff_100069a6cc

# Turns off lights 
  - alias: 'Sluk lys i glasskab i forgang'
    trigger:
      - platform: time
        at: '22:00:00'
    action:
      service: homeassistant.turn_off
      entity_id: light.sonoff_100069a6cc
      
# Turns on lights at 06:00
  - alias: 'Lys i glasskab i forgang morgen'
    trigger:
      - platform: time
        at: '06:00:00'
    condition: 
      - condition: state  # from sunset until sunrise
        entity_id: sun.sun
        state: 'below_horizon'
    action:
      service: homeassistant.turn_on
      entity_id: light.sonoff_100069a6cc

# Turns off lights at sunrise
  - alias: 'Sluk lys i glasskab i forgang morgen'
    trigger:
      - platform: sun
        event: sunrise
    action:
      service: homeassistant.turn_off
      entity_id: light.sonoff_100069a6cc
      
