Xiaomi roborock connect to alexa

Here are my settings in configuration.yaml

vacuum:
  - platform: xiaomi_miio
    host: my ip
    token: my vacuum's token 

That part is working fine and I see the entity vacuum.xiaomi_vacuum_cleaner

I followed this guide

and added this to configuration.yaml

switch:
  - platform: template
    switches:
      vacuum:
        value_template: "{{ is_state('vacuum.xiaomi_vacuum_cleaner', 'on') }}"
        turn_on:
          service: vacuum.turn_on
          data:
            entity_id: vacuum.xiaomi_vacuum_cleaner
        turn_off:
          service: vacuum.return_to_base
          data:
            entity_id: vacuum.xiaomi_vacuum_cleaner
            
find_vacuum:
  alias: Find Vacuum
  sequence: 
    - service: vacuum.locate
      entity_id:
      - vacuum.xiaomi_vacuum_cleaner

I get an error
Component error: find_vacuum - Integration ‘find_vacuum’ not found.

But the big problem is when I tell Alexa to search for new devices it doesn’t find my vacuum.

Is there something I am missing?

Thank you for any help.

You put find_vacuum in your configuration.yaml?

That should go in scripts.

script:
  find_vacuum:
    sequence:
      ...
      ...

Also, don’t create a new script: section unless you don’t have one. Put it in the current script section.

Then you’ll have to add that script to your alexa config. Might have to mark it as an ACTIVITY_TRIGGER, not sure if scripts get auto marked like that or not.

Thank you for that info. The how to was not very clear.
I finally figured it out now.