Xiaomi Robot Vacuum Binding

ok i found the yeelight spec pdf and i read:

Method: set_power
Usage: This method is used to switch on or off the smart LED (software
managed on/off).
Parameters: 3.
 "power" can only be "on" or "off". "on" means turn on the smart LED,
"off" means turn off the smart LED.
 "effect": Refer to "set_ct_abx" method.
"duration": Refer to "set_ct_abx" method.
"mode" (optional):
 0: Normal turn on operation (default value)
 1: Turn on and switch to CT mode.
 2: Turn on and switch to RGB mode.
 3: Turn on and switch to HSV mode.
 4: Turn on and switch to color flow mode.
 5: Turn on and switch to Night light mode. (Ceiling light only).
Request Example: {"id":1,"method":"set_power","params":["on", "smooth", 500]}
Response Example: {"id":1, "result":["ok"]}

so i give to execute command channel {“id”:1,“method”:“set_power”,“params”:[“on”, “smooth”, 500]} but nothing happens ,what am i doing wrong here?

Read 4 posts up

Hello @marcel_verpaalen,

thank you very much for the great binding. I use it with several products and it works very reliably.

I have now bought a Qingping Air Monitor Lite (cgllc.airm.cgdn1) and would like to integrate it. This is not yet supported by the binding if I see it correctly. It also seems to work differently than cgllc.airmonitor.b1 or cgllc.airmonitor.s1, because it did not work to overwrite the model in the paper UI with cgllc.airmonitor.s1 or cgllc.airmonitor.b1.

Now I tried creating a cgllc.airm.cgdn1.json in the openhab configuration under ./misc/miio. I can see the file is used, because openhab creates the channels accordingly. Unfortunately no values arrive in the channels…

With a bit of googling I found that python-miio (GitHub - rytilahti/python-miio: Python library & console tool for controlling Xiaomi smart appliances) already supports the Qingping Air Monitor Lite (cgllc.airm.cgdn1). Here are the corresponding commits Add Qingping Air Monitor Lite support (cgllc.airm.cgdn1) (#900) · rytilahti/python-miio@78f8bee · GitHub

The Miot specs: https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:air-monitor:0000A008:cgllc-cgdn1:1

Can you give me a hint how to proceed here to customize the database file in the Openhab binding?

Here is my current cgllc.airm.cgdn1.json:

{
"deviceMapping": {
	"id": [
		"cgllc.airm.cgdn1"
	],
	"propertyMethod": "get_value",
	"maxProperties": 6,
	"channels": [{
			"property": "battery",
			"friendlyName": "Battery",
			"channel": "battery",
			"channelType": "system:battery-level",
			"type": "Number",
			"refresh": true,
			"ChannelGroup": "Status",
			"actions": []
		},
		{
			"property": "pm2.5",
			"friendlyName": "PM2.5",
			"channel": "pm25",
			"channelType": "pm25",
			"type": "Number",
			"refresh": true,
			"ChannelGroup": "Status",
			"actions": []
		},
		{
			"property": "pm10",
			"friendlyName": "PM210",
			"channel": "pm10",
			"channelType": "pm10",
			"type": "Number",
			"refresh": true,
			"ChannelGroup": "Status",
			"actions": []
		},
		{
			"property": "carbonDioxide",
			"friendlyName": "CO2e",
			"channel": "co2",
			"channelType": "co2",
			"type": "Number",
			"refresh": true,
			"ChannelGroup": "Status",
			"actions": []
		},
		{
			"property": "humidity",
			"friendlyName": "Humidity",
			"channel": "humidity",
			"channelType": "humidity",
			"type": "Number",
			"refresh": true,
			"ChannelGroup": "Status",
			"actions": []
		},
		{
			"property": "temperature",
			"friendlyName": "Temperature",
			"channel": "temperature",
			"channelType": "temperatureC",
			"type": "Number:Temperature",
			"unit": "CELCIUS",
			"refresh": true,
			"ChannelGroup": "Status",
			"actions": [],
			"category": "temperature",
			"tags": [
				"Measurement",
				"Temperature"
			]
		}
	]
}

}

Thank you very much.

kind regards Jörg

got it ,thnx

so i use at paperui :

set_scene["cf",0,0,"20000,1,255,5,20000,1,5292678,5,20000,1,11673869,5,20000,1,16776960,5,20000,1,7733248,5"]

and i get a nice color flow at my lamp.But when i try to use the same command in a rule

YeelightColorBulb2_Actions_ExecuteCommand.sendCommand("set_scene["cf",0,0,"20000,1,255,5,20000,1,5292678,5,20000,1,11673869,5,20000,1,16776960,5,20000,1,7733248,5"]")

i get a rule error like

2021-02-14 17:59:46.126 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'livingroom_switch.rules' has errors, therefore ignoring it: [10,68]: missing ')' at 'cf'

[10,82]: mismatched input ',' expecting 'end'

what am i doing wrong?
edit: nevermind got it,i must use a \ before every "

Hi Joerg,
Your device is a miot device, indeed is bit more cryptic in adding support.

Can you make a GitHub issue, ill add your device coming week

You can do it in a rule by using single quote at the outer quotes
YeelightColorBulb2_Actions_ExecuteCommand.sendCommand('set_scene["cf",0,0,"20000,1,255,5,20000,1,5292678,5,20000,1,11673869,5,20000,1,16776960,5,20000,1,7733248,5"]')

Hi Marcel,

thank you. I created Issue #10152. [miio] Please support Qingping Air Monitor Lite (cgllc.airm.cgdn1) · Issue #10152 · openhab/openhab-addons · GitHub

It was the first issue I created. Please excuse if something is not expected.

Kind regards.

Sorry for the delayed answer, but you solved my problem :slight_smile:

A big thanks!!!

1 Like

Own now a Xiaomi Vaccum 1C. Using OH3.1M. My vaccum will be found in two versions. Generic and Basic. I must activate cloud and i get all channels. I dont have a clue which one is the well one.
Some buttons are missing. I get at vaccum action without buttons:
grafik
How can i activate this buttons? And which are the right commands?

Thanx.

Is there an easier way to get the token yet?
The old fashioned way to extract the mihome app, backup - SQLite etc. is working fine but is always a bit laborious…
And can someone recommend some power switches (EU - 230V)?
Thanks in advantage!

2 Likes

For my 3 devices (2 purifiers and 1 vacuum) the binding automatically got the token. Otherwise there is the extractor posted before.

Enter your cloud userId/password in the binding details and your devices will be discovered with token.
The PiotrMachowski/Xiaomi-cloud-tokens-extractor is actually based on the openHAB code (obviously re-written in python)

1 Like

You can select both, the result is the same. In future revisions of the binding only the generic will remain.

Is this your model dreame.vacuum.mc1808 Mi Robot Vacuum Mop 1C STYTJ01ZHM?
Don’t know why they are not appearing for you (maybe you have early 3.1 version?).
The right values should be :

"options": [
					{
						"value": "vacuum",
						"label": "Vacuum"
					},
					{
						"value": "stop",
						"label": "Stop"
					},
					{
						"value": "sweep",
						"label": "Sweep"
					},
					{
						"value": "stopsweep",
						"label": "Stop Sweep"
					},
					{
						"value": "dock",
						"label": "Goto Dock"
					}

Hello Marcel,

thanks for your reply. Yes its exactly this kind of device. As my post before at the moment i use 3.1.0 Milestone 1.
It’s not clear for me where to add this options.
Otherwise i’m missing the options to control how wet the robot clean floor. Via App i can choose three different levels: low, medium, high. But i can’t find an item for this. Via documentation there is also no option.
Thanks for your support. This are small issues, i’m very happy with binding itself.

If they don’t show up automatically, I think you can add these kind of mappings as openHAB value maps… you can see the examples in section for your device in the readme Xiaomi Mi IO - Bindings | openHAB

In the (published) channels the mode channel comes most close as it has [“0”=“quiet”,“1”=“standard”,“2”=“medium”,“3”=“strong”] I don’t see anything similar

That is not what i mean. I can swipe with water and can set low wet or heavy wet. That is what i missing. What you mean is strange of suction from vacuum cleaner. At my picture you can see that this work out of the box. Maybe clean-workmode?

In the meanwhile i created a sitemap with selection and this works very well.

Can you try to add this file locally (see readme on how to add local database files)
I think this will have working water channel
dreame.vacuum.mc1808-miot.json (15.7 KB)

My path maybe other openhabian has this path here:
grafik
I hope that is right. The documentation is not totally clear for me sorry. Debug log is a log what i don’t know. I know only openhab.log. I get a new device after reboot i thing.


But i don’t get any channel. I switch over to cloud in thing settings. But i have only hidden channels: