Last active
October 26, 2025 13:26
-
-
Save salimkayabasi/c6d3faeead35b1e42cc625ddd285fac2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| blueprint: | |
| name: Ecovacs Paused Resume (with Retry Limit) | |
| description: Automatically triggers the Ecovacs robot to continue if it pauses, but stops retrying after a set limit. Sends notifications for all events. | |
| domain: automation | |
| source_url: https://gist.github.com/salimkayabasi/c6d3faeead35b1e42cc625ddd285fac2 | |
| input: | |
| vacuum_entity: | |
| name: Ecovacs Robot Vacuum | |
| description: The entity_id of your Ecovacs robot vacuum (e.g., vacuum.my_robot). | |
| selector: | |
| entity: | |
| domain: vacuum | |
| retry_counter_helper: | |
| name: Retry Counter (Input Number Helper) | |
| description: A Home Assistant Input Number Helper (e.g., input_number.ecovacs_retry_count) used to track retries. MUST be created manually beforehand with a min value of 0. | |
| selector: | |
| entity: | |
| domain: input_number | |
| max_retries: | |
| name: Maximum Retries | |
| description: The maximum number of times the automation will try to resume the vacuum before giving up. | |
| default: 3 | |
| selector: | |
| number: | |
| min: 1 | |
| max: 10 | |
| mode: slider | |
| step: 1 | |
| notification_entity: | |
| name: Notification Entity | |
| description: The notification entity to use for alerts (e.g., notify.mobile_app_your_phone, notify.telegram). | |
| selector: | |
| entity: | |
| domain: notify | |
| paused_state: | |
| name: Paused State | |
| description: The state your vacuum is in when it *pauses* for an internal reason (usually 'paused' or similar). | |
| default: 'paused' | |
| final_done_state: | |
| name: Task Complete State | |
| description: The state your vacuum is in when the task is fully completed (usually 'docked' or 'returning'). | |
| default: 'docked' | |
| mode: queued | |
| max: 10 | |
| trigger: | |
| # Trigger 1: Robot changes to the 'paused' state (needs resume) | |
| - platform: state | |
| entity_id: !input vacuum_entity | |
| to: !input paused_state | |
| id: 'robot_paused' | |
| # Trigger 2: Robot changes to the 'final_done_state' (task complete) | |
| - platform: state | |
| entity_id: !input vacuum_entity | |
| to: !input final_done_state | |
| id: 'task_done' | |
| condition: | |
| # General check: Prevent running if the robot is starting a clean from the dock | |
| - condition: template | |
| value_template: "{{ trigger.from_state.state != 'docked' }}" | |
| action: | |
| # --- Assigning !input to variables for use in templates --- | |
| - variables: | |
| notify_ent: !input notification_entity | |
| retry_helper_ent: !input retry_counter_helper | |
| vacuum_ent: !input vacuum_entity | |
| max_retries_value: !input max_retries | |
| # Extract values for use in service calls and messages | |
| notify_service: "{{ notify_ent.split('.')[1] }}" | |
| vacuum_name: "{{ states(vacuum_ent).name }}" | |
| retry_count: "{{ states(retry_helper_ent).state | int(0) }}" | |
| - choose: | |
| # Action 1: Handle Paused State - Attempt to continue (with retry limit) | |
| - conditions: | |
| - condition: trigger | |
| id: 'robot_paused' | |
| # Condition: Check if current retry count is less than max retries | |
| - condition: template | |
| value_template: > | |
| {{ retry_count < max_retries_value | int(0) }} | |
| sequence: | |
| # 1. Increment the retry counter | |
| - service: input_number.increment | |
| target: | |
| entity_id: !input retry_counter_helper | |
| # 2. Trigger "Continue" | |
| - service: vacuum.start | |
| target: | |
| entity_id: !input vacuum_entity | |
| # 3. Notify of the action taken | |
| - service: "notify.{{ notify_service }}" | |
| data: | |
| title: "🤖 Ecovacs Auto-Resume (Retry #{{ retry_count + 1 }})" | |
| message: "The vacuum **{{ vacuum_name }}** paused, but I've triggered 'Continue'. (Retry: {{ retry_count + 1 }}/{{ max_retries_value }})" | |
| # Action 2: Handle Task Done State - Notify completion and RESET retry counter | |
| - conditions: | |
| - condition: trigger | |
| id: 'task_done' | |
| sequence: | |
| # 1. Reset the retry counter | |
| - service: input_number.set_value | |
| target: | |
| entity_id: !input retry_counter_helper | |
| data: | |
| value: 0 | |
| # 2. Notify of completion | |
| - service: "notify.{{ notify_service }}" | |
| data: | |
| title: "✅ Ecovacs Task Complete" | |
| message: "The vacuum **{{ vacuum_name }}** has finished its cleaning task and is back at the dock. Retry counter has been reset." | |
| # Default Action: Handle Max Retries Exceeded (only runs if 'robot_paused' and the retry limit was reached) | |
| default: | |
| - condition: trigger | |
| id: 'robot_paused' | |
| # Notify of failure | |
| - service: "notify.{{ notify_service }}" | |
| data: | |
| title: "🛑 Ecovacs Resume FAILED" | |
| message: "The vacuum **{{ vacuum_name }}** paused and the max retry limit of {{ max_retries_value }} was reached. Please check the robot manually." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment