al-one / hass-xiaomi-miot

Automatic integrate all Xiaomi devices to HomeAssistant via miot-spec, support Wi-Fi, BLE, ZigBee devices. 小米米家智能家居设备接入Hass集成
https://miot-spec.com
Apache License 2.0
4.19k stars 587 forks source link

电小酷 P8AM 用电统计本地模式数据异常 #1372

Open ohmykreee opened 8 months ago

ohmykreee commented 8 months ago

Device model / 设备型号

cuco.plug.p8amd

Component version / 插件版本

0.7.13

HA core version / HA版本

2023.10.5

Integrated mode / 集成方式

Automatic (自动模式)

The problem / 问题详情

电小酷 P8AM设备在使用本地模式(即使用自动模式下自动选择本地模式)时,功耗(Power Consumption Electric)和用电量(Power Consumption)数据异常: image image 当强制使用云端模式时,数据恢复正常: image

Entity attributes / 实体属性

sensor.cuco_p8amd_7536_electric_power

state_class: measurement
entity_class: MiotSensorSubEntity
parent_entity_id: switch.cuco_p8amd_7536_switch_3
service_description: Power Consumption
property_description: Electric Power
updated_time: 2023-10-27T18:22:38.755236+08:00
electric_power-6-2: 1119686423
unit_of_measurement: W
device_class: power
friendly_name: 插座 Power Consumption Electric
supported_features: 0

sensor.cuco_p8amd_7536_power_consumption

state_class: total_increasing
entity_class: MiotSensorSubEntity
parent_entity_id: switch.cuco_p8amd_7536_switch_3
service_description: Power Consumption
property_description: Power Consumption
updated_time: 2023-10-27T18:21:38.967414+08:00
power_consumption: 952331977
unit_of_measurement: Wh
friendly_name: 插座 Power Consumption
supported_features: 0

Home Assistant Logs / 系统日志

2023-10-27 12:08:45.595 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration xiaomi_miot which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-10-27 12:08:57.676 WARNING (MainThread) [custom_components.xiaomi_miot.sensor] Get xiaomi message for 2400338245 failed: {'code': 0, 'message': 'ok', 'result': {'messages': None}}
2023-10-27 12:54:42.202 WARNING (SyncWorker_9) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request xiaomi api: v2/message/v2/typelist {} failed, response: None
2023-10-27 12:55:07.762 ERROR (MainThread) [custom_components.xiaomi_miot.light] 台灯(yeelink.light.lamp4): Got MiioException while fetching the state: Unable to discover the device 192.168.3.55, mapping: {'light.on': {'siid': 2, 'piid': 1}, 'light.brightness': {'siid': 2, 'piid': 2}, 'light.color_temperature': {'siid': 2, 'piid': 3}}, max_properties: 10/3
2023-10-27 12:55:16.396 ERROR (MainThread) [custom_components.xiaomi_miot.sensor] Error requesting xiaomi_miot-mihome-message-2400338245 data: HTTPSConnectionPool(host='api.io.mi.com', port=443): Max retries exceeded with url: /app/v2/message/v2/typelist (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f9a0565cd50>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
2023-10-27 12:56:07.765 ERROR (MainThread) [custom_components.xiaomi_miot.light] 台灯(yeelink.light.lamp4): Got MiioException while fetching the state: Unable to discover the device 192.168.3.55, mapping: {'light.on': {'siid': 2, 'piid': 1}, 'light.brightness': {'siid': 2, 'piid': 2}, 'light.color_temperature': {'siid': 2, 'piid': 3}}, max_properties: 10/3
2023-10-27 12:56:32.760 ERROR (MainThread) [custom_components.xiaomi_miot.light] 台灯(yeelink.light.lamp4): Got MiioException while fetching the state: Unable to discover the device 192.168.3.55, mapping: {'light.on': {'siid': 2, 'piid': 1}, 'light.brightness': {'siid': 2, 'piid': 2}, 'light.color_temperature': {'siid': 2, 'piid': 3}}, max_properties: 10/3
2023-10-27 12:57:02.761 ERROR (MainThread) [custom_components.xiaomi_miot.light] 台灯(yeelink.light.lamp4): Got MiioException while fetching the state: Unable to discover the device 192.168.3.55, mapping: {'light.on': {'siid': 2, 'piid': 1}, 'light.brightness': {'siid': 2, 'piid': 2}, 'light.color_temperature': {'siid': 2, 'piid': 3}}, max_properties: 10/3
2023-10-27 14:47:36.202 ERROR (MainThread) [custom_components.xiaomi_miot.sensor] Error requesting xiaomi_miot-mihome-message-2400338245 data: HTTPSConnectionPool(host='api.io.mi.com', port=443): Max retries exceeded with url: /app/v2/message/v2/typelist (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)')))
2023-10-27 14:56:08.046 ERROR (MainThread) [custom_components.xiaomi_miot.light] 台灯(yeelink.light.lamp4): Got MiioException while fetching the state: Unable to discover the device 192.168.3.55, mapping: {'light.on': {'siid': 2, 'piid': 1}, 'light.brightness': {'siid': 2, 'piid': 2}, 'light.color_temperature': {'siid': 2, 'piid': 3}}, max_properties: 10/3
2023-10-27 17:16:24.810 ERROR (MainThread) [homeassistant.components.switch] Error adding entities for domain switch with platform xiaomi_miot
2023-10-27 17:16:24.817 ERROR (MainThread) [homeassistant.components.switch] Error adding entities for domain switch with platform xiaomi_miot
2023-10-27 17:16:24.818 ERROR (MainThread) [homeassistant.components.switch] Error adding entities for domain switch with platform xiaomi_miot
2023-10-27 17:16:24.819 ERROR (MainThread) [homeassistant.components.select] Error adding entities for domain select with platform xiaomi_miot
2023-10-27 17:16:24.820 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform xiaomi_miot
2023-10-27 17:16:24.820 ERROR (MainThread) [homeassistant.components.switch] Error adding entities for domain switch with platform xiaomi_miot
2023-10-27 17:16:24.824 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform xiaomi_miot
2023-10-27 17:16:26.897 WARNING (MainThread) [custom_components.xiaomi_miot.sensor] Get xiaomi message for 2400338245 failed: {'code': 0, 'message': 'ok', 'result': {'messages': None}}
2023-10-27 17:20:10.227 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.cuco_p8amd_7536_power_consumption from integration xiaomi_miot has state class total_increasing, but its state is not strictly increasing. Triggered by state 965907223 (969109193.0) with last_updated set to 2023-10-27T09:18:58.762851+00:00. Please report it to the custom integration author.
2023-10-27 18:06:21.697 WARNING (MainThread) [custom_components.xiaomi_miot.sensor] Get xiaomi message for 2400338245 failed: {'code': 0, 'message': 'ok', 'result': {'messages': None}}
2023-10-27 18:13:06.935 WARNING (MainThread) [custom_components.xiaomi_miot.sensor] Get xiaomi message for 2400338245 failed: {'code': 0, 'message': 'ok', 'result': {'messages': None}}
2023-10-27 18:20:28.130 WARNING (MainThread) [custom_components.xiaomi_miot.sensor] Get xiaomi message for 2400338245 failed: {'code': 0, 'message': 'ok', 'result': {'messages': None}}
2023-10-27 18:20:37.968 WARNING (MainThread) [custom_components.xiaomi_miot.sensor] Get xiaomi message for 2400338245 failed: {'code': 0, 'message': 'ok', 'result': {'messages': None}}
dayvight commented 2 months ago

我也遇到了这个问题,有解决办法嘛?