Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加小沐马桶盖后没有生成任何实体和设备 #218

Closed
luckystarwy opened this issue Oct 23, 2021 · 22 comments
Closed

添加小沐马桶盖后没有生成任何实体和设备 #218

luckystarwy opened this issue Oct 23, 2021 · 22 comments
Labels
device: toilet enhancement New feature or request

Comments

@luckystarwy
Copy link

型号是这个:tinymu.toiletlid.v1,添加后没有生成设备和实体,通过您README.md中支持设备列表查询了相关的型号,tinymu.toiletlid.v1是在列表里的,劳烦大神关心一下,主要是检测是否有人入座使用的判断,谢谢大神的项目

@al-one
Copy link
Owner

al-one commented Oct 23, 2021

目前本插件对马桶盖的支持依赖miot协议中的toilet服务,而该设备tinymu.toiletlid.v1miot-spec规格定义中无该服务,仅有filterseat服务。
后续版本我会适配该设备,请等待。

@al-one al-one added the enhancement New feature or request label Oct 27, 2021
@al-one
Copy link
Owner

al-one commented Oct 27, 2021

最新的提交:443ba2b 已支持该型号的马桶盖,请更新到master分支后尝试。

@luckystarwy
Copy link
Author

谢谢大神如此重视,刚刚更新了插件,在列表中选取设备后,还是老样子,没有实体和设备生成

@al-one
Copy link
Owner

al-one commented Oct 28, 2021

请检查下有无相关日志

@luckystarwy
Copy link
Author

我看了下就一条是和马桶盖相关的。。。不管怎样先全贴出来吧
2021-10-28 16:46:47 DEBUG (SyncWorker_4) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: user/get_user_device_data {'did': '1', 'key': 'check_auth', 'type': 'prop', 'time_start': 1634806006, 'time_end': 1635410866, 'limit': 5} result: {"code":-8,"message":"device unkown","result":""}
2021-10-28 16:46:47 INFO (SyncWorker_4) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: user/get_user_device_data {'did': '1', 'key': 'check_auth', 'type': 'prop', 'time_start': 1634806006, 'time_end': 1635410866, 'limit': 5} failed, result: {"code":-8,"message":"device unkown","result":""}
2021-10-28 16:46:47 DEBUG (MainThread) [custom_components.xiaomi_miot] Setup xiaomi cloud for user: XXXXXXXXXXX, 3 devices
2021-10-28 16:46:48 DEBUG (MainThread) [custom_components.xiaomi_miot] Xiaomi cloud device: {'name': '净水器', 'host': '192.168.2.32', 'token': '', 'model': 'yunmi.waterpuri.lx6', 'miot_did': '103450875', 'miot_type': 'urn:miot-spec-v2:device:water-purifier:0000A013:yunmi-lx6:1', 'miio_info': {'ap': {'ssid': 'xxx', 'bssid': 'xx:xx:xx:xx:xx:xx', 'rssi': -62}, 'netif': {'localIp': '192.168.2.32', 'gw': '', 'mask': ''}, 'fw_ver': '2.1.3', 'hw_ver': '', 'mac': '7C:49:EB:D5:CF:AE', 'model': 'yunmi.waterpuri.lx6', 'token': 'fac49ddfc2d220a7526c66d587cd3599'}, 'conn_mode': 'auto', 'miot_cloud': True, 'entry_id': '6734c157b3307e5abc37e0c939ea80b5', 'config_version': 0.2}
2021-10-28 16:46:48 DEBUG (MainThread) [custom_components.xiaomi_miot] Xiaomi cloud device: {'name': 'LETSLEEP water heated blanket‘HS2205’', 'host': '192.168.2.95', 'token': '
', 'model': 'isleep.blanket.hs2205', 'miot_did': '427357267', 'miot_type': 'urn:miot-spec-v2:device:electric-blanket:0000A069:isleep-hs2205:1', 'miio_info': {'ap': {'ssid': 'xxx', 'bssid': 'xx:xx:xx:xx:xx:xx', 'rssi': -60}, 'netif': {'localIp': '192.168.2.95', 'gw': '', 'mask': ''}, 'fw_ver': '2.0.5', 'hw_ver': '', 'mac': '58:B6:23:D7:F6:E8', 'model': 'isleep.blanket.hs2205', 'token': '429cefce6228e6b7bef41eadda3d4cd1'}, 'conn_mode': 'auto', 'miot_cloud': True, 'entry_id': '6734c157b3307e5abc37e0c939ea80b5', 'config_version': 0.2}
2021-10-28 16:46:49 DEBUG (MainThread) [custom_components.xiaomi_miot] Xiaomi cloud device: {'name': '马桶盖', 'host': '192.168.2.19', 'token': '****', 'model': 'tinymu.toiletlid.v1', 'miot_did': '84124131', 'miot_type': 'urn:miot-spec-v2:device:toilet:0000A02E:tinymu-v1:1', 'miio_info': {'ap': {'ssid': 'xxx', 'bssid': 'xx:xx:xx:xx:xx:xx', 'rssi': -61}, 'netif': {'localIp': '192.168.2.19', 'gw': '', 'mask': ''}, 'fw_ver': '1.6.7_0107', 'hw_ver': '', 'mac': '78:11:DC:FE:E4:C5', 'model': 'tinymu.toiletlid.v1', 'token': '067a4b2071a03d9ec993a55ea7112211'}, 'conn_mode': 'auto', 'miot_cloud': True, 'entry_id': '6734c157b3307e5abc37e0c939ea80b5', 'config_version': 0.2}
2021-10-28 16:46:50 INFO (MainThread) [custom_components.xiaomi_miot.sensor] 净水器 Water Purifier: Initializing miot device with mapping: {'water_purifier.status': {'siid': 2, 'piid': 1}, 'filter-7.filter_used_time': {'siid': 7, 'piid': 1}, 'filter-7.filter_used_flow': {'siid': 7, 'piid': 2}, 'filter-6.filter_used_time': {'siid': 6, 'piid': 1}, 'filter-6.filter_used_flow': {'siid': 6, 'piid': 2}, 'filter-5.filter_used_time': {'siid': 5, 'piid': 1}, 'filter-5.filter_used_flow': {'siid': 5, 'piid': 2}, 'tds_sensor.tds_in': {'siid': 4, 'piid': 1}, 'tds_sensor.tds_out': {'siid': 4, 'piid': 2}, 'filter.filter_used_time': {'siid': 3, 'piid': 1}, 'filter.filter_used_flow': {'siid': 3, 'piid': 2}}
2021-10-28 16:46:51 INFO (MainThread) [custom_components.xiaomi_miot.climate] LETSLEEP water heated blanket‘HS2205’ Electric Blanket: Initializing miot device with mapping: {'electric_blanket.on': {'siid': 2, 'piid': 1}, 'electric_blanket.fault': {'siid': 2, 'piid': 2}, 'electric_blanket.mode': {'siid': 2, 'piid': 3}, 'target_temperature-2-5': {'siid': 2, 'piid': 5}, 'electric_blanket.temperature': {'siid': 2, 'piid': 6}, 'electric_blanket.water_level': {'siid': 2, 'piid': 8}, 'custom.low_temperature': {'siid': 4, 'piid': 1}, 'custom.screen_switch': {'siid': 4, 'piid': 2}, 'custom.key_tone': {'siid': 4, 'piid': 3}, 'custom.automatic_shutdown': {'siid': 4, 'piid': 4}, 'custom.sleep_level': {'siid': 4, 'piid': 5}, 'custom.fast_heating': {'siid': 4, 'piid': 6}, 'countdown.countdown_time': {'siid': 5, 'piid': 1}, 'physical_controls_locked': {'siid': 3, 'piid': 1}}
2021-10-28 16:46:51 DEBUG (SyncWorker_7) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '103450875', 'siid': 2, 'piid': 1}, {'did': '103450875', 'siid': 7, 'piid': 1}, {'did': '103450875', 'siid': 7, 'piid': 2}, {'did': '103450875', 'siid': 6, 'piid': 1}, {'did': '103450875', 'siid': 6, 'piid': 2}, {'did': '103450875', 'siid': 5, 'piid': 1}, {'did': '103450875', 'siid': 5, 'piid': 2}, {'did': '103450875', 'siid': 4, 'piid': 1}, {'did': '103450875', 'siid': 4, 'piid': 2}, {'did': '103450875', 'siid': 3, 'piid': 1}, {'did': '103450875', 'siid': 3, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"103450875","siid":2,"piid":1,"value":1,"code":0,"updateTime":1635321165},{"did":"103450875","siid":7,"piid":1,"value":1920,"code":0,"updateTime":1635410811},{"did":"103450875","siid":7,"piid":2,"value":350,"code":0,"updateTime":1635410811},{"did":"103450875","siid":6,"piid":1,"value":1920,"code":0,"updateTime":1635410811},{"did":"103450875","siid":6,"piid":2,"value":350,"code":0,"updateTime":1635410811},{"did":"103450875","siid":5,"piid":1,"value":1980,"code":0,"updateTime":1635410811},{"did":"103450875","siid":5,"piid":2,"value":630,"code":0,"updateTime":1635410811},{"did":"103450875","siid":4,"piid":1,"value":171,"code":0,"updateTime":1635321164},{"did":"103450875","siid":4,"piid":2,"value":60,"code":0,"updateTime":1635321164},{"did":"103450875","siid":3,"piid":1,"value":1920,"code":0,"updateTime":1635410811},{"did":"103450875","siid":3,"piid":2,"value":630,"code":0,"updateTime":1635410811}]}
2021-10-28 16:46:51 DEBUG (MainThread) [custom_components.xiaomi_miot.sensor] 净水器 Water Purifier Status: Got new state: {'water_purifier.status': 1, 'filter-7.filter_used_time': 1920, 'filter-7.filter_used_flow': 350, 'filter-6.filter_used_time': 1920, 'filter-6.filter_used_flow': 350, 'filter-5.filter_used_time': 1980, 'filter-5.filter_used_flow': 630, 'tds_sensor.tds_in': 171, 'tds_sensor.tds_out': 60, 'filter.filter_used_time': 1920, 'filter.filter_used_flow': 630, 'state_updater': 'cloud'}
2021-10-28 16:46:51 DEBUG (SyncWorker_9) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '427357267', 'siid': 2, 'piid': 1}, {'did': '427357267', 'siid': 2, 'piid': 2}, {'did': '427357267', 'siid': 2, 'piid': 3}, {'did': '427357267', 'siid': 2, 'piid': 5}, {'did': '427357267', 'siid': 2, 'piid': 6}, {'did': '427357267', 'siid': 2, 'piid': 8}, {'did': '427357267', 'siid': 4, 'piid': 1}, {'did': '427357267', 'siid': 4, 'piid': 2}, {'did': '427357267', 'siid': 4, 'piid': 3}, {'did': '427357267', 'siid': 4, 'piid': 4}, {'did': '427357267', 'siid': 4, 'piid': 5}, {'did': '427357267', 'siid': 4, 'piid': 6}, {'did': '427357267', 'siid': 5, 'piid': 1}, {'did': '427357267', 'siid': 3, 'piid': 1}]} result: {"code":0,"message":"","result":[{"did":"427357267","siid":2,"piid":1,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":2,"piid":2,"value":0,"code":0,"updateTime":1635207916},{"did":"427357267","siid":2,"piid":3,"value":0,"code":0,"updateTime":1635207916},{"did":"427357267","siid":2,"piid":5,"value":45,"code":0,"updateTime":1635207916},{"did":"427357267","siid":2,"piid":6,"value":16,"code":0,"updateTime":1635410406},{"did":"427357267","siid":2,"piid":8,"value":1,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":1,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":2,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":3,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":4,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":5,"value":0,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":6,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":5,"piid":1,"value":0,"code":0,"updateTime":1635207916},{"did":"427357267","siid":3,"piid":1,"value":false,"code":0,"updateTime":1635207916}]}
2021-10-28 16:46:51 DEBUG (MainThread) [custom_components.xiaomi_miot.climate] LETSLEEP water heated blanket‘HS2205’ Electric Blanket: Got new state: {'electric_blanket.on': False, 'electric_blanket.fault': 0, 'electric_blanket.mode': 0, 'target_temperature-2-5': 45, 'electric_blanket.temperature': 16, 'electric_blanket.water_level': 1, 'custom.low_temperature': False, 'custom.screen_switch': False, 'custom.key_tone': False, 'custom.automatic_shutdown': False, 'custom.sleep_level': 0, 'custom.fast_heating': False, 'countdown.countdown_time': 0, 'physical_controls_locked': False, 'state_updater': 'cloud'}
2021-10-28 16:47:22 DEBUG (SyncWorker_1) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '103450875', 'siid': 2, 'piid': 1}, {'did': '103450875', 'siid': 7, 'piid': 1}, {'did': '103450875', 'siid': 7, 'piid': 2}, {'did': '103450875', 'siid': 6, 'piid': 1}, {'did': '103450875', 'siid': 6, 'piid': 2}, {'did': '103450875', 'siid': 5, 'piid': 1}, {'did': '103450875', 'siid': 5, 'piid': 2}, {'did': '103450875', 'siid': 4, 'piid': 1}, {'did': '103450875', 'siid': 4, 'piid': 2}, {'did': '103450875', 'siid': 3, 'piid': 1}, {'did': '103450875', 'siid': 3, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"103450875","siid":2,"piid":1,"value":1,"code":0,"updateTime":1635321165},{"did":"103450875","siid":7,"piid":1,"value":1920,"code":0,"updateTime":1635410842},{"did":"103450875","siid":7,"piid":2,"value":350,"code":0,"updateTime":1635410842},{"did":"103450875","siid":6,"piid":1,"value":1920,"code":0,"updateTime":1635410842},{"did":"103450875","siid":6,"piid":2,"value":350,"code":0,"updateTime":1635410842},{"did":"103450875","siid":5,"piid":1,"value":1980,"code":0,"updateTime":1635410842},{"did":"103450875","siid":5,"piid":2,"value":630,"code":0,"updateTime":1635410842},{"did":"103450875","siid":4,"piid":1,"value":171,"code":0,"updateTime":1635321164},{"did":"103450875","siid":4,"piid":2,"value":60,"code":0,"updateTime":1635321164},{"did":"103450875","siid":3,"piid":1,"value":1920,"code":0,"updateTime":1635410842},{"did":"103450875","siid":3,"piid":2,"value":630,"code":0,"updateTime":1635410842}]}
2021-10-28 16:47:22 DEBUG (MainThread) [custom_components.xiaomi_miot.sensor] 净水器 Water Purifier Status: Added sub entity sensor: filter-3.filter_used_time-1
2021-10-28 16:47:22 DEBUG (MainThread) [custom_components.xiaomi_miot.sensor] 净水器 Water Purifier Status: Added sub entity sensor: filter-3.filter_used_flow-2
2021-10-28 16:47:22 DEBUG (MainThread) [custom_components.xiaomi_miot.sensor] 净水器 Water Purifier Status: Added sub entity sensor: filter-5.filter_used_time-1
2021-10-28 16:47:22 DEBUG (MainThread) [custom_components.xiaomi_miot.sensor] 净水器 Water Purifier Status: Added sub entity sensor: filter-5.filter_used_flow-2
2021-10-28 16:47:22 DEBUG (MainThread) [custom_components.xiaomi_miot.sensor] 净水器 Water Purifier Status: Added sub entity sensor: filter-6.filter_used_time-1
2021-10-28 16:47:22 DEBUG (MainThread) [custom_components.xiaomi_miot.sensor] 净水器 Water Purifier Status: Added sub entity sensor: filter-6.filter_used_flow-2
2021-10-28 16:47:22 DEBUG (MainThread) [custom_components.xiaomi_miot.sensor] 净水器 Water Purifier Status: Added sub entity sensor: filter-7.filter_used_time-1
2021-10-28 16:47:22 DEBUG (MainThread) [custom_components.xiaomi_miot.sensor] 净水器 Water Purifier Status: Added sub entity sensor: filter-7.filter_used_flow-2
2021-10-28 16:47:22 DEBUG (MainThread) [custom_components.xiaomi_miot.sensor] 净水器 Water Purifier Status: Added sub entity sensor: tds_sensor-4.tds_in-1
2021-10-28 16:47:22 DEBUG (MainThread) [custom_components.xiaomi_miot.sensor] 净水器 Water Purifier Status: Added sub entity sensor: tds_sensor-4.tds_out-2
2021-10-28 16:47:22 DEBUG (MainThread) [custom_components.xiaomi_miot.sensor] 净水器 Water Purifier Status: Got new state: {'water_purifier.status': 1, 'filter-7.filter_used_time': 1920, 'filter-7.filter_used_flow': 350, 'filter-6.filter_used_time': 1920, 'filter-6.filter_used_flow': 350, 'filter-5.filter_used_time': 1980, 'filter-5.filter_used_flow': 630, 'tds_sensor.tds_in': 171, 'tds_sensor.tds_out': 60, 'filter.filter_used_time': 1920, 'filter.filter_used_flow': 630, 'state_updater': 'cloud', 'sub_entities': ['filter-3.filter_used_time-1', 'filter-3.filter_used_flow-2', 'filter-5.filter_used_time-1', 'filter-5.filter_used_flow-2', 'filter-6.filter_used_time-1', 'filter-6.filter_used_flow-2', 'filter-7.filter_used_time-1', 'filter-7.filter_used_flow-2', 'tds_sensor-4.tds_in-1', 'tds_sensor-4.tds_out-2']}
2021-10-28 16:47:51 DEBUG (SyncWorker_4) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '427357267', 'siid': 2, 'piid': 1}, {'did': '427357267', 'siid': 2, 'piid': 2}, {'did': '427357267', 'siid': 2, 'piid': 3}, {'did': '427357267', 'siid': 2, 'piid': 5}, {'did': '427357267', 'siid': 2, 'piid': 6}, {'did': '427357267', 'siid': 2, 'piid': 8}, {'did': '427357267', 'siid': 4, 'piid': 1}, {'did': '427357267', 'siid': 4, 'piid': 2}, {'did': '427357267', 'siid': 4, 'piid': 3}, {'did': '427357267', 'siid': 4, 'piid': 4}, {'did': '427357267', 'siid': 4, 'piid': 5}, {'did': '427357267', 'siid': 4, 'piid': 6}, {'did': '427357267', 'siid': 5, 'piid': 1}, {'did': '427357267', 'siid': 3, 'piid': 1}]} result: {"code":0,"message":"","result":[{"did":"427357267","siid":2,"piid":1,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":2,"piid":2,"value":0,"code":0,"updateTime":1635207916},{"did":"427357267","siid":2,"piid":3,"value":0,"code":0,"updateTime":1635207916},{"did":"427357267","siid":2,"piid":5,"value":45,"code":0,"updateTime":1635207916},{"did":"427357267","siid":2,"piid":6,"value":16,"code":0,"updateTime":1635410406},{"did":"427357267","siid":2,"piid":8,"value":1,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":1,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":2,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":3,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":4,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":5,"value":0,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":6,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":5,"piid":1,"value":0,"code":0,"updateTime":1635207916},{"did":"427357267","siid":3,"piid":1,"value":false,"code":0,"updateTime":1635207916}]}
2021-10-28 16:47:51 DEBUG (MainThread) [custom_components.xiaomi_miot.climate] LETSLEEP water heated blanket‘HS2205’ Electric Blanket: Added sub entity switch: physical_controls_locked-3.physical_controls_locked-1
2021-10-28 16:47:51 DEBUG (MainThread) [custom_components.xiaomi_miot.climate] LETSLEEP water heated blanket‘HS2205’ Electric Blanket: Got new state: {'electric_blanket.on': False, 'electric_blanket.fault': 0, 'electric_blanket.mode': 0, 'target_temperature-2-5': 45, 'electric_blanket.temperature': 16, 'electric_blanket.water_level': 1, 'custom.low_temperature': False, 'custom.screen_switch': False, 'custom.key_tone': False, 'custom.automatic_shutdown': False, 'custom.sleep_level': 0, 'custom.fast_heating': False, 'countdown.countdown_time': 0, 'physical_controls_locked': False, 'state_updater': 'cloud', 'sub_entities': ['physical_controls_locked-3.physical_controls_locked-1']}
2021-10-28 16:47:52 DEBUG (SyncWorker_10) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '103450875', 'siid': 2, 'piid': 1}, {'did': '103450875', 'siid': 7, 'piid': 1}, {'did': '103450875', 'siid': 7, 'piid': 2}, {'did': '103450875', 'siid': 6, 'piid': 1}, {'did': '103450875', 'siid': 6, 'piid': 2}, {'did': '103450875', 'siid': 5, 'piid': 1}, {'did': '103450875', 'siid': 5, 'piid': 2}, {'did': '103450875', 'siid': 4, 'piid': 1}, {'did': '103450875', 'siid': 4, 'piid': 2}, {'did': '103450875', 'siid': 3, 'piid': 1}, {'did': '103450875', 'siid': 3, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"103450875","siid":2,"piid":1,"value":1,"code":0,"updateTime":1635321165},{"did":"103450875","siid":7,"piid":1,"value":1920,"code":0,"updateTime":1635410872},{"did":"103450875","siid":7,"piid":2,"value":350,"code":0,"updateTime":1635410872},{"did":"103450875","siid":6,"piid":1,"value":1920,"code":0,"updateTime":1635410872},{"did":"103450875","siid":6,"piid":2,"value":350,"code":0,"updateTime":1635410872},{"did":"103450875","siid":5,"piid":1,"value":1980,"code":0,"updateTime":1635410872},{"did":"103450875","siid":5,"piid":2,"value":630,"code":0,"updateTime":1635410872},{"did":"103450875","siid":4,"piid":1,"value":171,"code":0,"updateTime":1635321164},{"did":"103450875","siid":4,"piid":2,"value":60,"code":0,"updateTime":1635321164},{"did":"103450875","siid":3,"piid":1,"value":1920,"code":0,"updateTime":1635410872},{"did":"103450875","siid":3,"piid":2,"value":630,"code":0,"updateTime":1635410872}]}
2021-10-28 16:47:52 DEBUG (MainThread) [custom_components.xiaomi_miot.sensor] 净水器 Water Purifier Status: Got new state: {'water_purifier.status': 1, 'filter-7.filter_used_time': 1920, 'filter-7.filter_used_flow': 350, 'filter-6.filter_used_time': 1920, 'filter-6.filter_used_flow': 350, 'filter-5.filter_used_time': 1980, 'filter-5.filter_used_flow': 630, 'tds_sensor.tds_in': 171, 'tds_sensor.tds_out': 60, 'filter.filter_used_time': 1920, 'filter.filter_used_flow': 630, 'state_updater': 'cloud', 'sub_entities': ['filter-3.filter_used_time-1', 'filter-3.filter_used_flow-2', 'filter-5.filter_used_time-1', 'filter-5.filter_used_flow-2', 'filter-6.filter_used_time-1', 'filter-6.filter_used_flow-2', 'filter-7.filter_used_time-1', 'filter-7.filter_used_flow-2', 'tds_sensor-4.tds_in-1', 'tds_sensor-4.tds_out-2']}
2021-10-28 16:48:22 DEBUG (SyncWorker_10) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '103450875', 'siid': 2, 'piid': 1}, {'did': '103450875', 'siid': 7, 'piid': 1}, {'did': '103450875', 'siid': 7, 'piid': 2}, {'did': '103450875', 'siid': 6, 'piid': 1}, {'did': '103450875', 'siid': 6, 'piid': 2}, {'did': '103450875', 'siid': 5, 'piid': 1}, {'did': '103450875', 'siid': 5, 'piid': 2}, {'did': '103450875', 'siid': 4, 'piid': 1}, {'did': '103450875', 'siid': 4, 'piid': 2}, {'did': '103450875', 'siid': 3, 'piid': 1}, {'did': '103450875', 'siid': 3, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"103450875","siid":2,"piid":1,"value":1,"code":0,"updateTime":1635321165},{"did":"103450875","siid":7,"piid":1,"value":1920,"code":0,"updateTime":1635410902},{"did":"103450875","siid":7,"piid":2,"value":350,"code":0,"updateTime":1635410902},{"did":"103450875","siid":6,"piid":1,"value":1920,"code":0,"updateTime":1635410902},{"did":"103450875","siid":6,"piid":2,"value":350,"code":0,"updateTime":1635410902},{"did":"103450875","siid":5,"piid":1,"value":1980,"code":0,"updateTime":1635410902},{"did":"103450875","siid":5,"piid":2,"value":630,"code":0,"updateTime":1635410902},{"did":"103450875","siid":4,"piid":1,"value":171,"code":0,"updateTime":1635321164},{"did":"103450875","siid":4,"piid":2,"value":60,"code":0,"updateTime":1635321164},{"did":"103450875","siid":3,"piid":1,"value":1920,"code":0,"updateTime":1635410902},{"did":"103450875","siid":3,"piid":2,"value":630,"code":0,"updateTime":1635410902}]}
2021-10-28 16:48:22 DEBUG (MainThread) [custom_components.xiaomi_miot.sensor] 净水器 Water Purifier Status: Got new state: {'water_purifier.status': 1, 'filter-7.filter_used_time': 1920, 'filter-7.filter_used_flow': 350, 'filter-6.filter_used_time': 1920, 'filter-6.filter_used_flow': 350, 'filter-5.filter_used_time': 1980, 'filter-5.filter_used_flow': 630, 'tds_sensor.tds_in': 171, 'tds_sensor.tds_out': 60, 'filter.filter_used_time': 1920, 'filter.filter_used_flow': 630, 'state_updater': 'cloud', 'sub_entities': ['filter-3.filter_used_time-1', 'filter-3.filter_used_flow-2', 'filter-5.filter_used_time-1', 'filter-5.filter_used_flow-2', 'filter-6.filter_used_time-1', 'filter-6.filter_used_flow-2', 'filter-7.filter_used_time-1', 'filter-7.filter_used_flow-2', 'tds_sensor-4.tds_in-1', 'tds_sensor-4.tds_out-2']}
2021-10-28 16:48:51 DEBUG (SyncWorker_1) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '427357267', 'siid': 2, 'piid': 1}, {'did': '427357267', 'siid': 2, 'piid': 2}, {'did': '427357267', 'siid': 2, 'piid': 3}, {'did': '427357267', 'siid': 2, 'piid': 5}, {'did': '427357267', 'siid': 2, 'piid': 6}, {'did': '427357267', 'siid': 2, 'piid': 8}, {'did': '427357267', 'siid': 4, 'piid': 1}, {'did': '427357267', 'siid': 4, 'piid': 2}, {'did': '427357267', 'siid': 4, 'piid': 3}, {'did': '427357267', 'siid': 4, 'piid': 4}, {'did': '427357267', 'siid': 4, 'piid': 5}, {'did': '427357267', 'siid': 4, 'piid': 6}, {'did': '427357267', 'siid': 5, 'piid': 1}, {'did': '427357267', 'siid': 3, 'piid': 1}]} result: {"code":0,"message":"","result":[{"did":"427357267","siid":2,"piid":1,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":2,"piid":2,"value":0,"code":0,"updateTime":1635207916},{"did":"427357267","siid":2,"piid":3,"value":0,"code":0,"updateTime":1635207916},{"did":"427357267","siid":2,"piid":5,"value":45,"code":0,"updateTime":1635207916},{"did":"427357267","siid":2,"piid":6,"value":16,"code":0,"updateTime":1635410406},{"did":"427357267","siid":2,"piid":8,"value":1,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":1,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":2,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":3,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":4,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":5,"value":0,"code":0,"updateTime":1635207916},{"did":"427357267","siid":4,"piid":6,"value":false,"code":0,"updateTime":1635207916},{"did":"427357267","siid":5,"piid":1,"value":0,"code":0,"updateTime":1635207916},{"did":"427357267","siid":3,"piid":1,"value":false,"code":0,"updateTime":1635207916}]}
2021-10-28 16:48:51 DEBUG (MainThread) [custom_components.xiaomi_miot.climate] LETSLEEP water heated blanket‘HS2205’ Electric Blanket: Got new state: {'electric_blanket.on': False, 'electric_blanket.fault': 0, 'electric_blanket.mode': 0, 'target_temperature-2-5': 45, 'electric_blanket.temperature': 16, 'electric_blanket.water_level': 1, 'custom.low_temperature': False, 'custom.screen_switch': False, 'custom.key_tone': False, 'custom.automatic_shutdown': False, 'custom.sleep_level': 0, 'custom.fast_heating': False, 'countdown.countdown_time': 0, 'physical_controls_locked': False, 'state_updater': 'cloud', 'sub_entities': ['physical_controls_locked-3.physical_controls_locked-1']}
2021-10-28 16:48:52 DEBUG (SyncWorker_5) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '103450875', 'siid': 2, 'piid': 1}, {'did': '103450875', 'siid': 7, 'piid': 1}, {'did': '103450875', 'siid': 7, 'piid': 2}, {'did': '103450875', 'siid': 6, 'piid': 1}, {'did': '103450875', 'siid': 6, 'piid': 2}, {'did': '103450875', 'siid': 5, 'piid': 1}, {'did': '103450875', 'siid': 5, 'piid': 2}, {'did': '103450875', 'siid': 4, 'piid': 1}, {'did': '103450875', 'siid': 4, 'piid': 2}, {'did': '103450875', 'siid': 3, 'piid': 1}, {'did': '103450875', 'siid': 3, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"103450875","siid":2,"piid":1,"value":1,"code":0,"updateTime":1635321165},{"did":"103450875","siid":7,"piid":1,"value":1920,"code":0,"updateTime":1635410932},{"did":"103450875","siid":7,"piid":2,"value":350,"code":0,"updateTime":1635410932},{"did":"103450875","siid":6,"piid":1,"value":1920,"code":0,"updateTime":1635410932},{"did":"103450875","siid":6,"piid":2,"value":350,"code":0,"updateTime":1635410932},{"did":"103450875","siid":5,"piid":1,"value":1980,"code":0,"updateTime":1635410932},{"did":"103450875","siid":5,"piid":2,"value":630,"code":0,"updateTime":1635410932},{"did":"103450875","siid":4,"piid":1,"value":171,"code":0,"updateTime":1635321164},{"did":"103450875","siid":4,"piid":2,"value":60,"code":0,"updateTime":1635321164},{"did":"103450875","siid":3,"piid":1,"value":1920,"code":0,"updateTime":1635410932},{"did":"103450875","siid":3,"piid":2,"value":630,"code":0,"updateTime":1635410932}]}
2021-10-28 16:48:52 DEBUG (MainThread) [custom_components.xiaomi_miot.sensor] 净水器 Water Purifier Status: Got new state: {'water_purifier.status': 1, 'filter-7.filter_used_time': 1920, 'filter-7.filter_used_flow': 350, 'filter-6.filter_used_time': 1920, 'filter-6.filter_used_flow': 350, 'filter-5.filter_used_time': 1980, 'filter-5.filter_used_flow': 630, 'tds_sensor.tds_in': 171, 'tds_sensor.tds_out': 60, 'filter.filter_used_time': 1920, 'filter.filter_used_flow': 630, 'state_updater': 'cloud', 'sub_entities': ['filter-3.filter_used_time-1', 'filter-3.filter_used_flow-2', 'filter-5.filter_used_time-1', 'filter-5.filter_used_flow-2', 'filter-6.filter_used_time-1', 'filter-6.filter_used_flow-2', 'filter-7.filter_used_time-1', 'filter-7.filter_used_flow-2', 'tds_sensor-4.tds_in-1', 'tds_sensor-4.tds_out-2']}

@al-one
Copy link
Owner

al-one commented Oct 28, 2021

请再次更新后尝试。

@al-one
Copy link
Owner

al-one commented Nov 5, 2021

请问更新后有实体了吗?

@luckystarwy
Copy link
Author

请问更新后有实体了吗?

最近出差,在外地用手机加入了一下,有实体,但是否有人入座不能正确反应,几个实体我初步观察了下,就过滤器的使用状况的两个传感器感觉是正常的。我用‘xiaomi_raw’(不是miot_raw那个)这个插件倒是可以正常检测到是否有人入座。

@al-one
Copy link
Owner

al-one commented Nov 5, 2021

xiaomi_raw使用的是miio协议,该设备不支持本地的miot协议,因此本插件只能依赖小米云端使用miot协议读取设备状态。
关于坐下状态不正确,可能是由于插件是每隔几十秒查询一次,可以参考 #100 (comment) 减小轮询间隔时长。另外请提供一下开发者工具中的实体状态属性

@luckystarwy
Copy link
Author

xiaomi_raw使用的是miio协议,该设备不支持本地的miot协议,因此本插件只能依赖小米云端使用miot协议读取设备状态。
关于坐下状态不正确,可能是由于插件是每隔几十秒查询一次,可以参考 #100 (comment) 减小轮询间隔时长。另外请提供一下开发者工具中的实体状态属性。

不是延迟,坐下状态从来没有变化过。我知道这个云端延迟大,因为用xiaomi_raw也有很大延迟的。

@al-one
Copy link
Owner

al-one commented Nov 10, 2021

设备状态来着小米云端接口,你可以开启调试级别日志后观察小米接口的返回数据是否变化。

也许你还可以使用自定义属性miio_properties来获取设备的状态:

# customize.yaml
binary_sensor.tinymu_v1_entity_id:
  miio_properties: prop1,prop2

使用@vevsvevs修改版的米家可以获取miio属性:

  1. 下载APK СКАЧАТЬ ВЕРСИЮ 6.x.x 并安装
  2. 打开米家APP > 我的 > 实验室功能
  3. 打开Write custom log filesEnable app's debug mode
  4. 重启APP后在vevs/logs/miio/device-did.txt文件中找到get_prop

@luckystarwy
Copy link
Author

作者大神不好意思现在才有空测试了发日志,抱歉啦
这是接入马桶盖后的情况下重启HA后,再上座1分钟左右,然后离开的日志,您先看一下吧,谢谢
俄罗斯大神的app的以前我这么搞过,在另外一台电脑,等空了去找一下或者重新再弄一遍。
2021-11-14 00:18:54 DEBUG (SyncWorker_3) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: user/get_user_device_data {'did': '1', 'key': 'check_auth', 'type': 'prop', 'time_start': 1636215534, 'time_end': 1636820394, 'limit': 5} result: {"code":-8,"message":"unknown did","result":null}
2021-11-14 00:18:54 INFO (SyncWorker_3) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: user/get_user_device_data {'did': '1', 'key': 'check_auth', 'type': 'prop', 'time_start': 1636215534, 'time_end': 1636820394, 'limit': 5} failed, result: {"code":-8,"message":"unknown did","result":null}
2021-11-14 00:18:56 DEBUG (MainThread) [custom_components.xiaomi_miot] Setup xiaomi cloud for user: 13771987306, 2 devices
2021-11-14 00:18:56 DEBUG (MainThread) [custom_components.xiaomi_miot] Xiaomi cloud device: {'name': '马桶盖', 'host': '192.168.2.19', 'token': '****', 'model': 'tinymu.toiletlid.v1', 'miot_did': '84124131', 'miot_type': 'urn:miot-spec-v2:device:toilet:0000A02E:tinymu-v1:1', 'miio_info': {'ap': {'ssid': 'LuckyDogMusic', 'bssid': '34:97:F6:64:8E:A0', 'rssi': -61}, 'netif': {'localIp': '192.168.2.19', 'gw': '', 'mask': ''}, 'fw_ver': '1.6.7_0107', 'hw_ver': '', 'mac': '78:11:DC:FE:E4:C5', 'model': 'tinymu.toiletlid.v1', 'token': '067a4b2071a03d9ec993a55ea7112211'}, 'conn_mode': 'auto', 'miot_cloud': True, 'entry_id': '6734c157b3307e5abc37e0c939ea80b5', 'config_version': 0.2}
2021-11-14 00:18:57 INFO (MainThread) [custom_components.xiaomi_miot.binary_sensor] 马桶盖 Seat: Initializing miot device with mapping: {'seat.heating': {'siid': 3, 'piid': 1}, 'seat.deodorization': {'siid': 3, 'piid': 2}, 'filter.filter_used_time': {'siid': 2, 'piid': 1}, 'filter.filter_used_flow': {'siid': 2, 'piid': 2}}
2021-11-14 00:18:57 DEBUG (SyncWorker_3) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '427357267', 'siid': 2, 'piid': 1}, {'did': '427357267', 'siid': 2, 'piid': 2}, {'did': '427357267', 'siid': 2, 'piid': 3}, {'did': '427357267', 'siid': 2, 'piid': 5}, {'did': '427357267', 'siid': 2, 'piid': 6}, {'did': '427357267', 'siid': 2, 'piid': 8}, {'did': '427357267', 'siid': 4, 'piid': 1}, {'did': '427357267', 'siid': 4, 'piid': 2}, {'did': '427357267', 'siid': 4, 'piid': 3}, {'did': '427357267', 'siid': 4, 'piid': 4}, {'did': '427357267', 'siid': 4, 'piid': 5}, {'did': '427357267', 'siid': 4, 'piid': 6}, {'did': '427357267', 'siid': 5, 'piid': 1}, {'did': '427357267', 'siid': 3, 'piid': 1}]} result: {"code":0,"message":"","result":[{"did":"427357267","siid":2,"piid":1,"value":false,"code":0,"updateTime":1636809294,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":2,"piid":2,"value":0,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":2,"piid":3,"value":0,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":2,"piid":5,"value":45,"code":0,"updateTime":1636720745,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":2,"piid":6,"value":15,"code":0,"updateTime":1636820324,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":2,"piid":8,"value":1,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":1,"value":false,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":2,"value":false,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":3,"value":true,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":4,"value":false,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":5,"value":0,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":6,"value":false,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":5,"piid":1,"value":0,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":3,"piid":1,"value":false,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0}]}
2021-11-14 00:18:57 DEBUG (SyncWorker_6) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '84124131', 'siid': 3, 'piid': 1}, {'did': '84124131', 'siid': 3, 'piid': 2}, {'did': '84124131', 'siid': 2, 'piid': 1}, {'did': '84124131', 'siid': 2, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"84124131","siid":3,"piid":1,"code":-704030013,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"84124131","siid":3,"piid":2,"code":-704030013,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"84124131","siid":2,"piid":1,"value":146,"code":0,"updateTime":1636816698,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"84124131","siid":2,"piid":2,"value":82,"code":0,"updateTime":1636819960,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0}]}
2021-11-14 00:18:57 DEBUG (MainThread) [custom_components.xiaomi_miot.binary_sensor] 马桶盖 Seat: Got new state: {'seat.heating.error': '-704030013 Property is not readable', 'seat.deodorization.error': '-704030013 Property is not readable', 'filter.filter_used_time': 146, 'filter.filter_used_flow': 82, 'state_updater': 'cloud'}
2021-11-14 00:19:28 DEBUG (SyncWorker_3) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '84124131', 'siid': 3, 'piid': 1}, {'did': '84124131', 'siid': 3, 'piid': 2}, {'did': '84124131', 'siid': 2, 'piid': 1}, {'did': '84124131', 'siid': 2, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"84124131","siid":3,"piid":1,"code":-704030013,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"84124131","siid":3,"piid":2,"code":-704030013,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"84124131","siid":2,"piid":1,"value":146,"code":0,"updateTime":1636816698,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"84124131","siid":2,"piid":2,"value":82,"code":0,"updateTime":1636819960,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0}]}
2021-11-14 00:19:28 DEBUG (MainThread) [custom_components.xiaomi_miot.binary_sensor] 马桶盖 Seat: Added sub entity sensor: filter-2.filter_used_time-1
2021-11-14 00:19:28 DEBUG (MainThread) [custom_components.xiaomi_miot.binary_sensor] 马桶盖 Seat: Added sub entity sensor: filter-2.filter_used_flow-2
2021-11-14 00:19:28 DEBUG (MainThread) [custom_components.xiaomi_miot.binary_sensor] 马桶盖 Seat: Got new state: {'seat.heating.error': '-704030013 Property is not readable', 'seat.deodorization.error': '-704030013 Property is not readable', 'filter.filter_used_time': 146, 'filter.filter_used_flow': 82, 'state_updater': 'cloud', 'sub_entities': ['filter-2.filter_used_time-1', 'filter-2.filter_used_flow-2']}
2021-11-14 00:19:58 DEBUG (SyncWorker_5) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '84124131', 'siid': 3, 'piid': 1}, {'did': '84124131', 'siid': 3, 'piid': 2}, {'did': '84124131', 'siid': 2, 'piid': 1}, {'did': '84124131', 'siid': 2, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"84124131","siid":3,"piid":1,"code":-704030013,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"84124131","siid":3,"piid":2,"code":-704030013,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"84124131","siid":2,"piid":1,"value":146,"code":0,"updateTime":1636816698,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"84124131","siid":2,"piid":2,"value":82,"code":0,"updateTime":1636819960,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0}]}
2021-11-14 00:19:58 DEBUG (MainThread) [custom_components.xiaomi_miot.binary_sensor] 马桶盖 Seat: Got new state: {'seat.heating.error': '-704030013 Property is not readable', 'seat.deodorization.error': '-704030013 Property is not readable', 'filter.filter_used_time': 146, 'filter.filter_used_flow': 82, 'state_updater': 'cloud', 'sub_entities': ['filter-2.filter_used_time-1', 'filter-2.filter_used_flow-2']}
2021-11-14 00:19:58 DEBUG (SyncWorker_6) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '427357267', 'siid': 2, 'piid': 1}, {'did': '427357267', 'siid': 2, 'piid': 2}, {'did': '427357267', 'siid': 2, 'piid': 3}, {'did': '427357267', 'siid': 2, 'piid': 5}, {'did': '427357267', 'siid': 2, 'piid': 6}, {'did': '427357267', 'siid': 2, 'piid': 8}, {'did': '427357267', 'siid': 4, 'piid': 1}, {'did': '427357267', 'siid': 4, 'piid': 2}, {'did': '427357267', 'siid': 4, 'piid': 3}, {'did': '427357267', 'siid': 4, 'piid': 4}, {'did': '427357267', 'siid': 4, 'piid': 5}, {'did': '427357267', 'siid': 4, 'piid': 6}, {'did': '427357267', 'siid': 5, 'piid': 1}, {'did': '427357267', 'siid': 3, 'piid': 1}]} result: {"code":0,"message":"","result":[{"did":"427357267","siid":2,"piid":1,"value":false,"code":0,"updateTime":1636809294,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":2,"piid":2,"value":0,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":2,"piid":3,"value":0,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":2,"piid":5,"value":45,"code":0,"updateTime":1636720745,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":2,"piid":6,"value":15,"code":0,"updateTime":1636820364,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":2,"piid":8,"value":1,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":1,"value":false,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":2,"value":false,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":3,"value":true,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":4,"value":false,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":5,"value":0,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":6,"value":false,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":5,"piid":1,"value":0,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":3,"piid":1,"value":false,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0}]}
2021-11-14 00:20:28 DEBUG (SyncWorker_0) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '84124131', 'siid': 3, 'piid': 1}, {'did': '84124131', 'siid': 3, 'piid': 2}, {'did': '84124131', 'siid': 2, 'piid': 1}, {'did': '84124131', 'siid': 2, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"84124131","siid":3,"piid":1,"code":-704030013,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"84124131","siid":3,"piid":2,"code":-704030013,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"84124131","siid":2,"piid":1,"value":146,"code":0,"updateTime":1636816698,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"84124131","siid":2,"piid":2,"value":82,"code":0,"updateTime":1636819960,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0}]}
2021-11-14 00:20:28 DEBUG (MainThread) [custom_components.xiaomi_miot.binary_sensor] 马桶盖 Seat: Got new state: {'seat.heating.error': '-704030013 Property is not readable', 'seat.deodorization.error': '-704030013 Property is not readable', 'filter.filter_used_time': 146, 'filter.filter_used_flow': 82, 'state_updater': 'cloud', 'sub_entities': ['filter-2.filter_used_time-1', 'filter-2.filter_used_flow-2']}
2021-11-14 00:20:58 DEBUG (SyncWorker_3) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '84124131', 'siid': 3, 'piid': 1}, {'did': '84124131', 'siid': 3, 'piid': 2}, {'did': '84124131', 'siid': 2, 'piid': 1}, {'did': '84124131', 'siid': 2, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"84124131","siid":3,"piid":1,"code":-704030013,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"84124131","siid":3,"piid":2,"code":-704030013,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"84124131","siid":2,"piid":1,"value":146,"code":0,"updateTime":1636816698,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"84124131","siid":2,"piid":2,"value":82,"code":0,"updateTime":1636819960,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0}]}
2021-11-14 00:20:58 DEBUG (MainThread) [custom_components.xiaomi_miot.binary_sensor] 马桶盖 Seat: Got new state: {'seat.heating.error': '-704030013 Property is not readable', 'seat.deodorization.error': '-704030013 Property is not readable', 'filter.filter_used_time': 146, 'filter.filter_used_flow': 82, 'state_updater': 'cloud', 'sub_entities': ['filter-2.filter_used_time-1', 'filter-2.filter_used_flow-2']}
2021-11-14 00:20:58 DEBUG (SyncWorker_7) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '427357267', 'siid': 2, 'piid': 1}, {'did': '427357267', 'siid': 2, 'piid': 2}, {'did': '427357267', 'siid': 2, 'piid': 3}, {'did': '427357267', 'siid': 2, 'piid': 5}, {'did': '427357267', 'siid': 2, 'piid': 6}, {'did': '427357267', 'siid': 2, 'piid': 8}, {'did': '427357267', 'siid': 4, 'piid': 1}, {'did': '427357267', 'siid': 4, 'piid': 2}, {'did': '427357267', 'siid': 4, 'piid': 3}, {'did': '427357267', 'siid': 4, 'piid': 4}, {'did': '427357267', 'siid': 4, 'piid': 5}, {'did': '427357267', 'siid': 4, 'piid': 6}, {'did': '427357267', 'siid': 5, 'piid': 1}, {'did': '427357267', 'siid': 3, 'piid': 1}]} result: {"code":0,"message":"","result":[{"did":"427357267","siid":2,"piid":1,"value":false,"code":0,"updateTime":1636809294,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":2,"piid":2,"value":0,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":2,"piid":3,"value":0,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":2,"piid":5,"value":45,"code":0,"updateTime":1636720745,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":2,"piid":6,"value":15,"code":0,"updateTime":1636820364,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":2,"piid":8,"value":1,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":1,"value":false,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":2,"value":false,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":3,"value":true,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":4,"value":false,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":5,"value":0,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":4,"piid":6,"value":false,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":5,"piid":1,"value":0,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0},{"did":"427357267","siid":3,"piid":1,"value":false,"code":0,"updateTime":1636297340,"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0}]}

@al-one
Copy link
Owner

al-one commented Nov 19, 2021

请问获取到miio props了吗?你也可以通过米家将该设备共享给我:143050915

@luckystarwy
Copy link
Author

大神,我把设备分享给您了,最近一直再项目上,实在抱歉,拖了好久一直没有反馈。。。还有大神您的认真太令我敬佩啦

@al-one
Copy link
Owner

al-one commented Nov 20, 2021

https://github.com/rytilahti/python-miio/blob/26795b52f12d1422fbac2b96f5c1d3f7474ea901/miio/toiletlid.py

我通过python-miio库找到了该设备的miio props,你可以添加下面的自定义属性

# customize.yaml
binary_sensor.tinymu_v1_entity_id:
  miio_properties: work_state,filter_use_flux,filter_use_time,ambient_light

上面的自定义属性会把miio props获取到实体的状态属性中,可以通过模板创建新的实体:

# configuration.yaml
template:
  - trigger:
      - platform: state
        entity_id: binary_sensor.tinymu_v1_entity_id
        attribute: miio.work_state
    sensor:
      # https://github.com/rytilahti/python-miio/blob/26795b52f12d1422fbac2b96f5c1d3f7474ea901/miio/toiletlid.py#L49
      - name: tinymu_v1_work_mode
        state: |
          {% set mode = (trigger.to_state.attributes['miio.work_state'] | default | int(1) - 1) // 16 -%}
          {% set modes = {0:'idle',1:'occupied',2:'rear_cleanse',3:'front_cleanse',6:'nozzle_clean'} -%}
          {{ modes[mode] | default(mode) }}
    binary_sensor:
      # https://github.com/rytilahti/python-miio/blob/26795b52f12d1422fbac2b96f5c1d3f7474ea901/miio/toiletlid.py#L54
      - name: tinymu_v1_is_on
        state: |
          {{ (trigger.to_state.attributes['miio.work_state'] | default) != 1 }}

@al-one
Copy link
Owner

al-one commented Nov 27, 2021

请问上述方法有用吗?

@luckystarwy
Copy link
Author

请问上述方法有用吗?

work_state,filter_use_flux,filter_use_time,ambient_light都获取到实体的状态属性中了,但是模板传感器还是没有反应,前天刚试了

@al-one
Copy link
Owner

al-one commented Nov 27, 2021

把你的实体属性贴出来看下。

@luckystarwy
Copy link
Author

luckystarwy commented Nov 27, 2021

homeassistant:
  customize:
    binary_sensor.tinymu_v1_e4c5_seat:
      miio_properties: work_state,filter_use_flux,filter_use_time,ambient_light

template:
  - trigger:
      - platform: state
        entity_id: binary_sensor.tinymu_v1_e4c5_seat
        attribute: miio.work_state
    sensor:
      - name: tinymu_v1_work_mode
        state: |
          {% set mode = (trigger.to_state.attributes['miio.work_state'] | default | int(1) - 1) // 16 -%}
          {% set modes = {0:'idle',1:'occupied',2:'rear_cleanse',3:'front_cleanse',6:'nozzle_clean'} -%}
          {{ modes[mode] | default(mode) }}
    binary_sensor:
      - name: tinymu_v1_is_on
        state: |
          {{ (trigger.to_state.attributes['miio.work_state'] | default) != 1 }}

以上是.yaml文件

属性

Model
tinymu.toiletlid.v1
Lan IP
192.168.2.19
MAC address
78:11:DC:FE:E4:C5
Firmware version
1.6.7_0107
Hardware version
Entity class
MiotToiletEntity
Miot type
urn:miot-spec-v2:device:toilet:0000A02E:tinymu-v1:1
State property
-
Seat.heating.error
-704030013 Property is not readable
Seat.deodorization.error
-704030013 Property is not readable
Filter.filter used time
133
Filter.filter used flow
74
State updater
cloud
Sub entities
filter-2.filter_used_time-1, filter-2.filter_used_flow-2
Miio properties
work_state,filter_use_flux,filter_use_time,ambient_light

这是HA中马桶盖实体点开属性过后显示的内容

sensor.tinymu_v1_work_mode状态一直是unknown,binary_sensor.tinymu_v1_is_on状态一直是off(不管有没有人)

@al-one
Copy link
Owner

al-one commented Nov 27, 2021

如果获取miio_properties成功,你的实体属性中会出现:

miio.work_state: xxxx
miio.filter_use_flux: xxxx
...

但是你的实体属性中并没有,miio_properties需要你的HA和设备在同一局域网,如果是同一局域网,请检查下你的设备IP是否为192.168.2.19。并查看日志中有没有该设备相关的报错日志。

@luckystarwy
Copy link
Author

luckystarwy commented Nov 27, 2021

sensor:
  - platform: xiaomi_miio_raw
    name: toiletlid
    host: 192.168.2.19
    token: XXXXXXXXXXXXXXXXXX
    sensor_property: 'work_state'
    default_properties_getter: 'get_prop'
    default_properties:
      - work_state

binary_sensor:
  - platform: template
    sensors:
      toiletlid_status:
        friendly_name: "马桶状态"
        device_class: "motion"
        value_template: >-
           {{ states('sensor.toiletlid') |int != 1 }}  

这是我用xiaomi_miio_raw插件的配置,可以正常使用的,现在想米家设备都用大神您的插件。。。。
就不知道哪里出问题了

@al-one
Copy link
Owner

al-one commented Nov 27, 2021

自定义属性miio_propertiesxiaomi_miio_raw插件的原理是一样的,用的都是miio协议。这款设备其实更推荐用xiaomi_miio_raw插件。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
device: toilet enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants