Closed blastoma closed 3 years ago
Hi, i am not yet sure but it looks to me as an older miio device. I can still add support for it using the MiCloud but for non-miot devices it usually means that some features will be missing.
Hi, @merdok ! I think it is not an old device. For example, support for Home assistant – https://github.com/syssi/xiaomi_airpurifier/blob/develop/docs/dmaker.airfresh.a1.yaml and https://github.com/syssi/xiaomi_airpurifier/blob/develop/docs/dmaker-airfresh-t2017.md
Yes, based on the home assistant implementation I can see that this device is not a miot device but the older miio device. It might not be that old but it still uses the old miio protocol. Like I mentioned I can add support for the device but only through MiCloud which will probably limit the features a little bit.
@merdok if you can, please, do it for me
Will add it, will be available in the next update! Will let you know when it is ready.
Did you by the way try to already add the device? If this is a miot device then a generic device should be created and a switch should appear which allows you to at least turn it on and off right now? Can you try that?
@merdok, yes, I tried already. I set model = dmaker.fan.p5 and use MiHome auth.
Ok, and at least the power switch works?
Yes, but with model = zhimi.airpurifier.mc2 and with some bug:
The properties does not match with the zhimi.airpurifier.mc2 device so they are all messed and hence the errors... Please wait till next update, proper support will be added then!
Thank you so much! I will wait
@merdok hi! Can you tell me next release date?)
If everything goes well then probably next Sunday or Monday.
Please try version 0.9.6. The device should now be supported.
@merdok, hi! It works, but with some issues:
The other in good!
There is.
Thank you!
But i do not think that shows a value? How does the detail page look like?
You are right! I see it now. I will add in the next update!
As I never had experience with such sensor, do you know what range is considered normal? And from what value is it abnormal?
It depends on the Country. https://www.kane.co.uk/knowledge-centre/what-are-safe-levels-of-co-and-co2-in-rooms Typicaly: EXCELLENT – 400-800ppm GOOD – 800-1000ppm LOW – 1000-1500ppm CRITICAL – 1500-2000ppm+
In the flat max ppm can be 3000-4000
The carbon dioxide sensor has just two states: normal and abnormal. So I would need to know the usual value when the abnormal state needs to be triggered...
1000 seems like a good level to trigger abnormal, but maybe I will make that configurable.
1000 – good level for abnormal. For example, in China, 1000 – normal level, after 1500 – abnormal
Ok, thanks for the info👍 As mentioned will add that in the next update! Will let you know when it is ready!
I have a Xiaomi Air Purifier MJXFJ-300-G1(Model: dmaker.airfresh.t2017),the plugin can identify the device model correctly, if I don't set the model in config, it will be added as a general switch to homekit, but the switch is not functional. Following is the log
[7/2/2021, 6:07:19 PM] [miot] [test device] Connected to device: dmaker.airfresh.t2017
[7/2/2021, 6:07:19 PM] [miot] [test device] Setting up device!
[7/2/2021, 6:07:19 PM] [miot] [test device] Fetching device info.
[7/2/2021, 6:07:19 PM] [miot] [test device] Doing device specific setup
[7/2/2021, 6:07:19 PM] [miot] [test device] Doing initial property fetch
[7/2/2021, 6:07:19 PM] [miot] [test device] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14
[7/2/2021, 6:07:19 PM] [miot] [test device] Device setup finished! Device ready, you can now control your device!
[7/2/2021, 6:07:19 PM] [miot] [test device] Device connected!
[7/2/2021, 6:07:19 PM] [miot] [test device] Successfully saved device info!
[7/2/2021, 6:07:20 PM] [miot] [test device] Got device info! Device firmware: 2.2.0
[7/2/2021, 6:07:20 PM] [miot] [test device] Error while parsing response from device for property power. Response: {"did":"124411779","siid":2,"piid":1,"code":-4004}
[7/2/2021, 6:07:20 PM] [miot] [test device] Got initial device properties:
[
{
"name": "power",
"value": false
}
]
[7/2/2021, 6:07:24 PM] [miot] [test device] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14
[7/2/2021, 6:07:25 PM] [miot] [test device] Error while parsing response from device for property power. Response: {"did":"124411779","siid":2,"piid":1,"code":-4004}
[7/2/2021, 6:07:29 PM] [miot] [test device] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14
[7/2/2021, 6:07:30 PM] [miot] [test device] Error while parsing response from device for property power. Response: {"did":"124411779","siid":2,"piid":1,"code":-4004}
[7/2/2021, 6:07:34 PM] [miot] [test device] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14
^C[7/2/2021, 6:07:39 PM] Got SIGINT, shutting down Homebridge...
[7/2/2021, 6:07:39 PM] [miot] [test device] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14
[7/2/2021, 6:07:42 PM] [miot] [test device] Error while setting property power to value true! Error: Call to device timed out
[7/2/2021, 6:07:43 PM] [miot] [test device] Poll failed! No response from device! Error: busy.
If I set the model number to "dmaker.airfresh.a1", and set micloud username and password, it always tells me " Error: The device requires a MiCloud connection! In order to control the device please specify a MiCloud username and password! Log as follow
[7/2/2021, 6:10:55 PM] [miot] [test device] Connected to device: dmaker.airfresh.t2017
[7/2/2021, 6:10:55 PM] [miot] [test device] Setting up device!
[7/2/2021, 6:10:55 PM] [miot] [test device] Fetching device info.
[7/2/2021, 6:10:55 PM] [miot] [test device] Doing device specific setup
[7/2/2021, 6:10:55 PM] [miot] [test device] Device requires MiCloud! Trying to connect!
[7/2/2021, 6:10:55 PM] [miot] [test device] Error: The device requires a MiCloud connection! In order to control the device please specify a MiCloud username and password! Canceling setup!
[7/2/2021, 6:10:55 PM] [miot] [test device] Trying to reconnect in 30 seconds...
[7/2/2021, 6:10:55 PM] [miot] [test device] Setup failed!
[7/2/2021, 6:10:55 PM] [miot] [test device] Error: MiCloud is required but login to MiCloud failed!
[7/2/2021, 6:10:57 PM] [miot] [test device] Could not retrieve device info: Error: Network communication is unavailable, device might be destroyed
Config:
{
"platforms": [
{
"platform": "miot",
"devices": [
{
"name": "test device",
"ip": "192.168.2.xxx",
"token": "xxxxxxxxx",
"model": “dmaker.airfresh.a1”
"micloud": [
{
"username": "myusername",
"password": "mypassword",
"forceMiCloud": true
}]
}
]
}
]
}
@gitgayhub the way you specified the micloud in the config is wrong. Remove the [] brackets.
@merdok Thanks, I got it working now. By using model dmaker.airfresh.a1, I can get power switch, buzzer switch, heater switch and air quality , but only PM2.5, CO2 sensor is not shown. log attached:
[7/2/2021, 7:08:20 PM] [miot] [window opener] Successfully saved device info!
[7/2/2021, 7:08:21 PM] [miot] [test device] Error while parsing response from device for property co2_density. Response: {"did":"312312313212","siid":3,"piid":2,"code":-704040003}
[7/2/2021, 7:08:21 PM] [miot] [test device] Got initial device properties:
[
{
"name": "power",
"value": true
},
{
"name": "mode",
"value": 0
},
{
"name": "heater",
"value": false
},
{
"name": "child_lock",
"value": 70
},
{
"name": "alarm",
"value": false
},
{
"name": "pm25_density",
"value": 8
},
{
"name": "co2_density",
"value": 0
},
{
"name": "filter_life_level",
"value": 40
},
{
"name": "filter_left_time",
"value": 36
}
]
[7/2/2021, 7:08:21 PM] [miot] [test device] Filter life level: 40%.
[7/2/2021, 7:08:21 PM] [miot] [test device] Error on initial property request! TypeError: this.getFilterLeftTime is not a function
[7/2/2021, 7:08:21 PM] [miot] [test device] Got device info from MiCloud:
{
"did": "14123123123",
"token": "xxxxxx",
"longitude": "0.00000000",
"latitude": "0.00000000",
"name": "Mi Fresh Air Ventilator",
"pid": "0",
"localip": "192.168.2.xxx",
"mac": "xxxxxx",
"ssid": "xxxxxx",
"bssid": "xxxxxx",
"parent_id": "",
"parent_model": "",
"show_mode": 1,
"model": "dmaker.airfresh.t2017",
"adminFlag": 1,
"shareFlag": 0,
"permitLevel": 16,
"isOnline": true,
"desc": "Device online ",
"extra": {
"isSetPincode": 0,
"pincodeType": 0,
"fw_version": "2.2.0",
"needVerifyCode": 0,
"isPasswordEncrypt": 0,
"mcu_version": "0016"
},
"uid": 21321312312,
"pd_id": 678,
"password": "",
"p2p_id": "",
"rssi": -60,
"family_id": 0,
"reset_flag": 0
}
Model description file can be found at https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:air-fresh:0000A012:dmaker-t2017:1
I will add proper support for your device in the next update. So to be sure, you need to use micloud to control the device, right? That would mean that it is an miio device and I need to add the micloud requirement.
As for the co2, the property does not match with the airfresh.a1, it has a different id on your device, but that will also be fixed as soon as I add proper support for your device!
Oh, and there is also an error! Will also correct that!
@merdok Thank you very much!
Seems that micloud is the only method to add this device to homebridge, right?
Yes, there is no other way using my plugin. Your device supports local commands but with the older miio protocol which is not supported here.
thank you anyway, I managed to use HA to add it to homekit. I tried to find a miio homebridge plugin but without success. HA is too heavy for this simple job, I still prefer homebridge if there's a miio plugin
@blastoma As of version 0.9.7 a CO2 sensor is now available on supported devices! @gitgayhub support for you device is now included in version 0.9.7!
Hi, it works
Hello! Can you add support Xiaomi Mi Air Purifier A1 (MJXFJ-150-A1) dmaker.airfresh.a1?