Xiaomi Robot Vacuum Binding

Hi,

does anybody have an answer to my questions? openHab Roborock S7 mop features - Add-ons / Bindings - openHAB Community

Thanks in advance!

Hi! Some time ago, I updated and got the following warning about twice a minute, the last snapshot is the same:


2021-07-22 12:20:41.284 [WARN ] [internal.handler.MiIoAbstractHandler] - As per openHAB version 3.2 the deviceId is no longer a string with hexadecimals, instead it is a string with the numeric respresentation of the deviceId. If you continue seeing this message, update deviceId in your thing configuration
2021-07-22 12:20:54.942 [WARN ] [internal.handler.MiIoAbstractHandler] - As per openHAB version 3.2 the deviceId is no longer a string with hexadecimals, instead it is a string with the numeric respresentation of the deviceId. If you continue seeing this message, update deviceId in your thing configuration
2021-07-22 12:21:56.323 [WARN ] [internal.handler.MiIoAbstractHandler] - As per openHAB version 3.2 the deviceId is no longer a string with hexadecimals, instead it is a string with the numeric respresentation of the deviceId. If you continue seeing this message, update deviceId in your thing configuration
2021-07-22 12:22:09.979 [WARN ] [internal.handler.MiIoAbstractHandler] - As per openHAB version 3.2 the deviceId is no longer a string with hexadecimals, instead it is a string with the numeric respresentation of the deviceId. If you continue seeing this message, update deviceId in your thing configuration
2021-07-22 12:22:41.358 [WARN ] [internal.handler.MiIoAbstractHandler] - As per openHAB version 3.2 the deviceId is no longer a string with hexadecimals, instead it is a string with the numeric respresentation of the deviceId. If you continue seeing this message, update deviceId in your thing configuration
2021-07-22 12:23:25.023 [WARN ] [internal.handler.MiIoAbstractHandler] - As per openHAB version 3.2 the deviceId is no longer a string with hexadecimals, instead it is a string with the numeric respresentation of the deviceId. If you continue seeing this message, update deviceId in your thing configuration
2021-07-22 12:23:56.399 [WARN ] [internal.handler.MiIoAbstractHandler] - As per openHAB version 3.2 the deviceId is no longer a string with hexadecimals, instead it is a string with the numeric respresentation of the deviceId. If you continue seeing this message, update deviceId in your thing configuration

I don’t understand what and where do I need to fix?

@Olymp are you using the latest snapshot I expect… with text config for the things, right?

In that case in your thing text config you need to update the deviceId field. In situations without text config I would expect OH to do it by itself. If not, probaly just empty the deviceID field in the thing config will trigger the update as well.

See below screenie: So with the new version you need the 55512645 as deviceId whereas in the old version it would have been the 034F0E45

If you don’t see the number anymore you can use e.g. : Hexadecimal to Decimal Converter to convert it or e.g. the windows calulator.

let me know if indeed you had text config and/or if this worked out for you.

Thanks for the feedback, appreciate it!
Yes, I am using text configuration, changed the device ID, rebooted the openHAB, the warnings remain.
image
At the moment, I did it remotely, the robot is not online. Whenever possible, I will plug it into the network and see the result, if this could also be the reason.

@Olymp I made a quick update to improve the message, to help make the change.
Adding to the line: Expected change for thing 'miio:generic:0581B26C': Update current deviceId: '0581B26C' to '92385900'

so it will look like this in the normal situation (when not using text config) :

11:52:31.505 [WARN ] [internal.handler.MiIoAbstractHandler] - As per openHAB version 3.2 the deviceId is no longer a string with hexadecimals, instead it is a string with the numeric respresentation of the deviceId. 
If you continue seeing this message, update deviceId in your thing configuration. 
Expected change for thing 'miio:generic:0581B26C': Update current deviceId: '0581B26C'  to  '92385900'
11:52:31.505 [DEBUG] [internal.handler.MiIoAbstractHandler] - No deviceId defined. Retrieving Mi deviceId
11:52:31.509 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Sending Ping to device '' (192.168.3.108)
11:52:31.509 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Starting Mi IO MessageSenderThread
11:52:31.509 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Opening socket on port: 52850 
11:52:31.514 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Ping to device '' (192.168.100.100) success
11:52:31.514 [DEBUG] [internal.handler.MiIoAbstractHandler] - Ping response from deviceId '92385900' at 192.168.100.100. Time stamp: 1970-06-18T22:58:22, OH time 2021-07-22T11:52:31.514094100, delta -1612353249
11:52:31.514 [DEBUG] [internal.handler.MiIoAbstractHandler] - Using retrieved Mi deviceId: 92385900

it is really strange… the message should only appear when 2 conditions are true: 1) lenght of 8, which is true in your case AND 2) it should contain a character a…z or A…Z. the 2nd condition should not be true in your case. Almost seems your change in the text has not been picked up yet…

        if (deviceId.length() == 8 && deviceId.matches("^.*[a-zA-Z]+.*$")) {
            logger.warn(
                    "As per openHAB version 3.2 the deviceId is no longer a string with hexadecimals, instead it is a string with the numeric respresentation of the deviceId. If you continue seeing this message, update deviceId in your thing configuration. Expected change for thing '{}': Update current deviceId: '{}' to '{}'",
                    getThing().getUID(), deviceId, Utils.fromHEX(deviceId));
            deviceId = "";
        }

Is it possible to hide “Select consumable” on the sitemap (basicui and OH app)?


My fault, I forgot that in addition to the vacuum cleaner, I also have Yeelight lamps. I updated the OpenHAB snapshot and now it gives out to each warning line a message about the device, I have not seen this before. This helped me understand the cause and fix it. Thank you! Now there are no warnings.

1 Like

I just realized that the network channel for ssid:

miio:vacuum:roborock:network#ssid

is having a problem when the SSID contains whitespaces. It just returns the string until the whitespace. Ok, it’s just cosmetics and doesn’t have any impact on the functionality - just wanted to mention it

can you see in the log if it is coming well from the vacuum? I don’t think in the binding I do anything special with the value (no processing etc), just pick it up from the json and put it to the channel

You are right! I just looked in the App and indeed it shows the same issue - so the SSID-String is not delivered correctly from the vaccuum - in both cases it shows only “My” instead of “My Home”:

Receivedresponsefor132AA134type : MIIO_INFO,
result : {
“hw_ver” : “Linux”,
“fw_ver” : “3.5.8_5850”,
“ap” : {
“ssid” : “My”,
“bssid” : “xx:xx:xx:xx:xx:xx”,
“rssi” : -44
},
“netif” : {
“localIp” : “192.168.1.3”,
“mask” : “255.255.255.0”,
“gw” : “192.168.1.1”
},
“miio_ver” : “miio-client 3.5.8”,
“model” : “roborock.vacuum.a10”,
“mac” : “xx:xx:xx:xx:xx:xx”,
“token” : “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”,
“life” : 45498
},
fullresponse : {
“partner_id” : “”,
“id” : 14589,
“code” : 0,
“message” : “ok”,
“result” : {
“hw_ver” : “Linux”,
“fw_ver” : “3.5.8_5850”,
“ap” : {
“ssid” : “My”,
“bssid” : “xx:xx:xx:xx:xx:xx”,
“rssi” : -44
},
“netif” : {
“localIp” : “192.168.1.3”,
“mask” : “255.255.255.0”,
“gw” : “192.168.1.1”
},
“miio_ver” : “miio-client 3.5.8”,
“model” : “roborock.vacuum.a10”,
“mac” : “xx:xx:xx:xx:xx:xx”,
“token” : “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”,
“life” : 45498
}
}

Dears,

could please someone explain please the right command in detail.
I have problems to use them in a rule.

Thanks.

I’m trying to collect the supported features for robots to update the documentation page XiaomiRobotVacuumProtocol/fw_features.md at master · marcelrv/XiaomiRobotVacuumProtocol · GitHub

Would like to ask everyone to share the response for their robot to the get_fw_features command along with the model and firmware version (found in the thing properties)

Border cropping feature has just been merged. By default the maps will be cropped.

Also you can customize all the colors and text or disable the logo/text altogether (for those that had problems with the text rendering or don’t want to have the logo)

Not yet in the readme, but he way to customize this is to create a file with the name mapConfig.json in the userdata/miio… if it sees this file it will read the map rendering preferences from there. If the file is available but invalid it will create a new file with all the default values for you to customize. To (re-)read the file either restart openhab/the binding or alternatively edit the thing and make minor change. Note, cropping is diabled (hence showing like the current maps) for any “cropBorder” < 0

1 Like

thnx mate for all your hard work!Is there a way for the binding to support the new xiaomi air fryer ?

Probably, if you know the model Id.* careli.fryer.maf02": "Mi Smart Air Fryer (3.5L)*
basic control is almost always possible.
Sometimes more complex parts like programming the custom menu might be more tricky ( e.g like for the rice cooker menus) but still that worked out.

These airfryers looks like regular miot device

Let me know the results and what sort of values you see for the receipies as the spec does not show

Oh thnx mate…u r fast :slight_smile: .I dont have a fryer yet ,i am trying to get one but it is not available in Greece yet.Even in Europe is very hard to find (for a normal price).When i finally have one i will test it .Thnx

do i have to dl a new jar or updating my openhab3 throught “sudo openhabian-config” will do?I did an update but nothing changed…Do i have to create manually the mapConfig.json file?

yes, get the latest snapshot and (manually) create the file (empty file is fine, it should not be a valid json file)

I also updated the documentation (pending approval) with a bit more writeup here

### Advanced: Vacuum Map Customization

In case the default rendering of the vacuum map is not meeting your integration needs, the rendering can be tailored.
The way to customize this is to create a file with the name `mapConfig.json` in the `userdata/miio` folder.
If the binding finds this file it will read the map rendering preferences from there.
If the file is available but invalid json, it will create a new file with all the default values for you to customize.
This allows you to control the colors, if logo is displayed, if and what text is rendered etc.
To (re-)read the file either restart openHAB, restart the binding or alternatively edit the thing and make (any) minor change.
Note, cropping is disabled (hence showing like the maps in OH3.1 and earlier) for any `cropBorder` value < 0.
Note, not all the values need to be in the json file, e.g. a subset of the parameters also works, the parameters not in the `mapConfig.json` will take the default values.