# Replace these entities with your own:
# - binary_sensor.laundry_washing_machine_lid_contact
# - input_boolean.washer_running
# - input_boolean.washer_finished
# - timer.washer_finish_delay
# - timer.washer_reminder_timer

alias: Laundry - Washer - Lid Reset
description: >
  Clears the washer finished state and cancels timers when the lid is opened
  after the wash is complete.

mode: single

trigger:
  - platform: state
    entity_id: binary_sensor.laundry_washing_machine_lid_contact
    to: "on"
    id: lid_opened

condition:
  - condition: or
    conditions:
      - condition: state
        entity_id: input_boolean.washer_finished
        state: "on"

      - condition: state
        entity_id: timer.washer_finish_delay
        state: active

action:
  - service: input_boolean.turn_off
    target:
      entity_id:
        - input_boolean.washer_running
        - input_boolean.washer_finished

  - service: timer.cancel
    target:
      entity_id:
        - timer.washer_finish_delay
        - timer.washer_reminder_timer