diff --git a/packages/laundry/laundry.yaml b/packages/laundry/laundry.yaml index 922ef94..ee9b9f3 100644 --- a/packages/laundry/laundry.yaml +++ b/packages/laundry/laundry.yaml @@ -10,6 +10,23 @@ input_select: - Check - Triggered + washer_complete_state: + name: Washer Complete Detect State + options: + - Idle + - Stage 1 # Iw > 4A, <70s + - Stage 2 # Iw ~ [2A, 4A], 60s + - Stage 3 # dIw ~ [-0.8A, -0.5A], 60s + - Triggered # Iw < 0.2A, 60s + +input_number: + washer_complete_threshold_low: + min: 0.0 + max: 4.0 + washer_complete_threshold_high: + min: 0.0 + max: 4.0 + # ----------------------------------------------------------------------------- # Laundry Automations automation: @@ -26,6 +43,128 @@ automation: data: message: Dryer is done + + - alias: Washer Complete Detect - Stage 1 + mode: single + trigger: + - platform: numeric_state + entity_id: sensor.washer_power_electric_consumption_a + above: 4 + condition: + - "{{ is_state('input_select.washer_complete_detect_state', 'Idle') }}" + action: + - service: input_select.select_option + target: + entity_id: input_select.washer_complete_detect_state + data: + option: Stage 1 + + - alias: Washer Complete Detect - Stage 2 + mode: single + trigger: + - platform: numeric_state + entity_id: sensor.washer_power_electric_consumption_a + above: 2 + below: 4 + for: + seconds: 60 + condition: + - "{{ is_state('input_select.washer_complete_detect_state', 'Stage 1') }}" + action: + - service: input_select.select_option + target: + entity_id: input_select.washer_complete_detect_state + data: + option: Stage 2 + - action: input_number.set_value + target: + entity_id: input_number.washer_complete_threshold_low + data: + value: "{{ states('sensor.washer_power_electric_consumption_a')|float - 1.0 }}" + - action: input_number.set_value + target: + entity_id: input_number.washer_complete_threshold_high + data: + value: "{{ states('sensor.washer_power_electric_consumption_a')|float - 0.5 }}" + + - alias: Washer Complete Detect - Stage 3 + mode: single + trigger: + - platform: numeric_state + entity_id: sensor.washer_power_electric_consumption_a + above: "{{ states('input_number.washer_complete_threshold_low')|float }}" + below: "{{ states('input_number.washer_complete_threshold_high')|float }}" + for: + seconds: 60 + condition: + - "{{ is_state('input_select.washer_complete_detect_state', 'Stage 2') }}" + action: + - service: input_select.select_option + target: + entity_id: input_select.washer_complete_detect_state + data: + option: Stage 3 + + - alias: Washer Complete Detect - Trigger + mode: single + trigger: + - platform: numeric_state + entity_id: sensor.washer_power_electric_consumption_a + below: 0.2 + for: + seconds: 60 + condition: + - "{{ is_state('input_select.washer_complete_detect_state', 'Stage 3') }}" + action: + - service: input_select.select_option + target: + entity_id: input_select.washer_complete_detect_state + data: + option: Triggered + + - alias: Washer Complete Detect - Timeout + mode: single + trigger: + - platform: state + entity_id: input_select.washer_complete_detect_state + to: Stage 1 + for: + seconds: 180 + - platform: state + entity_id: input_select.washer_complete_detect_state + to: Stage 2 + for: + seconds: 180 + - platform: state + entity_id: input_select.washer_complete_detect_state + to: Stage 3 + for: + seconds: 180 + - platform: state + entity_id: input_select.washer_complete_detect_state + to: Triggered + for: + seconds: 60 + action: + - service: input_select.select_option + target: + entity_id: input_select.washer_complete_detect_state + data: + option: Idle + + - alias: Notify when Washer Done + mode: single + trigger: + - platform: state + entity_id: input_select.washer_complete_detect_state + to: Triggered + action: + - service: notify.everyone + data: + message: Washer is Done + + + - alias: Washer Final Pump-Out - Check mode: single trigger: