Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0301· OpenAIAi2 WildChat-4.8M (AI2)

Write yaml to turn lights on if after sunset when roomba starts cleaning, and to turn…

  1. User

    Write yaml to turn lights on if after sunset when roomba starts cleaning, and to turn lights off after cleaning is complete if they were turned on by this automation

  2. Assistant
    - alias: 'Turn on lights when Roomba starts cleaning at night'
      trigger:
        platform: state
        entity_id: vacuum.roomba
        to: 'cleaning'
      condition:
        condition: and
        conditions:
          - condition: sun
            after: sunset
          - condition: state
            entity_id: light.living_room
            state: 'off'
      action:
        service: light.turn_on
        entity_id: light.living_room
    
    - alias: 'Turn off lights when Roomba is done cleaning'
      trigger:
        platform: state
        entity_id: vacuum.roomba
        to: 'docked'
      condition:
        condition: state
        entity_id: light.living_room
        state: 'on'
      action:
        service: light.turn_off
        entity_id: light.living_room
    
  3. User

    Write yaml triggered by if roomba starts cleaning after sunset or if roomba is already cleaning and it becomes after sunset to turn on a light switch

  4. Assistant
    - alias: 'Turn on light when Roomba starts cleaning after sunset'
      trigger:
        platform: or
        - platform: state
          entity_id: vacuum.roomba
          to: 'cleaning'
        - platform: state
          entity_id: vacuum.roomba
          to: 'on'
          from: 'off'
          for: '00:05:00'
      condition:
        condition: sun
        after: sunset
      action:
        service: switch.turn_on
        entity_id: switch.light_switch
    

    This automation will trigger when Roomba starts cleaning after sunset or if Roomba is already cleaning and it becomes after sunset. It will check if the sun has already set, and if it has, it will turn on the specified light switch.

  5. User

    Write a yaml when we are 1 hour before sunset turn on the lights

  6. Assistant
    - alias: 'Turn on lights 1 hour before sunset'
      trigger:
        platform: sun
        event: sunset
        offset: "-01:00:00"
      action:
        service: switch.turn_on
        entity_id: switch.light_switch
    

    This automation will trigger when we are 1 hour before sunset. The offset of "-01:00:00" specifies to trigger the automation when the event (sunset in this case) occurs 1 hour before its scheduled time. It will then turn on the specified light switch.