Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Xiaomi Mijia Sweeping And Mopping Robot M30S D103CN #655

Open
APotapoff opened this issue Aug 3, 2024 · 22 comments
Open

Support for Xiaomi Mijia Sweeping And Mopping Robot M30S D103CN #655

APotapoff opened this issue Aug 3, 2024 · 22 comments
Assignees
Labels
enhancement New feature or request

Comments

@APotapoff
Copy link

Can you add support for Xiaomi Mijia Sweeping And Mopping Robot M30S D103CN?
I checked miot-spec and it looks a bit like xiaomi.vacuum.c102cn.

After that, I downloaded this integration (
v2.0.0.0b15), then added my device to custom_components/dreame_vacuum/config_flow.py. I also replaced protocol.py with https://raw.githubusercontent.com/Tasshack/dreame-vacuum/dev/custom_components/dreame_vacuum/dreame/protocol.py

Almost everything works except for a few things, most importantly Current Map and Current Room. But I can control room cleaning via Saved Map and I even generate rooms config using Vacuum Map to control cleaning by room. I also see the correct room names in the states.

List of all unavailable properties:

  • Clear Warning
  • Cruising History
  • Current Map
  • Current Map Data
  • Current Room
  • Floor Material Room Unavailable
  • Map Rotation
  • Mapping Time
  • Mop Pad Humidity Room Unavailable
  • Off-Peak Charging End
  • Off-Peak Charging Start
  • Order Room Unavailable
  • Room Name
  • Selected Map
  • Self-Clean
  • Suction Level Room Unavailable

Checked the logs and found the error:

"Map data decryption failed: Invalid IV size (0) for CBC.... Private key might be missing, please report this issue with your device model"

image
image

Additional Information

  • Model Name - xiaomi.vacuum.d103cn
  • Firmware Version - 4.3.9_1205
  • Home Assistant Version: 2024.06.2
  • Configuration Type - With map support + cloud connection
  • Errors or warnings shown in the HA logs (if applicable):

"Map data decryption failed: Invalid IV size (0) for CBC.... Private key might be missing, please report this issue with your device model"

@APotapoff APotapoff added the enhancement New feature or request label Aug 3, 2024
@Tasshack Tasshack self-assigned this Aug 3, 2024
@Tasshack
Copy link
Owner

Tasshack commented Aug 3, 2024

Looks like I can add support for xiaomi.vacuum.d103cn.

@Tasshack
Copy link
Owner

Tasshack commented Aug 3, 2024

Integration does not have private key for this model therefore cannot decrypt the current map.
Unavailable entities are related to the Map data decryption failed error but you can see saved map entity because it is not encrypted.

@APotapoff
Copy link
Author

Thank you. Having looked at the previous issues, that's what I thought. Otherwise, even without the current map it is already possible to fully utilize the integration and use the automations.

@Tasshack
Copy link
Owner

Tasshack commented Aug 3, 2024

I think M30 D102 and M30Pro C107 are also Dreame devices.

@Tasshack
Copy link
Owner

Tasshack commented Aug 3, 2024

Thank you. Having looked at the previous issues, that's what I thought. Otherwise, even without the current map it is already possible to fully utilize the integration and use the automations.

I don't recomment for you to use the integration at this state since it will continuously try to get the initial map data at the background.

@Tasshack
Copy link
Owner

Tasshack commented Aug 3, 2024

@APotapoff Can you try replacing this file with /custom_components/dreame_vacuum/dreame/const.py?

const.zip

@APotapoff
Copy link
Author

The card's working.

image

There are still a few inaccessible propetries left, but they have more to do with the settings of the device itself. Funnily enough, I had previously seen an AI recognition setting that is not announced in this model and enabled it. It's not there now, but there is something similar to curtains on the map. Thank you very much.

List of unavailable properties(if it could be useful):

  • Auto-Add Detergent
  • Base Station Self Repair
  • Carpet Boost
  • Cleaning Mode Room
  • Cleaning Progress
  • Cleaning Times
  • Clear Warning
  • Cruising History
  • Floor Material
  • Mapping Time
  • Mop Pad Humidity
  • Off-Peak Charging End
  • Off-Peak Charging Start
  • Reset Detergent
  • Saved Wifi Map 1
  • Self-Clean
  • Suction Level

@Tasshack
Copy link
Owner

Tasshack commented Aug 3, 2024

I need access to the device for fully supporting all of the device properties and related features because currently I cannot access the app plugin source code and even tough I can access, it will be minified unlike the Dreamehome app plugins and minifying makes it almost impossible to reverse engineer just by looking at the code and without access to a real device.

@Tasshack
Copy link
Owner

Tasshack commented Aug 3, 2024

Auto-Add Detergent = Not Sure why it is unavailable
Base Station Self Repair = Not Sure why it is unavailable
Carpet Boost = Not Sure why it is unavailable
Cleaning Mode Room = Not Sure why it is unavailable
Cleaning Progress = Only available when cleaning
Cleaning Times = Not Sure why it is unavailable
Clear Warning = Only available when there is a warning
Cruising History = Only available after at least one cruising
Floor Material = Needs to be set from integration
Mapping Time = Only available when mapping
Mop Pad Humidity = Not Sure why it is unavailable
Off-Peak Charging End = Only available off peak charging is enabled
Off-Peak Charging Start = Only available off peak charging is enabled
Reset Detergent = Only available when there is a detergent
Saved Wifi Map 1 = Needs to be enabled manually from HA
Self-Clean = Not Sure why it is unavailable
Suction Level = Not Sure why it is unavailable

@APotapoff
Copy link
Author

Share the vacuum, to acc 1724225515.
Name - Vaccuum M30

@APotapoff
Copy link
Author

Checked customization room properties. They are only available when the Customized Cleaning option is enabled.
I was just unloading in bulk and the room names in the parameters got wiped out. That is, when the Customized Cleaning parameter is enabled, the general parameter (e.g. Cleaning Mode) becomes unavailable, but the parameters for each room become available.

@Tasshack
Copy link
Owner

Tasshack commented Aug 3, 2024

Got it thanks. It looks very similar to the 102CN one but more advanced features are available with this one.
I will add full support to the integration for this device on the next Beta release in a couple of weeks.
I won't be using the device for cleaning but maybe toogle a few settings at this period.

Thanks again for your help.

@Tasshack
Copy link
Owner

Tasshack commented Aug 3, 2024

Checked customization room properties. They are only available when the Customized Cleaning option is enabled. I was just unloading in bulk and the room names in the parameters got wiped out. That is, when the Customized Cleaning parameter is enabled, the general parameter (e.g. Cleaning Mode) becomes unavailable, but the parameters for each room become available.

This is normal behaviour of the integration since device ignores global settings (suction_level, cleaning_mode) when customized cleaning is enabled.

@APotapoff
Copy link
Author

Enjoy. Whenever convenient.
Thank you for your help.

@Tasshack
Copy link
Owner

Tasshack commented Aug 3, 2024

It is also interesting that this device has Off-Peak charging feature like L20/X30/X40 but not C102CN or C102GL.

@Tasshack
Copy link
Owner

Tasshack commented Aug 3, 2024

I really don't want to include missing features from the app to not to mess with the Dreame officials because these devices supposed to be the cheaper versions of the flagship Dreame branded ones with less features but if they don't want me to do that then they should have been removed those settings from the firmware too and not just the app.

For instance; they have removed no mopping zones from the app of C102 for no reason other than marketting.

@Tasshack
Copy link
Owner

Tasshack commented Aug 9, 2024

Full support has been added to the latest Beta release.
https://github.com/Tasshack/dreame-vacuum/releases/tag/v2.0.0b16

I had to change some entity availabilities according to the differences in app between Dreame variant of the device.
I suggest removing the device from your HA and add it again for refreshing the auto generated entities.

Thanks @APotapoff for the access.

@Tasshack Tasshack closed this as completed Aug 9, 2024
@Tasshack Tasshack reopened this Aug 10, 2024
@Tasshack
Copy link
Owner

I see that I forgot to add the custom wetness level capability to this device but I will on the next Beta release.

@MrKuskov
Copy link

MrKuskov commented Nov 6, 2024

@Tasshack There are also no settings for cleaning zones, only for rooms. In the application, when you select zone cleaning, you can select the standard settings for the cleaning mode.

@nmwael
Copy link

nmwael commented Nov 6, 2024

It also seems camera obstacle identification/carpet sensor and mop swing are having issues.. mop swing issue on my device could be hardware failure.

@MrKuskov
Copy link

MrKuskov commented Nov 6, 2024

@nmwael There is no carpet sensor in this vacuum cleaner model. The position of the carpet is indicated manually.

@nmwael
Copy link

nmwael commented Nov 6, 2024

ahh so its not covered by the obstacle identification? makes sense since theyve made the special carpet area in the app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants