『瀚思彼岸』» 智能家居技术论坛

标题: 小米MIoT设备自动识别接入HA插件 2024-04-30新版发布 [打印本页]

作者: anlong    时间: 2021-1-22 16:40
标题: 小米MIoT设备自动识别接入HA插件 2024-04-30新版发布
本帖最后由 anlong 于 2024-4-30 18:02 编辑

插件地址:https://github.com/al-one/hass-xiaomi-miot
中文说明:https://github.com/al-one/hass-xiaomi-miot/blob/master/README_zh.md
使用教程:https://mp.weixin.qq.com/s/1y_EV6xcg17r743aV-2eRw

MIoT-Spec 是小米IoT平台根据硬件产品的联网方式、产品功能的特点、用户使用场景的特征和用户对硬件产品使用体验的要求,设计的描述硬件产品功能定义的标准规范。
本插件利用了miot协议的规范,可将小米设备自动接入HomeAssistant,目前已支持大部分小米米家智能设备。且该插件支持HA后台界面集成,无需配置yaml即可轻松将小米设备接入HA。

Xiaomi Miot Auto 通过独有的miio2miot机制,可以实现绝大部分的WiFi设备本地接入,随着版本的更新,支持本地接入的WiFi设备也将越来越多。


                               
登录/注册后可看大图


安装/更新插件:

方法1:HACS
首次安装:HACS > 集成 > +浏览并下载存储库 > 搜索`Xiaomi Miot Auto` > 下载此存储库
升级插件:HACS > 集成 > `Xiaomi Miot Auto` > 更新 / 重新下载

方法2:手动安装
下载后解压并复制`custom_components/xiaomi_miot`文件夹到HA根目录下的`custom_components`文件夹中,也可以执行下面的shell命令可以自动安装/更新
  1. wget -O - https://hacs.vip/get | DOMAIN=xiaomi_miot REPO_PATH=al-one/hass-xiaomi-miot ARCHIVE_TAG=latest bash -
复制代码
方法3:`shell_command`服务
  1. # configuration.yaml
  2. shell_command:
  3.   update_xiaomi_miot: |-
  4.     wget -O - https://hacs.vip/get | DOMAIN=xiaomi_miot REPO_PATH=al-one/hass-xiaomi-miot ARCHIVE_TAG=latest bash -
复制代码

安装后重启HA,依次进入:配置 > 集成 > +添加集成,搜索“Xiaomi Miot Auto”,配置你的账号或设备信息即可。
[attach]30655[/attach]

如果安装成功后搜索不到插件,请确认的插件目录结构如下,并清理浏览器缓存或更换浏览器后再尝试。
  1. .../custom_components/xiaomi_miot/
  2. ├── __init__.py
  3. ├── air_quality.py
  4. ├── binary_sensor.py
  5. ├── camera.py
  6. ├── climate.py
  7. ├── config_flow.py
  8. ├── core/
  9. ├── ......
  10. ├── vacuum.py
  11. └── water_heater.py
复制代码

目前支持的HA实体类型有:sonsor、binary_sensor、switch、light、fan、climate、cover、humidifier、media_player、camera、vacuum、number、select、water_heater、device_tracker
支持的米家设备类型有:空调开关插座风扇电视投影洗衣机冰箱净水器电饭煲/电磁炉烤箱/微波炉空气炸锅饮水机热水器油烟机窗帘电机晾衣机扫地机加湿器除湿器空气检测仪空气净化器新风机取暖器浴霸马桶(盖)、电热毯/水暖垫电动床按摩椅开窗器宠物饮水机鱼缸后视镜手表小爱音箱

不支持的设备:
本插件使用轮询的方式获取设备状态,因此无法实时监听部分设备的事件

集成设备:

通过小米账号集成 (Add devices using Mi Account)
该方式比较简单,也是推荐的方式,填入小米账号密码后读取设备列表,并在后续步骤中配置筛选设备的条件,保存后插件会把符合条件的设备自动添加到HA。如果不知道如何配置筛选条件或者账号下的设备不多,可以将筛选方式全部改成`Exclude (排除)`,并去掉所有的勾选。
自v0.4.4版本开始,插件新增支持账号集成时选择连接设备的模式:

[attach]30656[/attach]

通过IP/token集成(Add device using host/token)
该方式适合在局域网环境下支持miot协议的米家设备,并可通过集成选项改变更新状态的频率。
[attach]30658[/attach]



常见问题:

你们的支持是我持续更新的动力!如果这个插件对你有用,请为项目点击一个★Star


QQ交流群:198841186 ,插件使用过程中遇到任何问题都可加群咨询,入群口令回帖可见



作者: miniknife    时间: 2021-1-22 16:51
越来越完善了
作者: Solita    时间: 2021-1-22 16:56
这个厉害了,以后就不需要一个个去找了
作者: aktifin    时间: 2021-1-22 16:59
这个nb,之前不能通过miot接入的净水器也完美接入了
作者: miniknife    时间: 2021-1-22 17:46
本帖最后由 miniknife 于 2021-1-22 17:53 编辑

试了一个港兴达的插座,一个米家空净 pro H 好像都不行,出不来实体,会不会与论坛里另一位大神的插件有冲突
作者: 余歌唱晚    时间: 2021-1-22 18:23
这就插件就厉害了……
作者: anlong    时间: 2021-1-22 19:21
本帖最后由 anlong 于 2021-1-22 19:23 编辑
miniknife 发表于 2021-1-22 17:46
试了一个港兴达的插座,一个米家空净 pro H 好像都不行,出不来实体,会不会与论坛里另一位大神的插件有冲 ...

应该是不会有冲突的。可以尝试修改插件日志级别为debug后重启HA,然后查找日志:
  1. grep 'Miot async_setup_entry' .homeassistant/home-assistant.log
复制代码

另外目前不支持空净设备。


作者: 半世迷離    时间: 2021-1-22 20:11
这就插件就厉害了……
作者: haowei    时间: 2021-1-22 20:22
代码在哪里输入
作者: haowei    时间: 2021-1-22 20:39
搜不到集成怎么办
作者: mickey50    时间: 2021-1-22 21:17
请问小沐智能马桶盖,可以支持么,这是命令结果
INFO:miio.cliebug mode active
Running command raw_command
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.miioprotocol:Got a response: Container:
    data = Container:
        data = b'' (total 0)
        value = b'' (total 0)
        offset1 = 32
        offset2 = 32
        length = 0
    header = Container:
        data = b'!1\x00 \x00\x00\x00\x00\x05.(q\x00t\x1be' (total 16)
        value = Container:
            length = 32
            unknown = 0
            device_id = b'\x05.(q' (total 4)
            ts = 1970-03-30 01:39:49
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' (total 16)
DEBUG:miio.miioprotocoliscovered 052e2871 with ts: 1970-03-30 01:39:49, token: b'00000000000000000000000000000000'
DEBUG:miio.miioprotocol:192.168.1.110:54321 >>: {'id': 1, 'method': 'get_properties', 'params': [{'did': 'result', 'siid': 2, 'piid': 1}]}
DEBUG:miio.miioprotocol:192.168.1.110:54321 (ts: 1970-03-30 01:39:50, id: 1) << {'error': {'code': -9999, 'message': 'UART timeout'}, 'id': 1}
DEBUG:miio.click_common:Exception: {'code': -9999, 'message': 'UART timeout'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/miio/click_common.py", line 59, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/click_common.py", line 280, in wrap
    kwargs["result"] = func(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/click_common.py", line 245, in command_callback
    return miio_command.call(miio_device, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/click_common.py", line 193, in call
    return method(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/device.py", line 162, in raw_command
    return self.send(command, parameters)
  File "/usr/local/lib/python3.8/site-packages/miio/device.py", line 143, in send
    return self._protocol.send(
  File "/usr/local/lib/python3.8/site-packages/miio/miioprotocol.py", line 213, in send
    self._handle_error(payload["error"])
  File "/usr/local/lib/python3.8/site-packages/miio/miioprotocol.py", line 273, in _handle_error
    raise DeviceError(error)
miio.exceptions.DeviceError: {'code': -9999, 'message': 'UART timeout'}
Error: {'code': -9999, 'message': 'UART timeout'}
作者: un123    时间: 2021-1-22 21:31
有空弄弄小米的4L电饭煲呀,大神
作者: anlong    时间: 2021-1-22 21:40
mickey50 发表于 2021-1-22 21:17
请问小沐智能马桶盖,可以支持么,这是命令结果
INFO:miio.cliebug mode active
Running command raw_com ...

看起来是不支持了。或者可能python-miio不支持该设备
作者: linoul    时间: 2021-1-22 21:54
求个智能床的组件 垃圾玩意只有几个预设模式,不能固定想要的角度 我觉的cover组件也能做 奈何不会信息在这https://miot-spec.org/miot-spec- ... 00A06A:qushui-001:1
作者: anlong    时间: 2021-1-22 22:03
un123 发表于 2021-1-22 21:31
有空弄弄小米的4L电饭煲呀,大神

最新的提交已经支持了,不过仅支持读取状态
作者: un123    时间: 2021-1-22 22:08
anlong 发表于 2021-1-22 22:03
最新的提交已经支持了,不过仅支持读取状态

我去看看
作者: lipwah    时间: 2021-1-22 22:47
已经把邦先生M1S加入了
作者: MX10085    时间: 2021-1-22 23:56
Logger: homeassistant.components.climate
Source: custom_components/xiaomi_miot/climate.py:92
Integration: 空调 (documentation, issues)
First occurred: 下午11:43:37 (2 occurrences)
Last logged: 下午11:43:37

Error while setting up xiaomi_miot platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/xiaomi_miot/climate.py", line 36, in async_setup_entry
    await async_setup_platform(hass, config, async_add_entities)
  File "/config/custom_components/xiaomi_miot/climate.py", line 55, in async_setup_platform
    entities.append(MiotClimateEntity(cfg, srv))
  File "/config/custom_components/xiaomi_miot/climate.py", line 92, in __init__
    self._prop_temperature = self._environment.get_property('temperature')
AttributeError: 'NoneType' object has no attribute 'get_property'
作者: damonwe    时间: 2021-1-23 01:54
感谢大佬!
作者: 27hh    时间: 2021-1-23 02:58
anlong 发表于 2021-1-22 22:03
最新的提交已经支持了,不过仅支持读取状态

为什么会只能读取不能控制呢?
作者: cxq19880310    时间: 2021-1-23 10:05
MODEL: syniot.curtain.syc1  这个类型的米家卷帘电机不支持,找不到实体,麻烦看一下,别的都找到实体了
作者: qiaowei361    时间: 2021-1-23 10:57
非常棒,感谢作者,马上尝试一下
作者: uavana    时间: 2021-1-23 11:00
这个无敌了
作者: zxyny1989    时间: 2021-1-23 11:14
学习学习。谢谢大佬分享
作者: hhyhxc13    时间: 2021-1-23 11:23
这个牛P了,膜拜大佬ing
作者: yzxwxl    时间: 2021-1-23 11:38
电磁炉和小米榨汁机找不到实体

作者: yzxwxl    时间: 2021-1-23 11:49
电磁炉
dee28605 raw_command get_properties "[{'did': 'result', 'siid': 2, 'piid': 1}]"                                                                                          
INFO:miio.cliebug mode active                                                                                                                                          
Running command raw_command                                                                                                                                             
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''                                                                                                         
DEBUG:miio.miioprotocol:Got a response: Container:                                                                                                                       
    data = Container:                                                                                                                                                   
        data = b'' (total 0)                                                                                                                                             
        value = b'' (total 0)                                                                                                                                            
        offset1 = 32                                                                                                                                                     
        offset2 = 32                                                                                                                                                     
        length = 0                                                                                                                                                      
    header = Container:                                                                                                                                                  
        data = b'!1\x00 \x00\x00\x00\x00\x07(\xdb\x87\x00\x02^\xd8' (total 16)                                                                                          
        value = Container:                                                                                                                                               
            length = 32                                                                                                                                                  
            unknown = 0                                                                                                                                                  
            device_id = unhexlify('0728db87')                                                                                                                           
            ts = 1970-01-02 19:09:12                                                                                                                                    
        offset1 = 0                                                                                                                                                      
        offset2 = 16                                                                                                                                                     
        length = 16                                                                                                                                                      
    checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf                                                                                         
f' (total 16)                                                                                                                                                            
DEBUG:miio.miioprotocoliscovered 0728db87 with ts: 1970-01-02 19:09:12, token:                                                                                         
b'ffffffffffffffffffffffffffffffff'                                                                                                                                    
DEBUG:miio.miioprotocol:192.168.31.199:54321 >>: {'id': 1, 'method': 'get_proper                                                                                         
ties', 'params': [{'did': 'result', 'siid': 2, 'piid': 1}]}                                                                                                              
DEBUG:miio.miioprotocol:192.168.31.199:54321 (ts: 1970-01-02 19:09:12, id: 1) <<                                                                                         
{'id': 1, 'result': [{'did': 'result', 'siid': 2, 'piid': 1, 'code': -4004}], '                                                                                         
exe_time': 160}                                                                                                                                                         
[{'did': 'result', 'siid': 2, 'piid': 1, 'code': -4004}]
作者: wy_112206    时间: 2021-1-23 12:07
智米电热器不行吗
作者: carrot8848    时间: 2021-1-23 12:24
大家的token都是哪里获取的呢?
作者: aktifin    时间: 2021-1-23 13:02
微波炉
raw_command get_prop
erties "[{'did': 'result', 'siid': 2, 'piid': 1}]"                                                           
INFO:miio.cliebug mode active                                                                              
Running command raw_command                                                                                 
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''                                             
DEBUG:miio.miioprotocol:Got a response: Container:                                                           
    data = Container:                                                                                       
        data = b'' (total 0)                                                                                 
        value = b'' (total 0)                                                                                
        offset1 = 32                                                                                         
        offset2 = 32                                                                                         
        length = 0                                                                                          
    header = Container:                                                                                      
        data = b'!1\x00 \x00\x00\x00\x00\x07\x9b\x93?\x00\x13Q*' (total 16)                                 
        value = Container:                                                                                   
            length = 32                                                                                      
            unknown = 0                                                                                      
            device_id = unhexlify('079b933f')                                                               
            ts = 1970-01-15 15:39:22                                                                        
        offset1 = 0                                                                                          
        offset2 = 16                                                                                         
        length = 16                                                                                          
    checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)               
DEBUG:miio.miioprotocoliscovered 079b933f with ts: 1970-01-15 15:39:22, token: b'ffffffffffffffffffffffffff
ffffff'                                                                                                      
DEBUG:miio.miioprotocol:192.168.xx.xx:54321 >>: {'id': 1, 'method': 'get_properties', 'params': [{'did': 're
sult', 'siid': 2, 'piid': 1}]}                                                                              
DEBUG:miio.miioprotocol:192.168.xx.xx:54321 (ts: 1970-01-15 15:39:23, id: 1) << {'id': 1, 'result': [{'did':
'result', 'siid': 2, 'piid': 1, 'code': -4004}], 'exe_time': 420}                                          
[{'did': 'result', 'siid': 2, 'piid': 1, 'code': -4004}]                                                     

作者: cxq19880310    时间: 2021-1-23 13:18
https://miot-spec.org/miot-spec- ... 0A00C:syniot-syc1:1  这个是设备的spec
作者: panwang    时间: 2021-1-23 14:40
您好,请看看这个可以加进去吗

                               
登录/注册后可看大图


作者: itispip    时间: 2021-1-23 17:24
请添加为插座plug设备的支持
作者: aexyun    时间: 2021-1-23 19:09
我的狗剩16A的添加了也识别不了
作者: sircoco    时间: 2021-1-23 21:58
智米电暖器找不到实体
作者: evaz    时间: 2021-1-23 23:13
本帖最后由 evaz 于 2021-1-23 23:56 编辑

厉害了
我用的斐讯N1 ,wrt 装docker---hassio  ,执行完命令后重启添加没有出现MloT

作者: anlong    时间: 2021-1-24 00:25
MX10085 发表于 2021-1-22 23:56
Logger: homeassistant.components.climate
Source: custom_components/xiaomi_miot/climate.py:92
Integra ...

最新的提交已修复
作者: shanonline    时间: 2021-1-24 01:43
添加小米电饭锅后无实体,日志如下:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/xiaomi_miot/sensor.py", line 38, in async_setup_entry
    await async_setup_platform(hass, config, async_add_entities)
  File "/config/custom_components/xiaomi_miot/sensor.py", line 65, in async_setup_platform
    entities.append(MiotSensorEntity(cfg, srv))
  File "/config/custom_components/xiaomi_miot/sensor.py", line 85, in __init__
    mapping.update(miot_service.mapping())
AttributeError: 'NoneType' object has no attribute 'update'

型号chunmi.cooker.eh402
token和ip地址均确认正确
作者: telanx    时间: 2021-1-24 12:06
对了,大佬,请问一下。
yeelight很多设备都是属于MIOT的范畴,比如凉霸,烁影风扇灯,那如果用您这个自动的插件就可以控制的话,那就可以不用您之前的yeelight插件了吧?
感谢大佬。
作者: anlong    时间: 2021-1-24 12:37
telanx 发表于 2021-1-24 12:06
对了,大佬,请问一下。
yeelight很多设备都是属于MIOT的范畴,比如凉霸,烁影风扇灯,那如果用您这个自动 ...

是的,miio_yeelink后续只做旧版miio协议的适配。
作者: anlong    时间: 2021-1-24 13:41
shanonline 发表于 2021-1-24 01:43
添加小米电饭锅后无实体,日志如下:
Traceback (most recent call last):
  File "/usr/src/homeassistant ...

最新提交已修复
作者: shanonline    时间: 2021-1-24 13:55
本帖最后由 shanonline 于 2021-1-24 14:50 编辑
anlong 发表于 2021-1-24 13:41
最新提交已修复

大佬,现在实体已经有了,但是实体显示不可用,报错信息{'code': -9999, 'message': 'user ack timeout'},是不是还是适配的问题

补充:尝试了论坛另一位大佬的miot_raw插件,配置siid和piid以后报错相同,在小米的miot调试助手里所有设备均可正常获取,是不是因为需要从小米云端读取信息?


作者: anlong    时间: 2021-1-24 15:47
shanonline 发表于 2021-1-24 13:55
大佬,现在实体已经有了,但是实体显示不可用,报错信息{'code': -9999, 'message': 'user ack timeout'} ...

我有个晾衣机也是这样。可能是python-miio对其不兼容
作者: tiger81    时间: 2021-1-24 18:00
mark一下,膜拜!!!
作者: 孑000孓    时间: 2021-1-24 19:09
cxq19880310 发表于 2021-1-23 10:05
MODEL: syniot.curtain.syc1  这个类型的米家卷帘电机不支持,找不到实体,麻烦看一下,别的都找到实体了 ...

我也是这个型号的窗帘电机,一直没有办法接入,想换成绿米的算了
作者: anlong    时间: 2021-1-24 21:09
cxq19880310 发表于 2021-1-23 13:18
https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:curtain:0000A00C:syniot-syc ...
  1. miiocli -d device --ip 192.168.lan.ip --token xxxxxx raw_command get_properties "[{'did': 'result', 'siid': 2, 'piid': 2}]"
复制代码


miiocli测试了吗
作者: tiger81    时间: 2021-1-24 21:39
本帖最后由 tiger81 于 2021-1-24 21:40 编辑

INFO:miio.cliebug mode active
Running command raw_command
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.miioprotocol:Got a response: Container:
    data = Container:
        data = b'' (total 0)
        value = b'' (total 0)
        offset1 = 32
        offset2 = 32
        length = 0
    header = Container:
        data = b'!1\x00 \x00\x00\x00\x00\x04\x8d\xf2\x04`\rw\xe9' (total 16)
        value = Container:
            length = 32
            unknown = 0
            device_id = unhexlify('048df204')
            ts = 2021-01-24 13:36:41
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
DEBUG:miio.miioprotocoliscovered 048df204 with ts: 2021-01-24 13:36:41, token: b'ffffffffffffffffffffffffffffffff'
DEBUG:miio.miioprotocol:192.168.0.162:54321 >>: {'id': 1, 'method': 'get_properties', 'params': [{'did': 'result', 'siid': 2, 'piid': 1}]}
DEBUG:miio.miioprotocol:Retrying with incremented id, retries left: 3
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.miioprotocol:Got a response: Container:
    data = Container:
        data = b'' (total 0)
        value = b'' (total 0)
        offset1 = 32
        offset2 = 32
        length = 0
    header = Container:
        data = b'!1\x00 \x00\x00\x00\x00\x04\x8d\xf2\x04`\rw\xee' (total 16)
        value = Container:
            length = 32
            unknown = 0
            device_id = unhexlify('048df204')
            ts = 2021-01-24 13:36:46
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
DEBUG:miio.miioprotocoliscovered 048df204 with ts: 2021-01-24 13:36:46, token: b'ffffffffffffffffffffffffffffffff'
DEBUG:miio.miioprotocol:192.168.0.162:54321 >>: {'id': 102, 'method': 'get_properties', 'params': [{'did': 'result', 'siid': 2, 'piid': 1}]}
DEBUG:miio.miioprotocol:Retrying with incremented id, retries left: 2
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.miioprotocol:Got a response: Container:
    data = Container:
        data = b'' (total 0)
        value = b'' (total 0)
        offset1 = 32
        offset2 = 32
        length = 0
    header = Container:
        data = b'!1\x00 \x00\x00\x00\x00\x04\x8d\xf2\x04`\rw\xf3' (total 16)
        value = Container:
            length = 32
            unknown = 0
            device_id = unhexlify('048df204')
            ts = 2021-01-24 13:36:51
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
DEBUG:miio.miioprotocoliscovered 048df204 with ts: 2021-01-24 13:36:51, token: b'ffffffffffffffffffffffffffffffff'
DEBUG:miio.miioprotocol:192.168.0.162:54321 >>: {'id': 203, 'method': 'get_properties', 'params': [{'did': 'result', 'siid': 2, 'piid': 1}]}
DEBUG:miio.miioprotocol:Retrying with incremented id, retries left: 1
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.miioprotocol:Got a response: Container:
    data = Container:
        data = b'' (total 0)
        value = b'' (total 0)
        offset1 = 32
        offset2 = 32
        length = 0
    header = Container:
        data = b'!1\x00 \x00\x00\x00\x00\x04\x8d\xf2\x04`\rw\xf8' (total 16)
        value = Container:
            length = 32
            unknown = 0
            device_id = unhexlify('048df204')
            ts = 2021-01-24 13:36:56
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
DEBUG:miio.miioprotocoliscovered 048df204 with ts: 2021-01-24 13:36:56, token: b'ffffffffffffffffffffffffffffffff'
DEBUG:miio.miioprotocol:192.168.0.162:54321 >>: {'id': 304, 'method': 'get_properties', 'params': [{'did': 'result', 'siid': 2, 'piid': 1}]}
ERROR:miio.miioprotocol:Got error when receiving: timed out
DEBUG:miio.click_common:Exception: No response from the device
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/miio/miioprotocol.py", line 192, in send
    data, addr = s.recvfrom(1024)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/miio/miioprotocol.py", line 192, in send
    data, addr = s.recvfrom(1024)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/miio/miioprotocol.py", line 192, in send
    data, addr = s.recvfrom(1024)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/miio/miioprotocol.py", line 192, in send
    data, addr = s.recvfrom(1024)
socket.timeout: timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/miio/click_common.py", line 59, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/click_common.py", line 280, in wrap
    kwargs["result"] = func(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/click_common.py", line 245, in command_callback
    return miio_command.call(miio_device, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/click_common.py", line 193, in call
    return method(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/device.py", line 162, in raw_command
    return self.send(command, parameters)
  File "/usr/local/lib/python3.8/site-packages/miio/device.py", line 143, in send
    return self._protocol.send(
  File "/usr/local/lib/python3.8/site-packages/miio/miioprotocol.py", line 232, in send
    return self.send(
  File "/usr/local/lib/python3.8/site-packages/miio/miioprotocol.py", line 232, in send
    return self.send(
  File "/usr/local/lib/python3.8/site-packages/miio/miioprotocol.py", line 232, in send
    return self.send(
  File "/usr/local/lib/python3.8/site-packages/miio/miioprotocol.py", line 240, in send
    raise DeviceException("No response from the device") from ex
miio.exceptions.DeviceException: No response from the device
Error: No response from the device


{
        "type": "urn:miot-spec-v2:device:camera:0000A01C:chuangmi-ipc013:1",
        "description": "Camera",
        "services": [{
                "iid": 1,
                "type": "urn:miot-spec-v2:service:device-information:00007801:chuangmi-ipc013:1",
                "description": "Device Information",
                "properties": [{
                        "iid": 1,
                        "type": "urn:miot-spec-v2:property:manufacturer:00000001:chuangmi-ipc013:1",
                        "description": "Device Manufacturer",
                        "format": "string",
                        "access": ["read"]
                }, {
                        "iid": 2,
                        "type": "urn:miot-spec-v2:property:model:00000002:chuangmi-ipc013:1",
                        "description": "Device Model",
                        "format": "string",
                        "access": ["read"]
                }, {
                        "iid": 3,
                        "type": "urn:miot-spec-v2:property:serial-number:00000003:chuangmi-ipc013:1",
                        "description": "Device Serial Number",
                        "format": "string",
                        "access": ["read"]
                }, {
                        "iid": 4,
                        "type": "urn:miot-spec-v2:property:firmware-revision:00000005:chuangmi-ipc013:1",
                        "description": "Current Firmware Version",
                        "format": "string",
                        "access": ["read"]
                }]
        }, {
                "iid": 2,
                "type": "urn:miot-spec-v2:service:camera-control:0000782F:chuangmi-ipc013:1",
                "description": "Camera Control",
                "properties": [{
                        "iid": 1,
                        "type": "urn:miot-spec-v2:propertyn:00000006:chuangmi-ipc013:1",
                        "description": "Switch Status",
                        "format": "bool",
                        "access": ["read", "write", "notify"]
                }, {
                        "iid": 2,
                        "type": "urn:miot-spec-v2:property:image-rollover:00000058:chuangmi-ipc013:1",
                        "description": "Image Rollover",
                        "format": "uint16",
                        "access": ["read", "write"],
                        "unit": "arcdegrees",
                        "value-range": [0, 180, 180]
                }, {
                        "iid": 3,
                        "type": "urn:miot-spec-v2:property:night-shot:00000057:chuangmi-ipc013:1",
                        "description": "Night Shot",
                        "format": "uint8",
                        "access": ["read", "write"],
                        "value-list": [{
                                "value": 0,
                                "description": "Auto"
                        }, {
                                "value": 1,
                                "description": "Off"
                        }, {
                                "value": 2,
                                "description": "On"
                        }]
                }]
        }, {
                "iid": 3,
                "type": "urn:miot-spec-v2:service:p2p-stream:00007881:chuangmi-ipc013:1",
                "description": "2P Stream",
                "actions": [{
                        "iid": 1,
                        "type": "urn:miot-spec-v2:action:start-p2p-stream:00002839:chuangmi-ipc013:1",
                        "description": "Start P2P Stream",
                        "in": [],
                        "out": []
                }, {
                        "iid": 2,
                        "type": "urn:miot-spec-v2:action:stop-stream:00002822:chuangmi-ipc013:1",
                        "description": "Stop Camera Stream",
                        "in": [],
                        "out": []
                }]
        }]
}

Model: chuangmi.camera.ipc013
不支持我的米家小白青春版摄像头,这个摄像头一直无解。希望楼主能支持,谢谢!
作者: anlong    时间: 2021-1-25 01:12
tiger81 发表于 2021-1-24 21:39
INFO:miio.cliebug mode active
Running command raw_command
DEBUG:miio.protocol:Unable to decrypt, r ...

不是有spec_type就一定支持miot-spec。或者也有可能python-miio不知道你的miot设备
作者: blobman    时间: 2021-1-25 11:02
本帖最后由 blobman 于 2021-1-25 11:23 编辑

实体注册成功了,但是现实不可用


Logger: custom_components.xiaomi_miot
Source: custom_components/xiaomi_miot/__init__.py:343
Integration: Xiaomi Miot (documentation, issues)
First occurred: 上午9:51:04 (71 occurrences)
Last logged: 上午10:26:05

Got exception while fetching the state for None: Unable to recover failed command
Got exception while fetching the state for switch.ke_ting_tai_deng_chuangmi_plug_m3_switch: Unable to recover failed command


提了个issue:https://github.com/al-one/hass-xiaomi-miot/issues/6
作者: wjh1036    时间: 2021-1-25 11:58
小米空调C1可以加入实体,显示不用
xiaomi.aircondition.ma2


Logger: custom_components.xiaomi_miot
Source: custom_components/xiaomi_miot/__init__.py:343
Integration: Xiaomi Miot (documentation, issues)
First occurred: 上午11:23:46 (101 occurrences)
Last logged: 上午11:56:56

Got exception while fetching the state for None: {'code': -9999, 'message': 'user ack timeout'}
Got exception while fetching the state for sensor.xiaomi_miot_environment: {'code': -9999, 'message': 'user ack timeout'}
Got exception while fetching the state for climate.xiaomi_miot_air_conditioner: {'code': -9999, 'message': 'user ack timeout'}
作者: anlong    时间: 2021-1-25 12:03
wjh1036 发表于 2021-1-25 11:58
小米空调C1可以加入实体,显示不用
xiaomi.aircondition.ma2

这个问题未知,xiaomi_miot_raw用米家接口解决了,后面我可能也会借鉴下
作者: xztxy    时间: 2021-1-25 14:12
本帖最后由 xztxy 于 2021-1-25 14:15 编辑

云米的空调识别后只显示一个温度!!怎么整~!以前的版本可以的。。。只有这样的~~
[attach]27388[/attach]

作者: caoxi1988    时间: 2021-1-25 14:13
小米MIoT设备自动识别接入HA插件
作者: sunshine    时间: 2021-1-25 14:26
回去试试米家电饭煲能不能用
作者: xztxy    时间: 2021-1-25 14:27
大佬~~电饭煲也不行。。~~
[attach]27389[/attach]
都是型号可以识别~~但是不能用

作者: xztxy    时间: 2021-1-25 14:32
本帖最后由 xztxy 于 2021-1-25 14:34 编辑

大佬好迅速。。。空调已经修复了~!!赞~!!!~
作者: anlong    时间: 2021-1-25 14:36
xztxy 发表于 2021-1-25 14:12
云米的空调识别后只显示一个温度!!怎么整~!以前的版本可以的。。。只有这样的~~

...

下载最新的重试下
作者: roaidy    时间: 2021-1-25 14:39
学习学习,谢谢分享
作者: xztxy    时间: 2021-1-25 14:43
anlong 发表于 2021-1-25 14:36
下载最新的重试下

嗯,空调可以了~感谢大佬~!请问下这个灯是不支持吗~~[attach]27393[/attach]

作者: anlong    时间: 2021-1-25 15:01
xztxy 发表于 2021-1-25 14:27
大佬~~电饭煲也不行。。~~

都是型号可以识别~~但是不能用

看下日志
作者: qiaoqiao1235    时间: 2021-1-25 19:53
米家智能晾衣架的状态有点奇怪……到最顶显示是开着……放下来显示关着
作者: MX10085    时间: 2021-1-25 21:44
   NAME:  管线机
   MODEL: yunmi.plmachine.mg2
   ---------
   NAME:  净水器
   MODEL: yunmi.waterpuri.lx8
   ---------
   NAME:  viomi Alpha 1A
   MODEL: viomi.vacuum.v17


测试了一下,前两个显示 -4004 ,算了,不折腾。

后一个扫地机测试时显示:
raise DeviceException("No response from the device") from ex
miio.exceptions.DeviceException: No response from the device
Error: No response from the device

但加了没实体,应该还没有支持?
作者: 郑凯强    时间: 2021-1-25 22:11
有把摄像头加进去的吗 我家就一个摄像头一个加湿器,加湿器直接显示999 摄像头加进去无实体,,,
作者: skika    时间: 2021-1-26 02:53
philips.light.cbulb 能支持调色吗?现在只能开关调亮度
作者: anlong    时间: 2021-1-26 10:49
skika 发表于 2021-1-26 02:53
philips.light.cbulb 能支持调色吗?现在只能开关调亮度

调色近期支持
作者: 115290    时间: 2021-1-26 12:45
MODEL: hyd.airer.znlyj1晾衣架只能升,下降按钮灰色,无法控制
MODEL: syniot.curtain.syc1这个窗帘,有出实体,但是无法控制
作者: lengxiaocai    时间: 2021-1-26 16:50
米家洗烘一体机支持吗
作者: anlong    时间: 2021-1-26 23:48
本帖最后由 anlong 于 2021-2-22 15:53 编辑
lengxiaocai 发表于 2021-1-26 16:50
米家洗烘一体机支持吗

v0.2.3开始已经支持

作者: 27hh    时间: 2021-1-26 23:52
skika 发表于 2021-1-26 02:53
philips.light.cbulb 能支持调色吗?现在只能开关调亮度

之前是你在我的帖子里要求调色的吗,我的那个现在支持调色了
作者: skika    时间: 2021-1-26 23:57
27hh 发表于 2021-1-26 23:52
之前是你在我的帖子里要求调色的吗,我的那个现在支持调色了

是的,还是不行,我贴了错误信息上去
作者: nut    时间: 2021-1-27 10:16
大佬,我的linp开关能出现设备和实体,但是有个问题是,我的开关是三键的,他只出现一个实体(只有一个按键)。这个要怎么处理啊?
作者: ny3933    时间: 2021-1-27 11:30
智米空调
可以添加并识别型号,但是显示不可用,是不是不支持这个型号



作者: wuqiyu007    时间: 2021-1-27 11:50
PTX那个三键开关,可以找到,不能控制,不能显示状态
作者: ny3933    时间: 2021-1-27 13:57
wuqiyu007 发表于 2021-1-27 11:50
PTX那个三键开关,可以找到,不能控制,不能显示状态

平头熊可以用这个https://github.com/volshebniks/xiaomi_mijia_ptx
作者: wuqiyu007    时间: 2021-1-27 15:22
ny3933 发表于 2021-1-27 13:57
平头熊可以用这个https://github.com/volshebniks/xiaomi_mijia_ptx

太感谢了,马上去试试
作者: wuqiyu007    时间: 2021-1-27 16:09
ny3933 发表于 2021-1-27 13:57
平头熊可以用这个https://github.com/volshebniks/xiaomi_mijia_ptx

已经试了,可以识别控制,太感谢了
作者: dcy411075564    时间: 2021-1-28 16:04
蓝牙网关插座支 持吗
作者: anlong    时间: 2021-1-28 23:17
nut 发表于 2021-1-27 10:16
大佬,我的linp开关能出现设备和实体,但是有个问题是,我的开关是三键的,他只出现一个实体(只有一个按键 ...

设备型号多少
作者: anlong    时间: 2021-1-28 23:20
dcy411075564 发表于 2021-1-28 16:04
蓝牙网关插座支 持吗

请自行使用miiocli测试
作者: goldstep    时间: 2021-1-29 14:26
haowei 发表于 2021-1-22 20:39
搜不到集成怎么办

本地浏览器缓存清理一下
作者: anlong    时间: 2021-1-29 14:39
nut 发表于 2021-1-27 10:16
大佬,我的linp开关能出现设备和实体,但是有个问题是,我的开关是三键的,他只出现一个实体(只有一个按键 ...

下载最新master分支再试下
作者: nut    时间: 2021-1-30 21:15
anlong 发表于 2021-1-29 14:39
下载最新master分支再试下

还是不行,只有一个实体
作者: syzylj    时间: 2021-1-30 22:46
很牛逼的插件
作者: foxwywh    时间: 2021-1-30 22:57
本帖最后由 foxwywh 于 2021-1-30 23:00 编辑

[attach]27595[/attach]这艾灸盒有开关和灯,本是开开关灯也会亮,但系统识别成灯(云端),没法打开

作者: qq1838051    时间: 2021-1-30 23:58
QQ交流群:198841186
加不进去啊!!!告诉我答案

作者: qq1838051    时间: 2021-1-31 00:00

--2021-01-30 23:58:11--  (try: 3)  https://github.com/al-one/hass-xiaomi-miot/archive/auto-miot.zip
Connecting to github.com|66.249.89.104|:443...


链接超时,如何治?????坐等高手
作者: jackkii    时间: 2021-1-31 09:34
完美接入, 一个字:厉害!!
作者: anlong    时间: 2021-1-31 22:20
qq1838051 发表于 2021-1-30 23:58
QQ交流群:198841186
加不进去啊!!!告诉我答案

答案是al-one
作者: machiyu01    时间: 2021-2-1 10:40
大佬你好!
     使用al-one/hass-xiaomi-miot添加邦先生M1晾衣架后,发现实体错误。(我可以把这个设备共享给你)使用mihome 操作日志如下:
192.168.10.140
mrbond.airer.m1s
1c083a1de6379ca4e22a85b7daae780a

2021-02-01 10:32:44 -> {"id":7271,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:32:44 <- {"code":0,"exe_time":520,"id":7271,"net_cost":474,"ot_cost":955,"otlocalts":1612146765057881,"result":["0","0","0","000","1"]}
2021-02-01 10:32:48 -> {"id":7272,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:32:48 <- {"code":0,"exe_time":410,"id":7272,"net_cost":588,"ot_cost":1125,"otlocalts":1612146769100645,"result":["0","0","0","000","1"]}
2021-02-01 10:32:49 -> {"id":7273,"method":"set_led","params":[1]}
2021-02-01 10:32:49 <- {"code":0,"exe_time":360,"id":7273,"net_cost":140,"ot_cost":833,"otlocalts":1612146769475182,"result":["ok"]}
2021-02-01 10:32:52 -> {"id":7274,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:32:52 <- {"code":0,"exe_time":420,"id":7274,"net_cost":182,"ot_cost":1432,"otlocalts":1612146772732296,"result":["0","1","0","000","1"]}
2021-02-01 10:32:56 -> {"id":7275,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:32:56 <- {"code":0,"exe_time":510,"id":7275,"net_cost":119,"ot_cost":1733,"otlocalts":1612146776792256,"result":["0","1","0","000","1"]}
2021-02-01 10:32:58 -> {"id":7276,"method":"set_led","params":[0]}
2021-02-01 10:32:58 <- {"code":0,"exe_time":250,"id":7276,"net_cost":678,"ot_cost":1363,"otlocalts":1612146779174824,"result":["ok"]}
2021-02-01 10:33:00 -> {"id":7277,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:33:00 <- {"code":0,"exe_time":310,"id":7277,"net_cost":260,"ot_cost":2637,"otlocalts":1612146780772395,"result":["0","0","0","000","1"]}
2021-02-01 10:33:03 -> {"id":8549,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:33:03 <- {"code":0,"exe_time":870,"id":8549,"net_cost":154,"ot_cost":1909,"otlocalts":1612146783280803,"result":["0","0","0","000","1"]}
2021-02-01 10:33:06 -> {"id":8550,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:33:06 <- {"code":0,"exe_time":360,"id":8550,"net_cost":187,"ot_cost":2021,"otlocalts":1612146786871679,"result":["0","0","0","000","1"]}
2021-02-01 10:33:08 -> {"id":8551,"method":"set_motor","params":[2]}
2021-02-01 10:33:08 <- {"code":0,"exe_time":880,"id":8551,"net_cost":84,"ot_cost":2518,"otlocalts":1612146788452501,"result":["ok"]}
2021-02-01 10:33:11 -> {"id":8552,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:33:11 <- {"code":0,"exe_time":970,"id":8552,"net_cost":139,"ot_cost":1088,"otlocalts":1612146791375913,"result":["0","0","2","000","0"]}
2021-02-01 10:33:14 -> {"id":8553,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:33:14 <- {"code":0,"exe_time":570,"id":8553,"net_cost":83,"ot_cost":3053,"otlocalts":1612146794954063,"result":["0","0","2","000","0"]}
2021-02-01 10:33:19 -> {"id":8554,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:33:19 <- {"code":0,"exe_time":870,"id":8554,"net_cost":256,"ot_cost":1621,"otlocalts":1612146799458881,"result":["0","0","2","000","0"]}
2021-02-01 10:33:22 -> {"id":8555,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:33:22 <- {"code":0,"exe_time":120,"id":8555,"net_cost":557,"ot_cost":2513,"otlocalts":1612146803046007,"result":["0","0","2","000","0"]}
2021-02-01 10:33:27 -> {"id":8556,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:33:27 <- {"code":0,"exe_time":660,"id":8556,"net_cost":499,"ot_cost":1723,"otlocalts":1612146807558262,"result":["0","0","2","000","0"]}
2021-02-01 10:33:30 -> {"id":8557,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:33:30 <- {"code":0,"exe_time":180,"id":8557,"net_cost":138,"ot_cost":2044,"otlocalts":1612146810750321,"result":["0","0","2","000","0"]}
2021-02-01 10:33:36 -> {"id":8558,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:33:36 <- {"code":0,"exe_time":1680,"id":8558,"net_cost":315,"ot_cost":2054,"otlocalts":1612146816460908,"result":["0","0","0","000","2"]}
2021-02-01 10:33:39 -> {"id":8559,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:33:39 <- {"code":0,"exe_time":170,"id":8559,"net_cost":583,"ot_cost":2850,"otlocalts":1612146819252071,"result":["0","0","0","000","2"]}
2021-02-01 10:33:42 -> {"id":8560,"method":"set_motor","params":[1]}
2021-02-01 10:33:42 <- {"code":0,"exe_time":390,"id":8560,"net_cost":324,"ot_cost":1763,"otlocalts":1612146822819475,"result":["ok"]}
2021-02-01 10:33:43 -> {"id":8561,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:33:43 <- {"code":0,"exe_time":1390,"id":8561,"net_cost":113,"ot_cost":2055,"otlocalts":1612146824035813,"result":["0","0","1","000","0"]}
2021-02-01 10:33:47 -> {"id":8562,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:33:47 <- {"code":0,"exe_time":370,"id":8562,"net_cost":303,"ot_cost":1586,"otlocalts":1612146827239868,"result":["0","0","1","000","0"]}
2021-02-01 10:33:51 -> {"id":8563,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:33:51 <- {"code":0,"exe_time":680,"id":8563,"net_cost":443,"ot_cost":2197,"otlocalts":1612146831723397,"result":["0","0","1","000","0"]}
2021-02-01 10:33:55 -> {"id":8564,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:33:55 <- {"code":0,"exe_time":370,"id":8564,"net_cost":325,"ot_cost":3208,"otlocalts":1612146835331143,"result":["0","0","1","000","0"]}
2021-02-01 10:33:56 -> {"id":8565,"method":"set_motor","params":[0]}
2021-02-01 10:33:56 <- {"code":0,"exe_time":440,"id":8565,"net_cost":97,"ot_cost":2228,"otlocalts":1612146836910857,"result":["ok"]}
2021-02-01 10:33:59 -> {"id":8566,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:33:59 <- {"code":0,"exe_time":990,"id":8566,"net_cost":173,"ot_cost":1444,"otlocalts":1612146839827436,"result":["0","0","0","000","0"]}
2021-02-01 10:34:03 -> {"id":8567,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:34:03 <- {"code":0,"exe_time":490,"id":8567,"net_cost":213,"ot_cost":2197,"otlocalts":1612146843402763,"result":["0","0","0","000","0"]}
2021-02-01 10:34:03 -> {"id":8568,"method":"set_motor","params":[1]}
2021-02-01 10:34:03 <- {"code":0,"exe_time":840,"id":8568,"net_cost":183,"ot_cost":1236,"otlocalts":1612146843832016,"result":["ok"]}
2021-02-01 10:34:07 -> {"id":8569,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:34:07 <- {"code":0,"exe_time":990,"id":8569,"net_cost":184,"ot_cost":2429,"otlocalts":1612146847907998,"result":["0","0","1","000","0"]}
2021-02-01 10:34:10 -> {"id":8570,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:34:10 <- {"code":0,"exe_time":190,"id":8570,"net_cost":135,"ot_cost":1399,"otlocalts":1612146851091949,"result":["0","0","1","000","0"]}
2021-02-01 10:34:15 -> {"id":8571,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:34:15 <- {"code":0,"exe_time":1090,"id":8571,"net_cost":117,"ot_cost":3259,"otlocalts":1612146856013606,"result":["0","0","1","000","0"]}
2021-02-01 10:34:18 -> {"id":8572,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:34:18 <- {"code":0,"exe_time":290,"id":8572,"net_cost":60,"ot_cost":1146,"otlocalts":1612146859181975,"result":["0","0","0","000","1"]}
2021-02-01 10:34:23 -> {"id":8573,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:34:23 <- {"code":0,"exe_time":870,"id":8573,"net_cost":331,"ot_cost":2047,"otlocalts":1612146864079409,"result":["0","0","0","000","1"]}
2021-02-01 10:34:27 -> {"id":8574,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:34:27 <- {"code":0,"exe_time":690,"id":8574,"net_cost":133,"ot_cost":2176,"otlocalts":1612146867692829,"result":["0","0","0","000","1"]}
2021-02-01 10:34:31 -> {"id":8575,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:34:31 <- {"code":0,"exe_time":200,"id":8575,"net_cost":168,"ot_cost":2306,"otlocalts":1612146871271231,"result":["0","0","0","000","1"]}
2021-02-01 10:34:35 -> {"id":8576,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:34:35 <- {"code":0,"exe_time":490,"id":8576,"net_cost":343,"ot_cost":2192,"otlocalts":1612146875766069,"result":["0","0","0","000","1"]}
2021-02-01 10:34:40 -> {"id":8577,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:34:40 <- {"code":0,"exe_time":1160,"id":8577,"net_cost":123,"ot_cost":1752,"otlocalts":1612146880261138,"result":["0","0","0","000","1"]}
2021-02-01 10:34:43 -> {"id":8578,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:34:43 <- {"code":0,"exe_time":310,"id":8578,"net_cost":143,"ot_cost":2532,"otlocalts":1612146883457804,"result":["0","0","0","000","1"]}
2021-02-01 10:34:48 -> {"id":8579,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:34:48 <- {"code":0,"exe_time":1000,"id":8579,"net_cost":400,"ot_cost":2338,"otlocalts":1612146888433916,"result":["0","0","0","000","1"]}
2021-02-01 10:34:51 -> {"id":8580,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:34:51 <- {"code":0,"exe_time":350,"id":8580,"net_cost":533,"ot_cost":3229,"otlocalts":1612146891952915,"result":["0","0","0","000","1"]}
2021-02-01 10:34:55 -> {"id":8581,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:34:55 <- {"code":0,"exe_time":310,"id":8581,"net_cost":139,"ot_cost":1172,"otlocalts":1612146895547381,"result":["0","0","0","000","1"]}
2021-02-01 10:34:59 -> {"id":8582,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:34:59 <- {"code":0,"exe_time":410,"id":8582,"net_cost":99,"ot_cost":1692,"otlocalts":1612146899640939,"result":["0","0","0","000","1"]}
2021-02-01 10:35:04 -> {"id":8583,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:35:04 <- {"code":0,"exe_time":1000,"id":8583,"net_cost":378,"ot_cost":2074,"otlocalts":1612146904552278,"result":["0","0","0","000","1"]}
2021-02-01 10:35:07 -> {"id":8584,"method":"get_prop","params":["dry","led","motor","drytime","airer_location"]}
2021-02-01 10:35:07 <- {"code":0,"exe_time":410,"id":8584,"net_cost":158,"ot_cost":2506,"otlocalts":1612146907784484,"result":["0","0","0","000","1"]}

作者: machiyu01    时间: 2021-2-1 10:57
machiyu01 发表于 2021-2-1 10:40
大佬你好!
     使用al-one/hass-xiaomi-miot添加邦先生M1晾衣架后,发现实体错误。(我可以把这个设备共 ...

bash-5.0# miiocli -d device --ip 192.168.10.140 --token 1c083a1de6379ca4e22a85b7daae780a raw_command get_properties "[{'did': 'result', 'siid': 2, 'piid': 1}]"
INFO:miio.cliebug mode active
Running command raw_command
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.miioprotocol:Got a response: Container:
    data = Container:
        data = b'' (total 0)
        value = b'' (total 0)
        offset1 = 32
        offset2 = 32
        length = 0
    header = Container:
        data = b'!1\x00 \x00\x00\x00\x00\x14\x02\x808\x00\x01\n\xdc' (total 16)
        value = Container:
            length = 32
            unknown = 0
            device_id = unhexlify('14028038')
            ts = 1970-01-01 18:58:36
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
DEBUG:miio.miioprotocoliscovered 14028038 with ts: 1970-01-01 18:58:36, token: b'ffffffffffffffffffffffffffffffff'
DEBUG:miio.miioprotocol:192.168.10.140:54321 >>: {'id': 1, 'method': 'get_properties', 'params': [{'did': 'result', 'siid': 2, 'piid': 1}]}
DEBUG:miio.miioprotocol:192.168.10.140:54321 (ts: 1970-01-01 18:58:41, id: 1) << {'id': 1, 'error': {'code': -9999, 'message': 'user ack timeout'}, 'exe_time': 4010}
DEBUG:miio.click_common:Exception: {'code': -9999, 'message': 'user ack timeout'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/miio/click_common.py", line 59, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/click_common.py", line 280, in wrap
    kwargs["result"] = func(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/click_common.py", line 245, in command_callback
    return miio_command.call(miio_device, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/click_common.py", line 193, in call
    return method(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/device.py", line 162, in raw_command
    return self.send(command, parameters)
  File "/usr/local/lib/python3.8/site-packages/miio/device.py", line 143, in send
    return self._protocol.send(
  File "/usr/local/lib/python3.8/site-packages/miio/miioprotocol.py", line 213, in send
    self._handle_error(payload["error"])
  File "/usr/local/lib/python3.8/site-packages/miio/miioprotocol.py", line 273, in _handle_error
    raise DeviceError(error)
miio.exceptions.DeviceError: {'code': -9999, 'message': 'user ack timeout'}
Error: {'code': -9999, 'message': 'user ack timeout'}
作者: sdfd    时间: 2021-2-1 14:02
太赞了,必须支持下
作者: anlong    时间: 2021-2-1 22:58
machiyu01 发表于 2021-2-1 10:40
大佬你好!
     使用al-one/hass-xiaomi-miot添加邦先生M1晾衣架后,发现实体错误。(我可以把这个设备共 ...

最新版已修复
作者: ljq910329    时间: 2021-2-3 12:20
我输入小爱同学的IP和token,显示无法连接,请问大佬要怎么搞呢

作者: ljq910329    时间: 2021-2-3 12:25
evaz 发表于 2021-1-23 23:13
厉害了
我用的斐讯N1 ,wrt 装docker---hassio  ,执行完命令后重启添加没有出现MloT
...

通过HACS安装插件,安装后重启HA,依次进入:配置 > 集成 > +添加集成,搜索“Xiaomi Miot”,配置你的设备信息
我跟你情况一样,就是通过这个方法安装的,没问题的
作者: anlong    时间: 2021-2-3 13:44
ljq910329 发表于 2021-2-3 12:20
我输入小爱同学的IP和token,显示无法连接,请问大佬要怎么搞呢

部分小爱可能无法通过局域网访问,因此无法接入。
可以通过miiocli测试下。
  1. miiocli -d device --ip 192.168.lan.ip --token xxxxxx info
复制代码

作者: gosrak    时间: 2021-2-5 01:01
石头扫地机器人T6可以吗?
作者: anlong    时间: 2021-2-5 10:43
gosrak 发表于 2021-2-5 01:01
石头扫地机器人T6可以吗?

扫地机暂时没有适配。不过你可以留下的设备型号
作者: anlong    时间: 2021-2-22 22:07
gosrak 发表于 2021-2-5 01:01
石头扫地机器人T6可以吗?

master分支最新版本支持扫地机了,但是不支持划区和定点清扫
作者: meiwenapp    时间: 2021-2-26 15:08
fter opening telnet, it is better to install custom firmware.
作者: yt16301    时间: 2021-3-1 21:05
小米石头扫地机T7 PRO接入 不了
model: roborock.vacuum.a09




欢迎光临 『瀚思彼岸』» 智能家居技术论坛 (https://bbs.hassbian.com/) Powered by Discuz! X3.5