<commit_before>
- alias: 'Turn Garage Entry Light On'
  trigger:
    #If door opens
    - platform: state
      entity_id: binary_sensor.garage_entry_door_sensor_zwave
      from: 'off'
      to: 'on'
    #If motion detected
    - platform: state
      entity_id: binary_sensor.kitchen_motion_sensor
      to: 'on'
  condition:
    condition: or
    conditions:
    #Starting 1 hour before sunset
    - condition: sun
      after: sunset
      after_offset: "-1:00:00"
    #Low light levels
    - condition: numeric_state
      entity_id: sensor.kitchen_light_level
      below: 10
  action:
    service: light.turn_on
    entity_id: light.garage_entry

- alias: 'Turn Garage Entry Light Off'
  trigger:
    #If no motion
    - platform: state
      entity_id: binary_sensor.kitchen_motion_sensor
      from: 'on'
      to: 'off'
      for:
        hours: 0
        minutes: 0
        seconds: 15
    #If door has been opened and then closed for x amount of time
    - platform: state
      entity_id: binary_sensor.garage_entry_door_sensor_zwave
      from: 'on'
      to: 'off'
      for:
        hours: 0
        minutes: 0
        seconds: 30
    #If it's been on too long
    - platform: state
      entity_id: light.garage_entry
      to: 'on'
      # Alias for 'to'
      state: 'on'
      for:
        hours: 0
        minutes: 2
        seconds: 0
  # only turn light off if there is no motion in the kitchen
  #condition:
    #condition: state
    #entity_id: binary_sensor.kitchen_motion_sensor
    #state: 'off'
  action:
    service: light.turn_off
    entity_id: light.garage_entry

- alias: 'Turn Kitchen Light On'
  #If motion is detected
  trigger:
    platform: state
    entity_id: binary_sensor.kitchen_motion_sensor
    from: 'off'
    to: 'on'
  condition:
    condition: or
    conditions:
    #Starting 1 hour before sunset
    - condition: sun
      after: sunset
      after_offset: "-1:00:00"
    #Cloudy day
    #- condition: numeric_state
      #entity_id: sensor.yr_cloudiness
      #above: 75
    #Low light levels
    - condition: numeric_state
      entity_id: sensor.kitchen_light_level
      below: 10
  action:
    service: switch.turn_on
    entity_id: switch.kitchen_dimmer_zwave

- alias: 'Turn Kitchen Light Off'
  #If no motion after x amount of time
  trigger:
    platform: state
    entity_id: binary_sensor.kitchen_motion_sensor
    from: 'on'
    to: 'off'
    for:
      hours: 0
      minutes: 2
      seconds: 0
  action:
    service: switch.turn_off
    entity_id: switch.kitchen_dimmer_zwave

- alias: 'Turn Living Room Lights On'
  #When solar elevation is low
  trigger:
    platform: numeric_state
    entity_id: sun.sun
    value_template: '{{ state.attributes.elevation }}'
    below: 3.5
  action:
    service: switch.turn_on
    entity_id: switch.family_room_dimmer_zwave
<commit_msg>Adjusted lux conditions<commit_after>
- alias: 'Turn Garage Entry Light On'
  trigger:
    #If door opens
    - platform: state
      entity_id: binary_sensor.garage_entry_door_sensor_zwave
      from: 'off'
      to: 'on'
    #If motion detected
    - platform: state
      entity_id: binary_sensor.kitchen_motion_sensor
      to: 'on'
  condition:
    condition: or
    conditions:
    #Starting 1 hour before sunset
    - condition: sun
      after: sunset
      after_offset: "-1:00:00"
    #Low light levels
    - condition: numeric_state
      entity_id: sensor.kitchen_light_level
      below: 10
  action:
    service: light.turn_on
    entity_id: light.garage_entry

- alias: 'Turn Garage Entry Light Off'
  trigger:
    #If no motion
    - platform: state
      entity_id: binary_sensor.kitchen_motion_sensor
      from: 'on'
      to: 'off'
      for:
        hours: 0
        minutes: 0
        seconds: 15
    #If door has been opened and then closed for x amount of time
    - platform: state
      entity_id: binary_sensor.garage_entry_door_sensor_zwave
      from: 'on'
      to: 'off'
      for:
        hours: 0
        minutes: 0
        seconds: 30
    #If it's been on too long
    - platform: state
      entity_id: light.garage_entry
      to: 'on'
      # Alias for 'to'
      state: 'on'
      for:
        hours: 0
        minutes: 2
        seconds: 0
  # only turn light off if there is no motion in the kitchen
  #condition:
    #condition: state
    #entity_id: binary_sensor.kitchen_motion_sensor
    #state: 'off'
  action:
    service: light.turn_off
    entity_id: light.garage_entry

- alias: 'Turn Kitchen Light On'
  #If motion is detected
  trigger:
    platform: state
    entity_id: binary_sensor.kitchen_motion_sensor
    from: 'off'
    to: 'on'
  condition:
    condition: or
    conditions:
    #Starting 1 hour before sunset
    - condition: sun
      after: sunset
      after_offset: "-1:00:00"
    #Cloudy day
    #- condition: numeric_state
      #entity_id: sensor.yr_cloudiness
      #above: 75
    #Low light levels
    - condition: numeric_state
      entity_id: sensor.kitchen_light_level
      below: 5
  action:
    service: switch.turn_on
    entity_id: switch.kitchen_dimmer_zwave

- alias: 'Turn Kitchen Light Off'
  #If no motion after x amount of time
  trigger:
    platform: state
    entity_id: binary_sensor.kitchen_motion_sensor
    from: 'on'
    to: 'off'
    for:
      hours: 0
      minutes: 2
      seconds: 0
  action:
    service: switch.turn_off
    entity_id: switch.kitchen_dimmer_zwave

- alias: 'Turn Living Room Lights On'
  #When solar elevation is low
  trigger:
    platform: numeric_state
    entity_id: sun.sun
    value_template: '{{ state.attributes.elevation }}'
    below: 3.5
  action:
    service: switch.turn_on
    entity_id: switch.family_room_dimmer_zwave

{'fraction_non_alphanumeric': 0.07693658879325488, 'fraction_numerical': 0.011768838924995608, 'mean_word_length': 2.428055388320289, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4190896', 'n_tokens_mistral': 1917, 'n_tokens_neox': 1823, 'n_words': 546}