Support for (Xiaomi) Dream F9 Mop Vacuum

All good, I made a mistake rewriting the token in my configuration.yaml.
Many thanks for the help !!!

Guys is this dreame f9 a clone of the xiaomi mi essential? Any difference?

Also, does it support no-go zones? I really need that feature? I read it still experimental with the xiaomi mi essential

Ok, ordered an Dreame F9…

What component do I need to load as custom to make it work?

Thnx

You can add my repo to hacs.

All credit goes to the comments above however I added zone support to it.

1 Like

Yeah, using that one, I was discussing it with you on github :wink:

Guys, I am so happy - thank you!

I have now registered here specifically to help other beginners, like me.

  1. How to get Xiaomi Token: Xiaomi-cloud-tokens-extractor

I’m new to Homeassistant so:

  1. Install HACS
    Version 1.9.0 released 9 hours ago
    The manual installation doesn’t work’s for me.

  2. Install xiaomi_vacuum via HACS
    also the manual installation doesn’t work for me.

  3. Install vacuum-card via HACS

  4. find dreamevacuum.py under “/custom_components/xiaomi_vacuum/miio/” and replace it with the file here.

  5. Add following code (see Step 1) to the configfile configuration.yaml:

#Dreame F9 Vaccum Robot
vacuum:
  - platform: xiaomi_vacuum #no need to change this
    host: <IP>
    token: "<Token>"
    name: <Name>
  1. Restart Homeassistant
    Configuration > General > Server Management > Restart

  2. Add the Vaccuum Card
    Home Assistant Overview page, click the three dots at the top right of the screen and select ‘Edit Dashboard’. Then click the blue ‘+ Add Card’ and scroll down to “custom: Vaccum Card”

  3. Be very happy!

image

5 Likes

Hi @chris6

can we also do zone cleaning. or even better room cleaning? is that possible with your custom for dreame f9 ?

1 Like

Hi everyone,

First of all, thank you very much for your work. I manage to fully add my Drame f9 to HA. However, I tried to use the service vacuum.send_command to tell the robot to go to spot. But it didn’t work for me. Did you guys manage to have it work?

Thank’s for the reply.

Hey,

I didn’t look into extending the send_command service. I did spend sometime looking to support spot cleaning but the miot spec didn’t suggest it and I haven’t seen the option in the Xiaomi app to sniff the commands.

Potentially we could find a way to simulate with a small zone based around the spot coords.

I have an error in the integration after these steps. Any idea on it? Thanks!
xiaomi_vacuum: Error on device update!

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 407, in _async_add_entity
await entity.async_device_update(warning=False)
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 516, in async_device_update
await task
File “/usr/local/lib/python3.8/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/xiaomi_vacuum/vacuum.py”, line 405, in update
self._current_water_level = state.water_level
AttributeError: ‘DreameStatus’ object has no attribute ‘water_level’

Unfortunatly, it seems that @Hyyd1e 's tips is no longer working : the dreamevacuum.py he gave is out of date, but even if you take all the folder on github, it doesnt work for dreame D9.
GitHub - Concentricc/xiaomi_vacuum (by the way there is another bug on the master repo, ou just have to add a version in manifest.json, but still doesn’t work for D9)

So there is no known way to integrate D9 into HA?

Have you tried my repo for the F9/D9?

hello @chris6 , thanks for you work
I tried with the D9, I have the card, but it doesnt work well : battery level is wrong, I can’t have the specs like Main brush time leff , Main brush life level or others.
I was able to start the robot 1 time :I pressed a random button then it starts moving, but i wasnt able to make it go to base or anything else.
And on the card, the robot is always in cleaning mode event if the robot is charging.

Just received my Dreame D9 and followed the steps mentionned by Hyyd1e. Everything seems to work well from the card and the details pop-up information are correct.
I will now move to the next step and try to get the map into HA and play with custom voices :slight_smile:
Thank you all for the hard work

I have an F9. I followed @Hyyd1e 's manual (great one!), but I got an error similar to @adumnov (AttributeError: ‘DreameStatus’ object has no attribute ‘water_level’). I tried the dummy approach and I just added everything related to ‘water_level’ that was there in the original dreamevacuum.py to the modified dreamevacuum.py. Now it seems to be working (at least on a basic level). Sorry - I’m not a developer and I don’t know how to share the updated file or share code updates properly. I will just paste the changes below. Maybe someone will do it properly?

Change #1
After this…

class VacuumSpeed(Enum):
    """Fan speeds, same as for ViomiVacuum."""

    Silent = 0
    Standard = 1
    Medium = 2
    Turbo = 3

…add this:

class WaterLevel(Enum):
    Low = 1
    Medium = 2
    High = 3

Change #2
After this…

    # siid 8: (): 3 props, 1 actions
    # piid: 1 (): (string, unit: None) (acc: ['read', 'notify'], value-list: [], value-range: None)
    timezone: str = field(
        metadata={"siid": 8, "piid": 1, "access": ["read", "notify"]},
        default=None
    )

…add this:

    # piid: 20 (): 
    water_level: int = field(
        metadata={
            "siid": 18,
            "piid": 20,
            "access": ["read", "write", "notify"],
            "enum": WaterLevel,
        },
        default=None
    )

Change #3:
After this…

    # aiid 2 : in: [] -> out: []
    @command()
    def test_sound(self) -> None:
        """aiid 3 : in: [] -> out: []"""
        return self.call_action(7, 2)

…add this:

@command(click.argument("water", type=int))
    def set_water_level(self, water):
        """Set water level"""
        return self.set_property(water_level=water)

Thank you all for the great explanations in this topic.
Following the steps listed here I was able to integrate my new F9 into Home Assistant and make its state visible with the vacuum-card.

Next I would like to command the F9 to start the cleanup of one of my detected rooms. Those are labled A, B, C, D and E in the Xiaomi-App. I also found the service “xiaomi_vacuum.vacuum_clean_room” in Home Assistant and hoped it would be easy to use it. Unfortunatley, I was not able to find any documentation for the service. Trying to make out the needed parameters brought me to

entity_id: vacuum.karl_heinz
repeats: 1
zone: "A"

Using those parameters does not raise any errors in Home Assistant Web UI and also no exceptions on the console. Unfortunately, nothing happens =(

I also tried other variations of the zone parameter, like “[A]” or “[‘A’]”. I even tried numers like “[1]” because it was adviced in other threads. But still the vacuum does nothing.

Has anyone managed to get the room cleanup working through home assistant?
Thanks in advance

No, that’s not how it works, you need to install the modified .apk for the xiaomi app, that will create a log file… In that file you can find the rooms … it’s not that easy as a , b …

The apk is in another thread , can’t find it right now

Edit: Xiaomi Mijia 1C Sweeping Vacuum Cleaner (white) (STYTJ01ZHM) - #55 by altagraft

Okay, cool, thank you.
I will try my luck with that approach.

I noticed today a new firmware for dreame f9, anyone knows the rls notes?