2 Raw miio commands
Sören Beye edited this page 2021-11-24 21:29:17 +01:00

From time to time you might be facing the need to change a setting that isn't implemented in Valetudo (yet). It might be a vendor-specific quirk that doesn't really fit a generic abstraction or there are other reasons.

In any case, there is a solution: Raw miio commands. By using python-miio you can easily send those.

Please do not use this as a general-purpose bypass for Valetudo as concurrent use will cause issues.

You will need the IP of your robot, the DeviceId (did) of your robot and also the current local secret (token) in hex (32 characters). Check the Valetudo log for those. You can use this cyberchef recipe to convert the 16-character local secret to its 32-character equivalent.

Executing them then looks like this:
miiocli device --token xx --ip 192.168.xx.xx raw_command get_properties '[{"did":xxx, "siid":18,"piid":19}]'

with get_properties being the command and [{"did":xxx, "siid":18,"piid":19}]' being its arguments. Not all commands have arguments.

Roborock

Indicator LED toggle

Some roborock robots allow for disabling the button LEDs after the device is fully charged. To check whether or not that is enabled, you can use the get_led_status command without any arguments.

To change this setting, use the set_led_status command with either 0 for off or 1 for on as its argument.

Dreame

Auto-Empty Dock Interval

It is possible to set the auto-empty interval [1 = every cleanup, 2 = every two cleanups, 3 = every three cleanups] on dreames featuring an auto-empty dock.

Note that it is recommended to leave this at 1 and instead customize the interval via e.g. Home Assistant. It is possible to trigger the auto-empty process via both MQTT as well as REST which gives you way more options than this interval setting.

To query the current setting, execute get_properties '[{"did":xxx, "siid":15,"piid":2}]'.
The response will look like this: [{'siid': 15, 'did': 'xxx', 'piid': 2, 'value': 1, 'code': 0}] with value being the current value.

To change the setting, use set_properties '[{"did":xxx, "siid":15,"piid":2, "value":1}]'