openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.56k forks source link

[miio] Add support for adjustable water output (THING_TYPE_VACUUM) #6628

Closed Markkuuss closed 3 years ago

Markkuuss commented 4 years ago

I have the new Roborock Vacuum S5 Max (s5e) which has an adjustable water output.

Analogous to the "fan power mode" the "water box mode" should be supported.

This means that in addition to fan_power the status channel should also contain water_box_mode: https://github.com/openhab/openhab2-addons/blob/50d850428573c3230c3835131868a5ad209e91bb/bundles/org.openhab.binding.miio/src/main/resources/ESH-INF/thing/vacuumThing.xml#L44 https://github.com/openhab/openhab2-addons/blob/50d850428573c3230c3835131868a5ad209e91bb/bundles/org.openhab.binding.miio/src/main/resources/ESH-INF/thing/vacuumThing.xml#L114-L118

The actions channel should also have the option water besides fan: https://github.com/openhab/openhab2-addons/blob/50d850428573c3230c3835131868a5ad209e91bb/bundles/org.openhab.binding.miio/src/main/resources/ESH-INF/thing/vacuumThing.xml#L32 https://github.com/openhab/openhab2-addons/blob/50d850428573c3230c3835131868a5ad209e91bb/bundles/org.openhab.binding.miio/src/main/resources/ESH-INF/thing/vacuumThing.xml#L196-L215

water_box_mode can take the following values: 200 - Off 201 - Low 202 - Medium 203 - High 204 - Customize (Auto)

The customize switch is only switched on if both fan_power and water_box_mode are set to the corresponding values (fan=106 & water=204).

Fan Mode

Here only for information the response of the "get_status" command:

{
    "result": [{
            "msg_ver": 2,
            "msg_seq": 1433,
            "state": 2,
            "battery": 93,
            "clean_time": 40,
            "clean_area": 1127500,
            "error_code": 0,
            "map_present": 1,
            "in_cleaning": 1,
            "in_returning": 0,
            "in_fresh_state": 0,
            "lab_status": 1,
            "water_box_status": 0,
            "fan_power": 101,
            "dnd_enabled": 0,
            "map_status": 3,
            "is_locating": 0,
            "lock_status": 0,
            "water_box_mode": 200,
            "water_box_carriage_status": 0,
            "mop_forbidden_enable": 0
        }
    ],
    "id": 334
}
Markkuuss commented 4 years ago

The command would be this:

set_water_box_custom_mode
set_water_box_custom_mode[200-204]

It is similar to the command for setting the fan_power:

get_custom_mode
set_custom_mode[101-106]