Xiaomi Robot Vacuum Binding

Yes, you need the right token. the configuration error / on-offline is indicating a token error.

but… as you indicated it works when you reboot for few hours… that is really strange (normally it works or it doesnt… not work for few hours). I can think of only 2 reasons that that can happen

  1. you have multiple things for the same device
  2. somehow you get the wrong token once in a while from the cloud… the latter may happen if you have defined your vacuum in the past for multiple countries… when you move to the new country server, the settings / token on the old server remains. It might be that while refreshing it picks up the token from the wrong server. (the binding does educated guess on which server your device is, but depending your settings that may go wrong, esp if the device is offline for few minutes)

But how do I get the right token?
I removed my Thing and readded it, but the token seems to be the same.
So 1. should not apply to my case.
I don’t think that I defined it for multiple countries. Maybe by mistake.
How can I check and fix that?

Hi. I added zhimi.heater.mc2 but I can only switch on/off it. I can’t set target temperature and can’t get environment temperature from heater (but I see it in MiHome app)

you can check in the userdata/miio folder. There are json files for each county server. Check if your device is listed in multiple files(countries)

This device was only added rather recent. Your OH version is prob too old. Update to the OH3.1 branch for this device to be inluded.

Hi Marcel, thank you very much for your tremendous work on the miio binding!

Could you suggest if there were any changes to how “auto-refresh after command” works?
I read your message dated “Aug 15th, 2017”, where you commented on new features:

Refresh after sending each command (issue from @elias_gabrielsson)

But this doesn’t work in my case. See the attached logs:
app_zoned_clean was sent at 12:20:37, but no status update until periodic update at 12:21:14.

openhab> bundle:list -s | grep miio
255 │ Active │  80 │ 3.0.1                   │ org.openhab.binding.miio
12:20:37.328 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":86,"method":"app_zoned_clean","params":[[23450,19550,25950,22150,1]]} -> 192.168.0.10 (Device: 13<cut>0B token: 6D<cut>138 Queue: 1).
12:20:37.470 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for vacuum type: START_ZONE, result: ["ok"], fullresponse: {"result":["ok"],"id":86}
12:21:14.097 [DEBUG] [io.internal.handler.MiIoVacuumHandler] - Periodic update for 'miio:vacuum:vacuum’ (miio:vacuum)

Yes, it works for all commands… except for custom commands it seems :confused:
Can you make a github issue for it, than I’ll fix that in the next update

Created a github issue: [miio] Vacuum status is not updated after sending a custom command · Issue #10719 · openhab/openhab-addons · GitHub.
Thank you in advance!

What is the best way to use Google Home to control the vacuum cleaner?
I have created 4 switches to clean the 4 “rooms” on the ground floor. When adding Google Assistent Metadata to the switch, it’s only working when adding 1 switch.
If I add 2 switches (using vacuum in the metadata) i can see 2 vacuum cleaners inside google home, but cannot control it with voice, it doesn’t know which device to use.

How do you use: Hey Google, Clean the kitchen?

i cant find the expert mode from Xiaomi Mi IO - Bindings | openHAB I know this is an openhab 2 image. Is it gone or?

@Mordor if you look at the 3.1.0 latest documentation it has updated screenshots.
You can see how to reach the binding settings (expert mode) in the OH3.x

1 Like

DEars,

sorry I´m new for robot.
Could you tell which version of binding I should use for last stable version of OH2.5.12?

Currently I suing the binding from paperui and I have follow message in my log:
2021-06-28 13:31:47.547 [INFO ] [.miio.internal.robot.RRMapFileParser] - Unknown blocktype (pls report to author)
2021-06-28 13:31:47.551 [INFO ] [.miio.internal.robot.RRMapFileParser] - Unknown blocktype (pls report to author)

I using an Roborock S7.

Thank you.

You are on a pretty old version of the binding. Since than the parsing of the blocks have been improved, hence most likely you won’t have the issue in the current version (e.g. the released OH3.1)

Suggest to ignore the message (you could supress it with set:log warn org.openhab.binding.miio.internal.robot.RRMapFileParser)

The jar files from oh3.0 / 3.1 can’t run in the 2.5 environment, so you either live with it or need to upgrade your Openhab.

Hi Marcel,

thank you for your help. Sorry I have read some bout this binding but have 2 other questions and I need help here:

  • Can I use in my OH2.5.12 version the current version of this binding (3.0/3.1) ?
  • How can I use the “is_locating” channel in my version?

Thank you for your help.

Cheers
Sascha

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 = "";
        }