In this guide, we’ll set up Home Assistant (HA) to do the following:
- Control your Roborock vacuum via Home Assistant scripts and automations.
- Execute Roborock room cleaning with an NFC tag.
- Use Siri to start Roborock room cleaning.
Note: newer Roborock vacuums may have better support with Apple HomeKit, but the s7 does not. It claims to support Siri Shortcuts, but they never worked reliably for me. Additionally, I’ve found that making Home Assistant the source of truth for my entire smart home has made it much faster and more reliable.
The pre-requisites for this guide:
- A Roborock vacuum managed in the Roborock app, with a house map set up. (Optionally, these rooms should loosely match the rooms/areas set up in Home Assistant.) I have a Roborock s7.
- An existing Home Assistant installation. I’m running HA OS 15.2 (Core v2025.5.2) in a VM, and have the iOS app on my phone. I also have a HomeKit (HK) bridge set up in HA already, which forwards things controlled by Home Assistant into Apple’s ecosystem.
- This guide assumes you know a small amount about how to use Home Assistant. But as long as you can click your way around the HA UI and google things you don’t know, you should be able to follow along!
At the end of this process, you’ll have:
- Your Roborock vacuum controlled as an entity in Home Assistant.
- A script which triggers room cleaning based on the input HA rooms/areas to clean, with a variable set up to map these areas to Roborock map IDs.
- Several automations for each set of room cleanings you want to do. For example, I have one automation per room, plus some to sweep different groups of rooms at once.
- A helper input button for each automation to trigger it via Apple Home, each named with a trigger phrase that Siri will understand like “sweep the kitchen.”
- The robot vacuum itself exposed in HomeKit with a unique name, such that “turn on Robovac” will start cleaning everything or “turn off Robovac” will cancel things.
Connecting Roborock to Home Assistant
Basic setup is very easy, and you can follow the official guide to connect the robot to HA. In summary:
- Add the Roborock integration to HA, and log into your Roborock account when prompted.
- Follow guide in “how to clean a specific room” to see the rooms that Roborock manages in its map. It has a link to a developer action you can use to test sending commands to the vacuum. You can change this action from “Vacuum: Send command” to “Vacuum: Return to dock” to cancel your test clean. When running these commands, click “Choose device,” which should show your newly connected vacuum in the list automatically.
- After this, Home Assistant manages the vacuum, so we just need to automate it!
Room cleaning with a basic script
You can easily create a basic script to run the vacuum:
- Add the action “Vacuum: Send command,” and add your vacuum as the target device.
- Use
app_segment_cleanas the command. For parameters, simply set the numerical ID of the room to clean — obtain this in the guide for getting the roborock map in step 2 above.
Room cleaning Home Assistant areas with a script
This is very limiting, though, as you need to manually add the room ID number and remember it. Instead, we’ll create a mapping of “Home Assistant areas” to “Roborock room IDs.” Then, when using the script, we can use the HA room selector to trigger things smoothly.
- Add a field to the script we created above and name it “rooms”. (Add fields via the 3-dot upper-right menu in the script editor.)
- Set the field’s selector to type “area”, enable multiple selection, and make the field required. When you trigger the script via an automation, you can choose whichever rooms should be cleaned as part of that automation from the list of HA rooms.
- In the send command step (as created in the previous section), set the parameters to this string — multi-line is totally ok here:
{% set room_map = { "bedroom": 1, "living_room": 2 } %}
{% set ns = namespace(roborock_rooms = []) %}
{% for room in rooms %}
{%if room in room_map%}{% set ns.roborock_rooms = ns.roborock_rooms + [room_map[room]] %}{% endif %}
{% endfor %}
{{ns.roborock_rooms}}
- Adjust the room_map in the first line to match your house — keys are the “areas” which would be selected in the first part of the script, and the numerical values are the room IDs in the Roborock map. For example, my “Living Room” in HA has the key “living_room”, and in Roborock, it has the ID 123, so I add “living_room: 123” inside the curly braces of
room_map. (This link has the command to fetch the rooms.) - Test the script by simply executing it from the three dot upper-right menu, and select the room(s) to clean, and the vacuum should start. View the script traces to debug.
- Some notes on templating in HA scripts:
- To debug templates, go to /developer-tools/template in Home Assistant, where you can play around with different syntax and inputs.
- Templates wrapped with
{% ... %}are code and don’t output anything. - Templates with
{{ ... }}directly output that text into the script at that location. - HA uses jinja, which has docs here which can be helpful.
- The syntax checker in the UI of a script is not great, so if you can’t figure out why the script doesn’t work, install something like the VS Code add-on in HA and open
scripts.yaml— this VS Code plugin has a better syntax checker pre-installed for for HA yaml files. - Unfortunately, it can be tricky to work with and (especially) to debug templates. If you’re struggling to find useful info on the web, ChatGPT and similar tools know enough about the templating syntax to be helpful.
Triggering Roborock room cleaning with NFC tags
Alright, now we have a super flexible script we can use for everything else we want to do. Let’s try triggering it with an NFC tag!
- To add an NFC tag to Home Assistant, follow these docs. TLDR: in the HA mobile app, go to “settings > tags > add tag,” scan the NFC tag, and set its name. (You can find NFC tags super cheap online.)
- Create a new automation in HA called “Vacuum the entry” (or whichever room you like!)
- Its trigger should be “when a tag is scanned”, using the tag you just added.
- The “then do” action can just start the script we created to run the vacuum, preconfigured with the right room(s).
- Scan the tag on your phone and the vacuum will magically clean that room.
Triggering Roborock room cleaning with Siri
Alright, now let’s use Siri control it! I’ve found the default Roborock integration in iOS Shortcuts very unreliable, so controlling via HA will be a lot better. Additionally, many smart vacuums (like the s7) don’t show up in HomeKit as a “vacuum” which makes Siri trigger phrases like “vacuum xyz” not work correctly. I think connecting vacuums to smart homes in a standardized way is a relatively new feature not supported by even slightly older robots.
We’ll link to HomeKit by creating a helper button in HA for each automation we want to trigger from HomeKit — in my case, I added a button & corresponding automation for each room. Each automation triggers the script above using that specific room. Some of these automations also include the NFC triggers as above.
- Ensure you have a HomeKit bridge set up.
- Configure the HomeKit Bridge to include “input buttons”. In my case, HomeKit is set up in mode “bridge” and in inclusion mode “exclude”. I selected input buttons in the list of “domains to include”. This means your “fake helper buttons” will now show up in your iOS Home app — but as a switch, not a button. (Also, include vacuums in the list of entities to expose to HK.)
- In HA settings, go to “Devices & services > helpers”. Create a new helper of type button, and name it to match the automation it will trigger. I created one button per room I want to vacuum. Apple is weird, so here are some tips:
- Use a name like “Sweep the Kitchen.” This should very closely match the trigger phrase you want to use for Siri. (Though you can always override the name in HomeKit later to make adjustments.) Unfortunately, using “vacuum” in the trigger phrase doesn’t work, because Siri doesn’t see these helper buttons as real vacuums. But Siri will automatically pick up on names like “sweep x” or “clean this room” once these buttons show up in HA.
- The room setting for the button in HA does not sync to HomeKit, so you only need to set it if you want the button to associate with that room in the Home Assistant dashboard.
- If a new button doesn’t show up in HomeKit, try reloading the HK integration via Home Assistant’s integration page, and restarting the Apple Home app. These input buttons also need to be included in the list of entities HA will expose over the bridge.
- While it’s a button to Home Assistant, Apple sees it as a switch. When you turn it on in Apple, it toggles off after a second or two, and doesn’t reflect the state of the vacuum.
- When managing the switch in HomeKit, don’t put it in a room with lights — otherwise a Siri command like “turn on room” will start vacuuming that room! I made a separate “room” just for automations.
- With your buttons created, go back to your existing automation for NFC. (Or make a new automation.) Add a trigger of type “entity,” chose “state” as the type of trigger, and then one of your new “input buttons” as the entity. The other fields can be left blank. You can duplicate the automation, changing the button name and input room in the new copies.
- In the Apple Home app, switches should show up for all the buttons you created. Move them to a separate fake room and/or rename them to match the Siri trigger phrase you intend to use.
- Also, a switch should show up for the actual vacuum itself. While the automation-related switches will toggle off immediately after starting the vacuum, this switch for the main vacuum itself shows the current vacuuming state. So while vacuuming, it’ll always show as enabled, and you can toggle it off to stop the vacuum and return it to the dock.
If the name of the switch is unique enough, Siri will automatically detect it. So “Siri, sweep the kitchen” will magically start the vacuum in the kitchen, if your helper input button is named “sweep the kitchen,” is synced to HomeKit, and triggers the Home Assistant automation which runs the script using the HA Kitchen area.
Similarly, if the switch for the vacuum itself is unique enough in HomeKit (like “Robovac”), “Siri, turn off Robovac” will stop the current cleaning task and return it to the dock. It can be hard to tell the difference between types of switches in the Home app, but if you go to the accessory settings of a switch, the vacuum-specific switch has a manufacturer of “roborock” and the virtual switches have a manufacture of “input button.”
Summary
Now, you can control your Roborock vacuum via Home Assistant, Home Kit, NFC tags, and Siri. (And the Roborock app!)
Going forward:
- If you change the Roborock map & rooms, you need to update the HA room mapping. Run the dev command to fetch the map, and update the room cleaning script with the new data.
- To add a new automation (like cleaning a specific group of rooms), just create a new helper button for it, and then a new automation which triggers from that button, using the original script and desired rooms. You may need to reload the HomeKit bridge to get the new automation to show up to Siri.
- Remember the quirks with Siri & HomeKit described above. Use unique, non-vacuum names for the switches, and remember that Siri may try to turn on all switches in a room, including the virtual one for a vacuum.