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.42k stars 618 forks source link

绿米S1E开关(lumi.switch.acn032)支持不完整 #1145

Open micturkey opened 1 year ago

micturkey commented 1 year ago

Device model / 设备型号

lumi.switch.acn032

Component version / 插件版本

0.7.9

HA core version / HA版本

2023.5.4

Integrated mode / 集成方式

Automatic (自动模式)

The problem / 问题详情

现在的集成下只能看到三个继电器的开关,看不到18个无线开关以及在米家中提供的熄屏、亮屏等操作的选项

Entity attributes / 实体属性

model: lumi.switch.acn032
lan_ip: 192.168.40.135
mac_address: 54:EF:44:44:A6:9A
entity_class: MiotSwitchEntity
home_room: 洺悦华府 客厅
miot_type: urn:miot-spec-v2:device:switch:0000A003:lumi-acn032:1
switch.on: true
switch.default_power_on_state: 1
switch.fault: 0
theme.screen_sequence: [1]
theme.screen_layout_info: H4sIAAAAAAACA4uuVipOLkpNzfNMUbIy1FHKSazMLy1RsqqGskDCUGa8caKSjlJ5Zkp6akmxklV0tVJyfn5RSmZeYkkqkBsLkwNrKcnMSY03hKsPqSxIBZtfXJqUlZoMUQOShvIh8uZwvl9iLpCvpFSrQ9gWIzRbjNBMNTLDaS0p1hjjtAasxkgJt7WkWGOC3xpjYqyJra2NBQBCvXNZ2QEAAA==
theme.theme_version: 393225
wireless_switch.switch_config: [{"id":"1","name":"吊灯","icon":"icon1"},{"id":"2","name":"灯带","icon":"icon1"},{"id":"3","name":"吸顶灯","icon":"icon1"},{"id":"4","name":"无线开关4","icon":"icon1"},{"id":"5","name":"无线开关5","icon":"icon1"},{"id":"6","name":"无线开关6","icon":"icon1"},{"id":"7","name":"无线开关7","icon":"icon1"},{"id":"8","name":"无线开关8","icon":"icon1"},{"id":"9","name":"无线开关9","icon":"icon1"},{"id":"10","name":"无线开关10","icon":"icon1"},{"id":"11","name":"无线开关11","icon":"icon1"},{"id":"12","name":"无线开关12","icon":"icon1"},{"id":"13","name":"无线开关13","icon":"icon1"},{"id":"14","name":"无线开关14","icon":"icon1"},{"id":"15","name":"无线开关15","icon":"icon1"},{"id":"16","name":"无线开关16","icon":"icon1"},{"id":"17","name":"无线开关17","icon":"icon1"},{"id":"18","name":"无线开关18","icon":"icon1"}]
power_consumption: 0.391
electric_power-10-6: 4.281
power_consumption_accumulation_way-10-7: false
no_disturb: true
no_disturb.enable_time_period: 22:00-07:00
speaker.mute: false
speaker.volume: 2
screen.brightness: 50
screen.auto_screen_off_time: 15
screen.on: true
screen-7.switch_status: false
state_updater: cloud
sub_entities: power_consumption-10.power_consumption-1, power_consumption-10.electric_power-6
device_class: switch
friendly_name: Aqara Smart Magic Switch S1E Left Switch Service
supported_features: 0

Home Assistant Logs / 系统日志

Logger: homeassistant.components.sensor Source: components/sensor/init.py:648 Integration: 传感器 (documentation, issues) First occurred: 14:46:41 (1 occurrences) Last logged: 14:46:41 Entity sensor.lumi_acn032_a69a_electric_power (<class 'custom_components.xiaomi_miot.sensor.MiotSensorSubEntity'>) is using native unit of measurement 'watt' which is not a valid unit for the device class ('power') it is using; expected one of ['W', 'kW']; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

al-one commented 1 year ago

息屏开关等实体已添加,但是无线开关无法支持。 因为本插件通过轮询是方式获取设备状态,无法实时监听无线开关所产生的按键事件。

micturkey commented 1 year ago

息屏开关等实体已添加,但是无线开关无法支持。 因为本插件通过轮询是方式获取设备状态,无法实时监听无线开关所产生的按键事件。

谢谢!无线开关看来只能再想别的办法了。 另外有一个问题,我通过了自定义组件的方法添加了screen_on开关,但是发现他是有两个同名的项目的,经过测试其中一个项目代表了是否打开屏保,而另一个项目才是是否打开屏幕。 具体的,在 https://home.miot-spec.com/spec?type=urn:miot-spec-v2:device:switch:0000A003:lumi-acn032:1 中可以看到有两个screen_on