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.56k stars 644 forks source link

绿米窗帘 现在开合度 和 目标开合度 有时候会掉线 #1790

Open SodaWithoutSparkles opened 3 months ago

SodaWithoutSparkles commented 3 months ago

Device model / 设备型号

babai.curtain.bb82cb

Component version / 插件版本

0.7.19

HA core version / HA版本

2024.7.3

Integrated mode / 集成方式

Local (本地模式)

The problem / 问题详情

  1. 在使用遥控器控制的时候,没有 curtain.target_position ,因为遥控器只能控制开/合/停。只有经HA控制一次之后才会出现。
  2. curtain_position 只会在手动用 xiaomi_miot.get_properties 查询siid:2, piid:3, 5的时候更新。不会自动更新。除非是经HA设置开合度。

Entity attributes / 实体属性

current_position: 69
model: babai.curtain.bb82cb
lan_ip: 192.168.0.80
mac_address: B8:50:D8:DE:C5:76
entity_class: MiotCoverEntity
home_room: 我的家 客廳
miot_type: urn:miot-spec-v2:device:curtain:0000A00C:babai-bb82cb:1
curtain.fault: 0
curtain.mode.error: "-4004 Other internal errors"
curtain.current_position.error: "-4004 Other internal errors"
state_updater: lan
curtain.motor_control: 0
curtain.target_position: 69
device_information.serial_no.error: "-4004 Other internal errors"
curtain.target_position.error: "-4004 Other internal errors"
device_class: curtain
friendly_name: 窗帘 Curtain
supported_features: 15

Home Assistant Logs / 系统日志

No response

SodaWithoutSparkles commented 3 months ago

解决方法:

  1. 在没有 target_position 的时候,暂时拿 current_position 替代。
  2. interval_seconds 已经设置到3秒了,可能没有更新到?
SodaWithoutSparkles commented 3 months ago

以下是用HA设置开合度100% (全开)之后,用遥控器关闭窗帘到45%,并手动用service更新的attributes:

current_position: 100
model: babai.curtain.bb82cb
lan_ip: 192.168.0.80
mac_address: B8:50:D8:redatced
entity_class: MiotCoverEntity
home_room: redacted
miot_type: urn:miot-spec-v2:device:curtain:0000A00C:babai-bb82cb:1
curtain.fault: 0
curtain.target_position.error: "-4004 Other internal errors"
curtain.mode.error: "-4004 Other internal errors"
state_updater: lan
curtain.target_position: 100
device_class: curtain
friendly_name: Curtain
supported_features: 15
curtain.current_position: 45
curtain.current_position.error: "-4004 Other internal errors"

可以看见 curtain.current_position 已经是45%了,但是由于 current_position 没有更新,HA认为窗帘仍然在 100%