merdok / homebridge-miot Goto Github PK
View Code? Open in Web Editor NEWHomebridge plugin for devices supporting the Xiaomi miot protocol
License: MIT License
Homebridge plugin for devices supporting the Xiaomi miot protocol
License: MIT License
Can you add the full support for Mi Smart Power Plug 2 (Model: chuangmi.plug.212a01 ) ?
My plug works well but there are some minor issues:
a. On HomeBridge it says "Device not supported! Using a generic device with limited properties! Consider requesting device support!"
b. It appears on Apple Home as a "Switch" rather than an "Outlet", the product type needs to be corrected.
Device information:
Name(s) of the device: Mi Smart Power Plug 2 (Wi-Fi and Bluetooth Gateway)
Link: https://www.mi.com/buy/detail?product_id=12777
Model: chuangmi.plug.212a01
Thanks!
Charles
I'm currently using this, for the lack of a better example. Can you help me format the micloud?
{
"platform": "miot",
"devices": [
{
"name": "Air Purifier",
"deviceId": "ID",
"ip": "ip",
"token": "token",
"fanLevelControl": true,
"modeControl": true,
"micloud": [
{
"username": "email",
"password": "pass",
"country": "de"
}
]
}
]
}
Sadly the new Purifier 3C isn't supported yet. Even worse: My Bridge completely shuts down, if I try to activate the Plugin with my Device.
I hope this can be fixed soon.
I have lumi.aircondition.acn05 and cuco.plug.cp2, can add support for these devices?
Thanks you so much!
Hello,
the Smartmi Air Purifier (zhimi.airpurifier.za1) is listed as a supported device, but I can't get it to work properly.
To determine its token, I reset the purifier's WiFi and read the token with miio discover
.
Then I connected the purifier to my network via the Mi-Home app on my phone.
Then I installed homebridge-miio
on my raspberry pi (which already had homebridge installed and working well with other devices ) and configured it accordingly. The configuration looks like this:
{
"bridge": {
"name": "homebridge 0322",
}, "username": "xx:xx:xx:xx:xx",
"port": xxxxx,
}, "pin": "xxx-xx-xxx"
},
}, "platforms": [
{
}, "devices": [
{
}, "name": "smartmi air purifier",
}, "ip": "192.168.10.62",
}, "token": "xxxxxxxxxxxxxxxxxxxxxxxx",
}, "model": "zhimi.airpurifier.za1",
}, "pollingInterval": 5,
"buzzerControl": true,
"childLockControl": true,
"ledControl": true,
"horizontalSwingControl": false,
"verticalSwingControl": false,
"horizontalMoveControl": false,
"verticalMoveControl": false,
"fanLevelControl": true,
"ioniserControl": false,
"shutdownTimer": false,
"heatLevelControl": false,
"screenControl": true,
"dryModeControl": true,
"modeControl": false,
"lightModeControl": false,
"lightShutdownTimer": false,
"motorControl": true,
"motorReverseControl": false,
"heaterControl": true
}
],
}, "platform": "miot"
}
]
}
Is there anything wrong with the procedure or are there any settings I should change?
Thanks in advance
Firstly, Thank you for making this homebridge plugin to let xiaomi product connect to Apple HomeKit
Is possible to add support for a light accessory, the model is leshi.light.wy0b01, I want to control the brightness and the color temperature.
Thank you very much.
I'm constantly getting "[5/26/2021, 9:05:45 PM] [homebridge-miot] This plugin generated a warning from the characteristic 'Rotation Speed': characteristic was supplied illegal value: number -254 exceeded minimum of 0. See https://git.io/JtMGR for more info."
I connected the Xiaomi humdifier 3c to homebridge-miot. In the HomeKit App the Fan Level isn't shown correctly. It always says the Speed is 0, but i can pull up the bar to set it to a level.
Start:
While I press:
After release:
Hello,
Would it be possible to add support for the Mi Smart Microwave Oven?
Model: chunmi.microwave.n20l01
SKU: MWBLXE1ACM
Link: https://www.mi.com/buy/detail?product_id=10330
When setup in the plugin, it seems to connect successfully and is seen as a switch, but there are no additional controls. Toggling the switch also does nothing, and it does not reflect the current state of the microwave.
I understand this isn't the usual type of device controlled by HomeKit, so I don't expect support for every feature, but being able to at least start or stop it would be nice.
If there is anything I can provide (logs, testing, etc.), I would be happy to help the best I can.
With the new Update (0.7.1) the fanspeed control is broken. Or rather the value of the fanspeed. The max fanspeed value was 100% before the update. Now it is 2200%. So its pretty annoying to control via siri.
Thanks!
Hello,
Would it be possible to add support for the Mi Air Conditioner Companion MCN?
Model: lumi.acpartner.mcn02
SKU: KTBL03LM
Link: https://www.mi.com/buy/detail?product_id=9726
When setup in the plugin, it seems to connect successfully and is seen as a switch, but there are no additional controls.
I see that python-miio has his support, you can refer to python-miio#809.
If there is anything I can provide (logs, testing, etc.), I would be happy to help the best I can.
Hi marcin,
thanks again for the help in adding my devices to the plugin.
This is the data of the curtain
hoobs@hoobs:~ $ miio protocol call 192.168.100.81 get_properties '[{"did":"244127254","siid": 2,"piid":4}]'
INFO Attempting to call get_properties on 192.168.100.81
INFO Device found, making call
INFO Got result:
[
{
"did": "244127254",
"siid": 2,
"piid": 4,
"code": 0,
"value": 1
}
]
oobs@hoobs:~ $ miio protocol call 192.168.100.81 get_properties '[{"did":"244127254","siid": 1,"piid":1}]'
INFO Attempting to call get_properties on 192.168.100.81
INFO Device found, making call
INFO Got result:
[
{
"did": "244127254",
"siid": 1,
"piid": 1,
"code": -4004
}
]
hoobs@hoobs:~ $ miio protocol call 192.168.100.81 get_properties '[{"did":"244127254","siid": 2,"piid":8}]'
INFO Attempting to call get_properties on 192.168.100.81
INFO Device found, making call
INFO Got result:
[
{
"did": "244127254",
"siid": 2,
"piid": 8,
"code": 0,
"value": false
}
]
hoobs@hoobs:~ $ miio protocol call 192.168.100.81 get_properties '[{"did":"244127254","siid": 2,"piid":6}]'
INFO Attempting to call get_properties on 192.168.100.81
INFO Device found, making call
INFO Got result:
[
{
"did": "244127254",
"siid": 2,
"piid": 6,
"code": 0,
"value": 0
}
]
hoobs@hoobs:~ $ miio inspect 192.168.100.81
INFO Attempting to inspect 192.168.100.81
Device ID: 244127254
Model info: dooya.curtain.m2
Address: 192.168.100.81
Token: dc28025c65b38b95d5c0492a79fc86b9 via stored token
Support: At least generic
Type info: miio
Capabilities:
Firmware version: 2.1.3
Hardware version: esp8266
MCU firmware version: 0009
WiFi: merv_S1 (E0:63:DA:EA:A1:09) RSSI: -64
WiFi firmware version: 8903c22
Remote access (Mi Home App): Maybe
Hey!
I really like your plugin. Im using it with a Airpurifier 3c. Unfortunately the LED-Control isnt working. Is there a way to fi this?
Keep up the good work!
I would like to request a support for Xiaomi Air Purifier S2 aka zhimi.airpurifier.ma2.
Type info: miio:air-purifier, sensor, miio, air-purifier
Capabilities: miio:buzzer, miio:led-brightness, miio:switchable-led, pm2.5, relative-humidity, temperature, switchable-mode, mode, switchable-power, restorable-state, power, state
Please let me know what other information I could provide to integrate the device.
Thank you.
My home have some xiaomi devices, they use zigbee and bluetooth protocol , such as isa.magnet.dw2hl, lumi.plug.v1 ....etc.
they are connected to the lumi.gateway.mgl03 Gateway, is it possible to support in the future?
First of all, a deep thank you for making this plugin. Great effort!
Could you please add support for smart plug device types? The model I am working with right now is Gosund Smart Plug (cuco.plug.cp1); this should be supported by the MIoT protocol as per link.
In fact, I have already tried to add this device to homebridge. The device discovery is fine. The state polling is fine as well. I tried to turn it on, however, that didn't work. Interestingly, I can turn it off though once being turned on manually.
Happy to provide any necessary info on my end. I'm relatively comfortable with programming (mostly python). New to homebridge though.
Your time is much appreciated. Cheers!
Hi will it be possible to add support for Fan Mi Smart Fan 1X (dmaker.fan.p5).
Currently its is not supported and the configuration is not saved.
Hi,
I have xiaomi ceiling fans and opple ceiling fans at home. I am wondering if you'd be able to add support to these two devices mainly below. Both devices are miot devices added to xiaomi home app. Currently there is no way to add them to homebridge. Please let me know if you need more info on the devices listed below or if you need me to extract data for them
. Thanks
p.s. I have also tried adding these with its tokens to miot plugin. But i cannot seem to get it to work. I can see the fan accessory in homebridge but it doesnt respond to powering on or off.
Hi merdok, I used two MiAirPurifier2S which work well with miot. But the device info about temperature and humidity is not unreliable. Can you add a plug or other options to block this value?
I use two Smartmi Air Purifier which work nice with miot. But the don't only have PM2.5, they also monitor TVOC (gas concentration). Is it possible to give this value to Homekit?
I'm using homebridge from today so haven't got much info, but just installed this plugin and when i open it's settings popup it kills my chrome with high 100% cpu.
When i have time before it freezes out and close the settings popup it just immediately fix it so the cpu usege drops back to normal.
Can't see any error logs in devtools.
Versions:
macOS 11.3.1 (20E241) (Big Sur)
Chrome: 90.0.4430.85
Node.js: v14.16.0
Npm: v7.11.2
Homebridge: v1.3.4
homebridge-config-ui-x: v4.41.1
omebridge-miot: v0.7.4
update: just tried it in safari and there's no problem so something goes wrong with chrome
Hi! Thanks for your job, your plugin is the unique one that works with Air Purifier 3C
I’d like to disable the “Screen” brightness from HomeKit, my interest is just to have the Air Purifier without screen control
Do you know how can I remove from HomeKit?
Second question, any changes to let appear the temperature and humidity sensors?
This is my configuration:
"accessories": [],
"platforms": [
{
"platform": "miot",
"devices": [
{
"name": "Purificatore",
"ip": "192.168.178.xxx",
"token": "adxxxxxxxxxxb",
"deviceId": "3xxxxxxx",
"model": "zhimi.airpurifier.mb4",
"pollingInterval": 5,
"buzzerControl": false,
"childLockControl": false,
"ledControl": false,
"swingControl": false,
"moveControl": false,
"fanLevelControl": false,
"ioniserControl": false,
"dryControl": false,
"modeControl": false,
"lightModeControl": false,
"motorControl": false,
"pm25Breakpoints": [
5,
12,
35,
55
]
}
]
}
]
}
First off, thanks for your hard work.
A small issue that I would like to point out: I have bought the Mi Air Purifier Pro H (zhimi.airpurifier.va1); unfortunately, the model I got was the Chinese one and I can't set it up in my local server (Greece/Germany). Either way, I would eventually want to integrate it with HomeKit.
The issue that I am having is that the plugin does not support this particular model. I can make the device work by manually setting the model to zhimi.airpurifier.vb2. Several feature do work (temp/air quality/humidity sensor data, device on/off, filet lifespan, native auto/manual mode switching, as well as the extra LED and mode switches), but it's impossible to control fan speed from HomeKit/Homebridge.
To be more specific, attempting to change the speed via HomeKit switches the purifier mode to manual ("favorite") and defaults to the last fan speed set via the Xiaomi Home app. Moreover, the fan speed displayed in HomeKit is always the last speed set in the Xiaomi Home app while using manual mode (i.e. switching to Level 1-2-3 fan speeds is not reflected in the HomeKit interface). One more bit of interest: the official app allows for setting of speed at ten percent increments (10%-20%-...-90%-100%), which the HomeKit/Homebridge interface assigns to 8%-15%-20%-25%-30%-35%-40%-45%-50%-62% speeds, respectively.
On a side note, with a working fan speed control, the actual Homebridge plugin would only need an extra sleep mode switch, as the air purifier service supports auto/manual mode switching by itself, so it would be nice to be able to enable and disable individual extra switches in config.json, plus it allow for a less cluttered interface. I could open a separate ticket for this if it helps your workflow, but this matter is dependent on the fan speed issue that I'm describing, so I defer to your judgement on this.
Do you think you could take a look into this? I can provide debug logs or any other details, if you need them.
Again, thanks for your hard work.
Hello!
Can you add support Xiaomi Mi Air Purifier A1 (MJXFJ-150-A1) dmaker.airfresh.a1?
Hi, thanks for great work!
Jeszcze raz dzięki za super robotę!
Hi,
First thanks for the great plugin. Everything works fine, except of one thing.
I use the Air purifier 3C and want to define that it is off if quality is good and turns on in automatically mode when it is bad. The thing I noticed is that the plug-in does not get the changed air quality if the device is in off state. If I open the Mi home app it will get it and the automation runs. But without opening the the mi home app. I also have a 2H and use it with other plug-in and it gets the state of air quality without opening the app.
Is there a way to force to get the air quality state when device is inactive?
HI, are there any possibility to expose the Purifier and the Air sensor as two different accessories and not grouped?
My request made because if I want to switch from Automatic to Manual mode without use the switch plugin, I can do trough the Purifier accessory but to do that I need to enter inside the tile group
Hey,
Could you please add support for this model? I can help with logs & tests. I've already tried to connect the vacuum via this plugin and it seems to connect fine just actions are not working.
After pressing turn on in Homekit it shows there that it's turned on but after 1-2 secs it becomes turned off again.
Hi, I have both a vacuum and a fan by Xiaomi and they both show up as fans in HomeKit, which creates issues when controlling HomeKit with Siri.
Would it be possible to differentiate the devices, ie. make all vacuums show up only as smart plugs?
Hi,
please add support for widetech 30L & 12L (nwt.derh.312en).
Thank you.
Hi,
any chance you could implement support for the Dreame D9 (dreame.vacuum.p2009) vacuum cleaner robot?
Current behavior on 0.9.2 is same as #24 - configured as fan switch, but switches off after 1-2 seconds. When the robot is actually running, the switch is on. There is also only one switch present in HomeKit.
Thanks! Filip
i successfully install your plugin and configured a xiaomy heater, i can start & stop. But
i have a constant warning:
This plugin generated a warning from the characteristic 'Target Heater-Cooler State': characteristic value expected number and received undefined. See https://git.io/JtMGR for more info.
and when i start trhe heater via the plugin on applehome, i get this in the log
This plugin generated a warning from the characteristic 'Target Heater-Cooler State': characteristic value expected number and received undefined. See https://git.io/JtMGR for more info.
this my config file:
"model": "zhimi.heater.zb1",
"pollingInterval": 10,
"buzzerControl": false,
"ledControl": true,
"horizontalSwingControl": false,
"verticalSwingControl": false,
"naturalModeControl": true,
"sleepModeControl": false,
"horizontalMoveControl": false,
"verticalMoveControl": false,
"fanLevelControl": true,
"ioniserControl": false,
"shutdownTimer": false,
"heatLevelControl": true,
"screenControl": false,
"dryModeControl": false,
"autoModeControl": false,
"favoriteModeControl": false
Pls add support for dmaker.fan.p5 (Mi Smart Standing Fan 1X). Thank u so much !!
Hi. I know I'm a bit annoying but I've another question. Or better: This time a feature request.
In the AirPurifierAccessory.js
is the following part
if (pm25Density <= 7) {
return Characteristic.AirQuality.EXCELLENT;
} else if (pm25Density > 7 && pm25Density <= 15) {
return Characteristic.AirQuality.GOOD;
} else if (pm25Density > 15 && pm25Density <= 30) {
return Characteristic.AirQuality.FAIR;
} else if (pm25Density > 30 && pm25Density <= 55) {
return Characteristic.AirQuality.INFERIOR;
} else if (pm25Density > 55) {
return Characteristic.AirQuality.POOR;
}
I understand these values are based on some research, but I'd love to configure this, so I could finetune my automations a bit more. Other plugins that don't work with my air purifier had a simple array for this, where one could simply add five values for this.
Would it be possible to add this to your plugin?
Hi, I finally got this working (thanks for your help) and wanted to ask if it's possible to get the air quality level in HomeKit from the Air Purifier 3C? I'd love to set automations in HomeKit but right now I'm pretty limited without this information.
Hi Merdok,
Sorry in advance, if I post this in the wrong section. Would it be possible to add support for Xiaomi Air Purifier 2H; zhimi.airpurifier.mc2 .
Hi, thx for this plugin!
I got this error, but my fan is this one zhimi.heater.nb1 (Smartmi Smart Fan Heater )
What can I do here?
Thx!!!
[3/17/2021, 11:21:14 AM] [miot] Initializing devices [3/17/2021, 11:21:14 AM] [miot] [Smartmi Smart Fan Heater] Got device configuration, initializing device with name: Smartmi Smart Fan Heater [3/17/2021, 11:21:14 AM] [miot] [Smartmi Smart Fan Heater] Device model known: zhimi.heater.na1! Creating device! [3/17/2021, 11:21:14 AM] [miot] [Smartmi Smart Fan Heater] Initializing device properties [3/17/2021, 11:21:14 AM] [miot] [Smartmi Smart Fan Heater] Initializing device capabilities [3/17/2021, 11:21:14 AM] [miot] [Smartmi Smart Fan Heater] Device not supported! Using a generic device with limited properties! Consider requesting device support! [3/17/2021, 11:21:14 AM] [miot] [Smartmi Smart Fan Heater] Initializing accessory! [3/17/2021, 11:21:14 AM] [miot] [Smartmi Smart Fan Heater] Accessory successfully initialized!
Please add support for viomi.vacuum.v10 device.
Hello. First, thank you very much for this wonderful plugin, it works perfectly with my Dream D9!
Do you think it would be possible to implement a slider instead of different switches, in order to control the Suction Mode? I know that another plugin https://github.com/homebridge-xiaomi-roborock-vacuum/homebridge-xiaomi-roborock-vacuum/blob/HEAD/models/speedmodes.js can do that. For example: OFF / 0-25% = Quiet / 25-50% = Normal / 50-75% = Strong / 75-100% = Turbo.
Obviously, it should be an option only, because people could prefer the switches.
EDIT: event better, is it possible to have steps in the slider?
If I add an action button I get this error:
ReferenceError: tmpActionName is not defined
at /usr/local/lib/node_modules/homebridge-miot/lib/base/BaseAccessory.js:287:82
at Array.filter ()
at RobotCleanerAccessory.prepareActionButtonServices (/usr/local/lib/node_modules/homebridge-miot/lib/base/BaseAccessory.js:287:38)
at RobotCleanerAccessory.setupAdditionalAccessoryServices (/usr/local/lib/node_modules/homebridge-miot/lib/modules/robotcleaner/RobotCleanerAccessory.js:57:34)
at new BaseAccessory (/usr/local/lib/node_modules/homebridge-miot/lib/base/BaseAccessory.js:49:12)
at new RobotCleanerAccessory (/usr/local/lib/node_modules/homebridge-miot/lib/modules/robotcleaner/RobotCleanerAccessory.js:9:5)
at Function.createAccessory (/usr/local/lib/node_modules/homebridge-miot/lib/AccessoryFactory.js:52:24)
at xiaomiMiotDevice.initAccessory (/usr/local/lib/node_modules/homebridge-miot/index.js:138:48)
at MiotController. (/usr/local/lib/node_modules/homebridge-miot/index.js:99:14)
at MiotController.emit (events.js:315:20)
Homebridge continuously restart.
My config is:
{
"devices": [
{
"name": "Britney",
"ip": "192.168.3.81",
"token": "3447675969616a485945674239794d6c",
"pollingInterval": 5,
"deepDebugLog": false,
"actionButtons": [
{
"action": "locate_robot",
"name": "Trova"
}
]
}
],
"platform": "miot"
}
Everything works fine without custom action button.
Hi Merdok,
I created this issue before on the Mi fan plugin, which I currently use on the 1.3.1 version, but I would like to ask you to consider this again.
For fans with multiple steps, the are now toggles created for each fan speed. I think it would make more sense to use the old behaviour to have a slider that automatically adjusts to the closest value possible.
I understand that the current implementation is better from a technical standpoint but when using the Home app the old implementation just works way better. Could you add a toggle in the settings to use the slider behaviour?
Again, thank you for this excellent plugin!
Stijn
Hi,
please add support for miot vacuum cleaners. For example: Dreama F9 (dreame.vacuum.p2008).
Thank you.
I successfully added my Air Purifier 3C to the Plugin, bit it doesn't show up in my devices. It's not unassigned or something, it's just not there. I also can't find it in my home app. But according to the logs everything seems fine
My Device setup looks like this:
[
{
"name": "Xiaomi Air Purifier",
"ip": "REDACTED",
"token": "REDACTED",
"pollingInterval": 5,
"fanLevelControl": true,
"modeControl": true
}
]
Please add support for Scene Curtain WIFI X (leshi.curtain.v0001)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.