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.61k stars 657 forks source link

更新插件后,小米空调设备数据无法获取,疑似数据转换失败导致 #1934

Open 375088843 opened 5 days ago

375088843 commented 5 days ago

Device model / 设备型号

xiaomi.aircondition.m4

Component version / 插件版本

v1.0.0b2

HA core version / HA版本

2024.10.4

Integrated mode / 集成方式

Local (本地模式)

The problem / 问题详情

更新插件后,小米空调设备数据无法获取,疑似数据转换失败导致

image

Entity attributes / 实体属性

info: 小米空调
model: xiaomi.aircondition.m4
did: "696931739"
mac: D4:F0:EA:11:7A:26
lan_ip: 192.168.2.34
app_link: mihome://device?uid=2668502681&did=696931739
miot_type: ""
available: true
home_room: L的家 书房
icon: mdi:information
updater: none
updated_at: ""
converters:
  - info
  - indicator_light.on
  - indicator_light.brightness
  - filter.filter_life_level
  - environment.temperature
  - environment.relative_humidity
  - air_conditioner.on
  - air_conditioner.eco
  - air_conditioner.heater
  - air_conditioner.dryer
  - air_conditioner.sleep_mode
  - fan_control.vertical_swing
  - alarm
  - air_conditioner.target_humidity
  - fan_control.fan_level
customizes:
  sensor_properties: electricity.electricity
  switch_properties: >-
    air_conditioner.on,uv,heater,eco,dryer,sleep_mode,soft_wind,horizontal_swing,vertical_swing,alarm.alarm
  select_properties: fan_level
  number_properties: target_humidity
  fan_services: air_fresh
  exclude_miot_services: iot_linkage,machine_state,flag_bit
  exclude_miot_properties: enhance.timer
  miot_type: urn:miot-spec-v2:device:air-conditioner:0000A004:xiaomi-m4:4
device_class: update
friendly_name: 小米空调 信息

Home Assistant Logs / 系统日志

2024-11-08 18:59:23.709 INFO (MainThread) [custom_components.xiaomi_miot.core.device.xiaomi.aircondition.m4] State updater: 1.1.0 🛜 2024-11-08 18:59:23.710 ERROR (MainThread) [homeassistant.components.climate] xiaomi_miot: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 724, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1300, in async_device_update await self.async_update() File "/config/custom_components/xiaomi_miot/climate.py", line 231, in async_update await super().async_update() File "/config/custom_components/xiaomi_miot/init.py", line 1099, in async_update result = await self.device.update_miot_status( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/xiaomi_miot/core/device.py", line 746, in update_miot_status self.dispatch(self.decode(results)) ^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/xiaomi_miot/core/device.py", line 509, in decode self.decode_one(payload, value) File "/config/custom_components/xiaomi_miot/core/device.py", line 524, in decode_one conv.decode(self, payload, value.get('value')) File "/config/custom_components/xiaomi_miot/core/converters.py", line 188, in decode super().encode(device, payload, value / max * 255.0)


TypeError: unsupported operand type(s) for /: 'int' and 'NoneType'
375088843 commented 4 days ago

@al-one 能看看这个问题吗

al-one commented 4 days ago

更新v1分支