Dreame - Use Alexa to clean specific Room and Advanced Automation for vacuum

Dreame – Alexa Voice Commands & Scheduled Cleaning Blueprints

Ciao!
I created a set of Blueprints to let you control your Dreame vacuum cleaner using Alexa voice commands — and even schedule automatic cleanings.

:gear: These Blueprints have been transleted in English with GPT, so let me know if there are bugs/mispelling.
They’re still in beta, so feedback is very welcome!

I’m using the tassHack integration for Dreame devices to make these automations work seamlessly with Home Assistant.


:puzzle_piece: What the Blueprints do

1. :id_button: Room Helper

This Blueprint creates a simple helper that helps you discover the correct Room ID generated by the vacuum_mop_card integration.
It’s the starting point to correctly map your home layout to the Dreame device.

2. :broom: Room Script Generator

This one generates a script that lets you choose both the cleaning mode (Vacuum only, Mop only, or CleanGenius) and the specific room to clean.
You can rename the generated scripts and expose them to Alexa via Nabu Casa, Lambda, or Matter.
Then simply say things like:

“Alexa, start vacuuming the kitchen”
“Alexa, start mopping the bedroom”

:light_bulb: Note: You currently need to duplicate the script for every room/mode combination you want (a limitation of how Home Assistant handles Blueprints).

This method lets you clean your entire home by voice command — for example, by cloning the script three times per room:

  • Mopping the kitchen
  • Vacuuming the kitchen
  • Cleaning the kitchen

So Alexa can trigger each action with intuitive commands.

3. :four_o_clock: Scheduled Cleaning (Simple or Advanced)

This Blueprint allows you to automate cleanings on a schedule.
You can set up:

  • a Simple Mode (e.g., morning/evening cleaning), or
  • an Advanced Mode with up to 4 custom schedules per week.

You can also enable presence detection, so the cleaning starts only when nobody’s home.
Optionally, a reset boolean can automatically clear the “cleaning done” status to make sure routines run correctly the next day.


:package: Where to find them

All Blueprints can be found here:
:backhand_index_pointing_right: HA_BluePrints/Dreame at main · Magnum9O/HA_BluePrints


:brain: Example Setup

With these 3 Blueprints, you can:

  • Identify your room IDs,
  • Create personalized cleaning scripts per room and mode,
  • And automate recurring cleanings that adapt to your daily routine.

Enjoy your hands-free, fully automated Dreame cleaning setup!

Cheers
M

3 Likes

Hello Magnum9O,

Thanks for contributing to the community with a new Blueprint.

I have a suggestion for you. Many people who are not familiar with directory structures will have problems installing this without the Home Assistant MY tools.

Adding a MY link for this Blueprint to your top post would help them a lot.
Here is the link to make that.
Create a link – My Home Assistant

1 Like

thank you! =)
It seems I can’t edit the post anymore.

English version

1st Blueprint (Room List helper):
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.
2nd Blueprint (Script Creation for Alexa Exposure)
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.
3rd Blueprint (Automate you vacuum)
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Italian version

1 Blueprint (Room List helper):
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.
2 Blueprint (Espone ad Alexa gli script di pulizia)
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.
3rd Blueprint (Automatizza il tuo Dreame)
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Thanks a lot for the blueprint — really well done!
I’m already using voice commands with my Dreame robot.
When I say “Alexa, start Dreame,” Alexa asks, “Which room do you want to clean?” and I can just reply with any room name like “bedroom,” “bathroom,” or “living room.”
I’ve got two activation phrases — one for vacuuming only, and another for both vacuuming and mopping.
The issue is, I can’t remember how I originally set this up, since I followed a tutorial I can’t seem to find anymore.
Do you know if there’s a way to achieve something similar using your blueprint?
Thank you for sharing your blueprint!

Hello,

When I tried importing the 3rd blueprint, I received the following error.

while parsing a block mapping in “”, line 53, column 5: name: “Cleaning Performed” flag ^ expected , but found ‘’ in “”, line 53, column 32: name: “Cleaning Performed” flag ^

sorry for the late reply! I never receive any notification about your question :slight_smile: Did you still need any help?

It’s different :slight_smile: You create scripts and then recall them by alexca/google saying “start cleaning room” or “start vacuum room” etc
But you need to expose script to alexa or google

I also experienced the same error when I try to import the blueprint to Home assistant.

I found the issue, it should work now :slight_smile:

1 Like

I’ve never been able to get it to run and I’ve tried all the different settings.

mode: restart
max_exceeded: silent
variables:
  vac: vacuum.x40_master
  map_ent: camera.x40_master_map
  flag_cleaned: input_boolean.cleaned_today
  presence_ent: zone.home
  pres_val: '1'
  robot_slug: '{{ vac.split(''.'')[1] }}'
  cg_sel: select.{{ robot_slug }}_cleangenius
  cm_sel: select.{{ robot_slug }}_cleaning_mode
  m_on: true
  m_time: '07:00:00'
  m_days:
    - mon
    - fri
  m_preset: genius
  m_rooms: ''
  e_on: false
  e_time: '16:00:00'
  e_days:
    - mon
    - fri
  e_preset: genius
  e_rooms: ''
  a_on: false
  a_time: '09:00:00'
  a_days: []
  a_preset: sweeping
  a_rooms: ''
  b_on: false
  b_time: '10:30:00'
  b_days: []
  b_preset: mopping
  b_rooms: ''
  c_on: false
  c_time: '15:00:00'
  c_days: []
  c_preset: genius
  c_rooms: ''
  d_on: false
  d_time: '18:30:00'
  d_days: []
  d_preset: genius_deep
  d_rooms: ''
triggers:
  - platform: time
    at: '23:59:00'
    id: reset
  - platform: time
    at: '{{ m_time }}'
    id: morning
  - platform: time
    at: '{{ e_time }}'
    id: evening
  - platform: time
    at: '{{ a_time }}'
    id: blockA
  - platform: time
    at: '{{ b_time }}'
    id: blockB
  - platform: time
    at: '{{ c_time }}'
    id: blockC
  - platform: time
    at: '{{ d_time }}'
    id: blockD
actions:
  - choose:
      - conditions: '{{ trigger.id == ''reset'' }}'
        sequence:
          - target:
              entity_id: '{{ flag_cleaned }}'
            action: input_boolean.turn_off
      - conditions: |
          {{ trigger.id == 'morning'
             and m_on
             and (m_days | count == 0 or now().isoweekday() in
               [1 if 'mon' in m_days else 0,
                2 if 'tue' in m_days else 0,
                3 if 'wed' in m_days else 0,
                4 if 'thu' in m_days else 0,
                5 if 'fri' in m_days else 0,
                6 if 'sat' in m_days else 0,
                7 if 'sun' in m_days else 0]) }}
        sequence:
          - choose:
              - conditions: >
                  {{ presence_ent != '' and pres_val != '' and
                  states(presence_ent) != pres_val }}
                sequence: []
            default:
              - variables:
                  preset_now: '{{ m_preset }}'
                  rooms_now: '{{ m_rooms }}'
              - sequence:
                  - variables:
                      raw_rooms: '{{ rooms_now | string | trim }}'
                      seg_list: |
                        {% set txt = raw_rooms %} {% if txt == '' %}
                          []
                        {% else %}
                          {% set parts = txt.split(',') | map('trim') | list %}
                          {% set rdict = state_attr(map_ent, 'rooms') or {} %}
                          {% set out = [] %}
                          {% for p in parts %}
                            {% if p|int|string == p %}
                              {% set out = out + [ p|int ] %}
                            {% else %}
                              {% set rid = (rdict|selectattr('1.name','equalto',p)|map(attribute='1.room_id')|list|first) %}
                              {% if rid is not none %}
                                {% set out = out + [ rid|int ] %}
                              {% endif %}
                            {% endif %}
                          {% endfor %}
                          {{ out }}
                        {% endif %}
                  - choose:
                      - conditions: >-
                          {{ preset_now in
                          ['sweeping','mopping','sweeping_and_mopping','mopping_after_sweeping']
                          }}
                        sequence:
                          - target:
                              entity_id: '{{ cg_sel }}'
                            data:
                              option: 'off'
                            action: select.select_option
                          - wait_template: >-
                              {{ states(cg_sel) in
                              ['off','unknown','unavailable','none'] }}
                            timeout: '00:00:08'
                            continue_on_timeout: true
                          - target:
                              entity_id: '{{ cm_sel }}'
                            data:
                              option: '{{ preset_now }}'
                            action: select.select_option
                          - wait_template: '{{ states(cm_sel) == preset_now }}'
                            timeout: '00:00:08'
                            continue_on_timeout: true
                          - target:
                              entity_id: '{{ vac }}'
                            data:
                              segments: '{{ seg_list }}'
                            action: dreame_vacuum.vacuum_clean_segment
                      - conditions: '{{ preset_now == ''genius'' }}'
                        sequence:
                          - target:
                              entity_id: '{{ cg_sel }}'
                            data:
                              option: routine_cleaning
                            action: select.select_option
                          - wait_template: >-
                              {{ states(cg_sel) in
                              ['routine_cleaning','unknown','unavailable','none']
                              }}
                            timeout: '00:00:08'
                            continue_on_timeout: true
                          - target:
                              entity_id: '{{ vac }}'
                            data:
                              segments: '{{ seg_list }}'
                            action: dreame_vacuum.vacuum_clean_segment
                      - conditions: '{{ preset_now == ''genius_deep'' }}'
                        sequence:
                          - target:
                              entity_id: '{{ cg_sel }}'
                            data:
                              option: deep_cleaning
                            action: select.select_option
                          - wait_template: >-
                              {{ states(cg_sel) in
                              ['deep_cleaning','unknown','unavailable','none']
                              }}
                            timeout: '00:00:08'
                            continue_on_timeout: true
                          - target:
                              entity_id: '{{ vac }}'
                            data:
                              segments: '{{ seg_list }}'
                            action: dreame_vacuum.vacuum_clean_segment
                  - target:
                      entity_id: '{{ flag_cleaned }}'
                    action: input_boolean.turn_on
      - conditions: |
          {{ trigger.id == 'evening'
             and e_on
             and (e_days | count == 0 or now().isoweekday() in
               [1 if 'mon' in e_days else 0,
                2 if 'tue' in e_days else 0,
                3 if 'wed' in e_days else 0,
                4 if 'thu' in e_days else 0,
                5 if 'fri' in e_days else 0,
                6 if 'sat' in e_days else 0,
                7 if 'sun' in e_days else 0]) }}
        sequence:
          - choose:
              - conditions: >
                  {{ presence_ent != '' and pres_val != '' and
                  states(presence_ent) != pres_val }}
                sequence: []
            default:
              - variables:
                  preset_now: '{{ e_preset }}'
                  rooms_now: '{{ e_rooms }}'
              - sequence:
                  - variables:
                      raw_rooms: '{{ rooms_now | string | trim }}'
                      seg_list: |
                        {% set txt = raw_rooms %} {% if txt == '' %}
                          []
                        {% else %}
                          {% set parts = txt.split(',') | map('trim') | list %}
                          {% set rdict = state_attr(map_ent, 'rooms') or {} %}
                          {% set out = [] %}
                          {% for p in parts %}
                            {% if p|int|string == p %}
                              {% set out = out + [ p|int ] %}
                            {% else %}
                              {% set rid = (rdict|selectattr('1.name','equalto',p)|map(attribute='1.room_id')|list|first) %}
                              {% if rid is not none %}
                                {% set out = out + [ rid|int ] %}
                              {% endif %}
                            {% endif %}
                          {% endfor %}
                          {{ out }}
                        {% endif %}
                  - choose:
                      - conditions: >-
                          {{ preset_now in
                          ['sweeping','mopping','sweeping_and_mopping','mopping_after_sweeping']
                          }}
                        sequence:
                          - target:
                              entity_id: '{{ cg_sel }}'
                            data:
                              option: 'off'
                            action: select.select_option
                          - wait_template: >-
                              {{ states(cg_sel) in
                              ['off','unknown','unavailable','none'] }}
                            timeout: '00:00:08'
                            continue_on_timeout: true
                          - target:
                              entity_id: '{{ cm_sel }}'
                            data:
                              option: '{{ preset_now }}'
                            action: select.select_option
                          - wait_template: '{{ states(cm_sel) == preset_now }}'
                            timeout: '00:00:08'
                            continue_on_timeout: true
                          - target:
                              entity_id: '{{ vac }}'
                            data:
                              segments: '{{ seg_list }}'
                            action: dreame_vacuum.vacuum_clean_segment
                      - conditions: '{{ preset_now == ''genius'' }}'
                        sequence:
                          - target:
                              entity_id: '{{ cg_sel }}'
                            data:
                              option: routine_cleaning
                            action: select.select_option
                          - wait_template: >-
                              {{ states(cg_sel) in
                              ['routine_cleaning','unknown','unavailable','none']
                              }}
                            timeout: '00:00:08'
                            continue_on_timeout: true
                          - target:
                              entity_id: '{{ vac }}'
                            data:
                              segments: '{{ seg_list }}'
                            action: dreame_vacuum.vacuum_clean_segment
                      - conditions: '{{ preset_now == ''genius_deep'' }}'
                        sequence:
                          - target:
                              entity_id: '{{ cg_sel }}'
                            data:
                              option: deep_cleaning
                            action: select.select_option
                          - wait_template: >-
                              {{ states(cg_sel) in
                              ['deep_cleaning','unknown','unavailable','none']
                              }}
                            timeout: '00:00:08'
                            continue_on_timeout: true
                          - target:
                              entity_id: '{{ vac }}'
                            data:
                              segments: '{{ seg_list }}'
                            action: dreame_vacuum.vacuum_clean_segment
                  - target:
                      entity_id: '{{ flag_cleaned }}'
                    action: input_boolean.turn_on
      - conditions: >
          {{ trigger.id == 'blockA' and a_on and (a_days | count == 0 or
          now().isoweekday() in
            [1 if 'mon' in a_days else 0,2 if 'tue' in a_days else 0,3 if 'wed' in a_days else 0,
             4 if 'thu' in a_days else 0,5 if 'fri' in a_days else 0,6 if 'sat' in a_days else 0,
             7 if 'sun' in a_days else 0]) }}
        sequence:
          - variables:
              preset_now: '{{ a_preset }}'
              rooms_now: '{{ a_rooms }}'
          - sequence:
              - variables:
                  raw_rooms: '{{ rooms_now | string | trim }}'
                  seg_list: |
                    {% set txt = raw_rooms %} {% if txt == '' %}
                      []
                    {% else %}
                      {% set parts = txt.split(',') | map('trim') | list %}
                      {% set rdict = state_attr(map_ent, 'rooms') or {} %}
                      {% set out = [] %}
                      {% for p in parts %}
                        {% if p|int|string == p %}
                          {% set out = out + [ p|int ] %}
                        {% else %}
                          {% set rid = (rdict|selectattr('1.name','equalto',p)|map(attribute='1.room_id')|list|first) %}
                          {% if rid is not none %}
                            {% set out = out + [ rid|int ] %}
                          {% endif %}
                        {% endif %}
                      {% endfor %}
                      {{ out }}
                    {% endif %}
              - choose:
                  - conditions: >-
                      {{ preset_now in
                      ['sweeping','mopping','sweeping_and_mopping','mopping_after_sweeping']
                      }}
                    sequence:
                      - target:
                          entity_id: '{{ cg_sel }}'
                        data:
                          option: 'off'
                        action: select.select_option
                      - wait_template: >-
                          {{ states(cg_sel) in
                          ['off','unknown','unavailable','none'] }}
                        timeout: '00:00:08'
                        continue_on_timeout: true
                      - target:
                          entity_id: '{{ cm_sel }}'
                        data:
                          option: '{{ preset_now }}'
                        action: select.select_option
                      - wait_template: '{{ states(cm_sel) == preset_now }}'
                        timeout: '00:00:08'
                        continue_on_timeout: true
                      - target:
                          entity_id: '{{ vac }}'
                        data:
                          segments: '{{ seg_list }}'
                        action: dreame_vacuum.vacuum_clean_segment
                  - conditions: '{{ preset_now == ''genius'' }}'
                    sequence:
                      - target:
                          entity_id: '{{ cg_sel }}'
                        data:
                          option: routine_cleaning
                        action: select.select_option
                      - wait_template: >-
                          {{ states(cg_sel) in
                          ['routine_cleaning','unknown','unavailable','none'] }}
                        timeout: '00:00:08'
                        continue_on_timeout: true
                      - target:
                          entity_id: '{{ vac }}'
                        data:
                          segments: '{{ seg_list }}'
                        action: dreame_vacuum.vacuum_clean_segment
                  - conditions: '{{ preset_now == ''genius_deep'' }}'
                    sequence:
                      - target:
                          entity_id: '{{ cg_sel }}'
                        data:
                          option: deep_cleaning
                        action: select.select_option
                      - wait_template: >-
                          {{ states(cg_sel) in
                          ['deep_cleaning','unknown','unavailable','none'] }}
                        timeout: '00:00:08'
                        continue_on_timeout: true
                      - target:
                          entity_id: '{{ vac }}'
                        data:
                          segments: '{{ seg_list }}'
                        action: dreame_vacuum.vacuum_clean_segment
              - target:
                  entity_id: '{{ flag_cleaned }}'
                action: input_boolean.turn_on
      - conditions: >
          {{ trigger.id == 'blockB' and b_on and (b_days | count == 0 or
          now().isoweekday() in
            [1 if 'mon' in b_days else 0,2 if 'tue' in b_days else 0,3 if 'wed' in b_days else 0,
             4 if 'thu' in b_days else 0,5 if 'fri' in b_days else 0,6 if 'sat' in b_days else 0,
             7 if 'sun' in b_days else 0]) }}
        sequence:
          - variables:
              preset_now: '{{ b_preset }}'
              rooms_now: '{{ b_rooms }}'
          - sequence:
              - variables:
                  raw_rooms: '{{ rooms_now | string | trim }}'
                  seg_list: |
                    {% set txt = raw_rooms %} {% if txt == '' %}
                      []
                    {% else %}
                      {% set parts = txt.split(',') | map('trim') | list %}
                      {% set rdict = state_attr(map_ent, 'rooms') or {} %}
                      {% set out = [] %}
                      {% for p in parts %}
                        {% if p|int|string == p %}
                          {% set out = out + [ p|int ] %}
                        {% else %}
                          {% set rid = (rdict|selectattr('1.name','equalto',p)|map(attribute='1.room_id')|list|first) %}
                          {% if rid is not none %}
                            {% set out = out + [ rid|int ] %}
                          {% endif %}
                        {% endif %}
                      {% endfor %}
                      {{ out }}
                    {% endif %}
              - choose:
                  - conditions: >-
                      {{ preset_now in
                      ['sweeping','mopping','sweeping_and_mopping','mopping_after_sweeping']
                      }}
                    sequence:
                      - target:
                          entity_id: '{{ cg_sel }}'
                        data:
                          option: 'off'
                        action: select.select_option
                      - wait_template: >-
                          {{ states(cg_sel) in
                          ['off','unknown','unavailable','none'] }}
                        timeout: '00:00:08'
                        continue_on_timeout: true
                      - target:
                          entity_id: '{{ cm_sel }}'
                        data:
                          option: '{{ preset_now }}'
                        action: select.select_option
                      - wait_template: '{{ states(cm_sel) == preset_now }}'
                        timeout: '00:00:08'
                        continue_on_timeout: true
                      - target:
                          entity_id: '{{ vac }}'
                        data:
                          segments: '{{ seg_list }}'
                        action: dreame_vacuum.vacuum_clean_segment
                  - conditions: '{{ preset_now == ''genius'' }}'
                    sequence:
                      - target:
                          entity_id: '{{ cg_sel }}'
                        data:
                          option: routine_cleaning
                        action: select.select_option
                      - wait_template: >-
                          {{ states(cg_sel) in
                          ['routine_cleaning','unknown','unavailable','none'] }}
                        timeout: '00:00:08'
                        continue_on_timeout: true
                      - target:
                          entity_id: '{{ vac }}'
                        data:
                          segments: '{{ seg_list }}'
                        action: dreame_vacuum.vacuum_clean_segment
                  - conditions: '{{ preset_now == ''genius_deep'' }}'
                    sequence:
                      - target:
                          entity_id: '{{ cg_sel }}'
                        data:
                          option: deep_cleaning
                        action: select.select_option
                      - wait_template: >-
                          {{ states(cg_sel) in
                          ['deep_cleaning','unknown','unavailable','none'] }}
                        timeout: '00:00:08'
                        continue_on_timeout: true
                      - target:
                          entity_id: '{{ vac }}'
                        data:
                          segments: '{{ seg_list }}'
                        action: dreame_vacuum.vacuum_clean_segment
              - target:
                  entity_id: '{{ flag_cleaned }}'
                action: input_boolean.turn_on
      - conditions: >
          {{ trigger.id == 'blockC' and c_on and (c_days | count == 0 or
          now().isoweekday() in
            [1 if 'mon' in c_days else 0,2 if 'tue' in c_days else 0,3 if 'wed' in c_days else 0,
             4 if 'thu' in c_days else 0,5 if 'fri' in c_days else 0,6 if 'sat' in c_days else 0,
             7 if 'sun' in c_days else 0]) }}
        sequence:
          - variables:
              preset_now: '{{ c_preset }}'
              rooms_now: '{{ c_rooms }}'
          - sequence:
              - variables:
                  raw_rooms: '{{ rooms_now | string | trim }}'
                  seg_list: |
                    {% set txt = raw_rooms %} {% if txt == '' %}
                      []
                    {% else %}
                      {% set parts = txt.split(',') | map('trim') | list %}
                      {% set rdict = state_attr(map_ent, 'rooms') or {} %}
                      {% set out = [] %}
                      {% for p in parts %}
                        {% if p|int|string == p %}
                          {% set out = out + [ p|int ] %}
                        {% else %}
                          {% set rid = (rdict|selectattr('1.name','equalto',p)|map(attribute='1.room_id')|list|first) %}
                          {% if rid is not none %}
                            {% set out = out + [ rid|int ] %}
                          {% endif %}
                        {% endif %}
                      {% endfor %}
                      {{ out }}
                    {% endif %}
              - choose:
                  - conditions: >-
                      {{ preset_now in
                      ['sweeping','mopping','sweeping_and_mopping','mopping_after_sweeping']
                      }}
                    sequence:
                      - target:
                          entity_id: '{{ cg_sel }}'
                        data:
                          option: 'off'
                        action: select.select_option
                      - wait_template: >-
                          {{ states(cg_sel) in
                          ['off','unknown','unavailable','none'] }}
                        timeout: '00:00:08'
                        continue_on_timeout: true
                      - target:
                          entity_id: '{{ cm_sel }}'
                        data:
                          option: '{{ preset_now }}'
                        action: select.select_option
                      - wait_template: '{{ states(cm_sel) == preset_now }}'
                        timeout: '00:00:08'
                        continue_on_timeout: true
                      - target:
                          entity_id: '{{ vac }}'
                        data:
                          segments: '{{ seg_list }}'
                        action: dreame_vacuum.vacuum_clean_segment
                  - conditions: '{{ preset_now == ''genius'' }}'
                    sequence:
                      - target:
                          entity_id: '{{ cg_sel }}'
                        data:
                          option: routine_cleaning
                        action: select.select_option
                      - wait_template: >-
                          {{ states(cg_sel) in
                          ['routine_cleaning','unknown','unavailable','none'] }}
                        timeout: '00:00:08'
                        continue_on_timeout: true
                      - target:
                          entity_id: '{{ vac }}'
                        data:
                          segments: '{{ seg_list }}'
                        action: dreame_vacuum.vacuum_clean_segment
                  - conditions: '{{ preset_now == ''genius_deep'' }}'
                    sequence:
                      - target:
                          entity_id: '{{ cg_sel }}'
                        data:
                          option: deep_cleaning
                        action: select.select_option
                      - wait_template: >-
                          {{ states(cg_sel) in
                          ['deep_cleaning','unknown','unavailable','none'] }}
                        timeout: '00:00:08'
                        continue_on_timeout: true
                      - target:
                          entity_id: '{{ vac }}'
                        data:
                          segments: '{{ seg_list }}'
                        action: dreame_vacuum.vacuum_clean_segment
              - target:
                  entity_id: '{{ flag_cleaned }}'
                action: input_boolean.turn_on
      - conditions: >
          {{ trigger.id == 'blockD' and d_on and (d_days | count == 0 or
          now().isoweekday() in
            [1 if 'mon' in d_days else 0,2 if 'tue' in d_days else 0,3 if 'wed' in d_days else 0,
             4 if 'thu' in d_days else 0,5 if 'fri' in d_days else 0,6 if 'sat' in d_days else 0,
             7 if 'sun' in d_days else 0]) }}
        sequence:
          - variables:
              preset_now: '{{ d_preset }}'
              rooms_now: '{{ d_rooms }}'
          - sequence:
              - variables:
                  raw_rooms: '{{ rooms_now | string | trim }}'
                  seg_list: |
                    {% set txt = raw_rooms %} {% if txt == '' %}
                      []
                    {% else %}
                      {% set parts = txt.split(',') | map('trim') | list %}
                      {% set rdict = state_attr(map_ent, 'rooms') or {} %}
                      {% set out = [] %}
                      {% for p in parts %}
                        {% if p|int|string == p %}
                          {% set out = out + [ p|int ] %}
                        {% else %}
                          {% set rid = (rdict|selectattr('1.name','equalto',p)|map(attribute='1.room_id')|list|first) %}
                          {% if rid is not none %}
                            {% set out = out + [ rid|int ] %}
                          {% endif %}
                        {% endif %}
                      {% endfor %}
                      {{ out }}
                    {% endif %}
              - choose:
                  - conditions: >-
                      {{ preset_now in
                      ['sweeping','mopping','sweeping_and_mopping','mopping_after_sweeping']
                      }}
                    sequence:
                      - target:
                          entity_id: '{{ cg_sel }}'
                        data:
                          option: 'off'
                        action: select.select_option
                      - wait_template: >-
                          {{ states(cg_sel) in
                          ['off','unknown','unavailable','none'] }}
                        timeout: '00:00:08'
                        continue_on_timeout: true
                      - target:
                          entity_id: '{{ cm_sel }}'
                        data:
                          option: '{{ preset_now }}'
                        action: select.select_option
                      - wait_template: '{{ states(cm_sel) == preset_now }}'
                        timeout: '00:00:08'
                        continue_on_timeout: true
                      - target:
                          entity_id: '{{ vac }}'
                        data:
                          segments: '{{ seg_list }}'
                        action: dreame_vacuum.vacuum_clean_segment
                  - conditions: '{{ preset_now == ''genius'' }}'
                    sequence:
                      - target:
                          entity_id: '{{ cg_sel }}'
                        data:
                          option: routine_cleaning
                        action: select.select_option
                      - wait_template: >-
                          {{ states(cg_sel) in
                          ['routine_cleaning','unknown','unavailable','none'] }}
                        timeout: '00:00:08'
                        continue_on_timeout: true
                      - target:
                          entity_id: '{{ vac }}'
                        data:
                          segments: '{{ seg_list }}'
                        action: dreame_vacuum.vacuum_clean_segment
                  - conditions: '{{ preset_now == ''genius_deep'' }}'
                    sequence:
                      - target:
                          entity_id: '{{ cg_sel }}'
                        data:
                          option: deep_cleaning
                        action: select.select_option
                      - wait_template: >-
                          {{ states(cg_sel) in
                          ['deep_cleaning','unknown','unavailable','none'] }}
                        timeout: '00:00:08'
                        continue_on_timeout: true
                      - target:
                          entity_id: '{{ vac }}'
                        data:
                          segments: '{{ seg_list }}'
                        action: dreame_vacuum.vacuum_clean_segment
              - target:
                  entity_id: '{{ flag_cleaned }}'
                action: input_boolean.turn_on
conditions: []
id: '1775291628828'
alias: Dreame Scheduled Cleaning With Mop
description: ''

Any ideas?

Please add ‘charging_completed’ to the list of Dreame robot state. I believe this is one of the roadblocks.

Even when all other conditions are ‘True’, the automation still ends as a false is thrown when it comes to schedule. Even if I set only the main schedule, it still fails.