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

领普KS2温湿度传感器双击/单击/长按事件 #837

Open
SmartElec opened this issue Mar 5, 2025 · 6 comments
Open

领普KS2温湿度传感器双击/单击/长按事件 #837

SmartElec opened this issue Mar 5, 2025 · 6 comments
Assignees

Comments

@SmartElec
Copy link

Describe the Bug / 描述问题

在米家app中看到设备没有任何的误触发,但是hass经常检测到双击事件,导致自动化任务误触发

How to Reproduce / 复现步骤

经常随机触发事件

Expected Behavior / 预期结果

正常触发

Reproduce Time / 问题复现的时间点

2025-3-5 10:25

Home Assistant Logs / 系统日志

设备信息:
linp.sensor_ht.ks2bb
制造商:linptech
固件:2.1.1_0044

开发者工具页面只能看到状态里面显示时间的变化.

Log Timezone / 日志时区

Asia/Shanghai

Home Assistant Core Version / Home Assistant Core 版本

2025.2.5

Home Assistant Operation System Version / Home Assistant Operation System 版本

14.2

Xiaomi Home Integration Version / 米家集成版本

v0.2.0

Additional Context / 其他说明

No response

@SmartElec
Copy link
Author

通过xiaomi_gateway3.py添加下面的代码后,可以通过Action来判断了

from custom_components.xiaomi_gateway3.core.devices import *

DEVICES = [{
    21003: ["Linptech", "Temperature Humidity Sensor KS2", "KS2BB", "linp.sensor_ht.ks2bb"],
    "spec": [
        # main sensors
        BLEFloatConv("temperature", "sensor", mi=18433, round=1),  # float
        BLEFloatConv("humidity", "sensor", mi=18440, round=1),  # float
        BLEByteConv("battery", "sensor", mi=20483),  # uint8
        MathConv("temperature", mi="2.p.1001", round=1),
        MathConv("humidity", mi="2.p.1002", round=1),
        BaseConv("battery", mi="4.p.1003", entity=ENTITY_LAZY),
        BaseConv("action", "sensor"),
        ConstConv("action", mi="5.e.1012", value=BUTTON_SINGLE),
        ConstConv("action", mi="5.e.1013", value=BUTTON_DOUBLE),
        ConstConv("action", mi="5.e.1014", value=BUTTON_HOLD),
    ],
}] + DEVICES

ha_xiaomi_home能否添加该设备的事件的稳定触发.

@SusanPhevos
Copy link
Contributor

请您请将日志等级设置为debug级别(方法详见这里),复现问题,并上传HA日志。如果您担心隐私问题,可将日志发送至 [email protected] ,邮件正文附上此 issue 的链接。
HA 检测到事件显示页面,最好也能截图发一下。

@SusanPhevos SusanPhevos self-assigned this Mar 6, 2025
@caibinqing
Copy link
Contributor

触发条件加上 not_fromnot_to 试试,我的KS2可以正常触发的

trigger: state
entity_id:
  - event.linp_cn_blt_3_1***_ks2bb_click_e_5_1012
not_from: unavailable
not_to: unavailable

@SmartElec
Copy link
Author

请您请将日志等级设置为debug级别(方法详见这里),复现问题,并上传HA日志。如果您担心隐私问题,可将日志发送至 [email protected] ,邮件正文附上此 issue 的链接。 HA 检测到事件显示页面,最好也能截图发一下。

可能不太好复现,是随机出现的。

@SmartElec
Copy link
Author

触发条件加上 not_fromnot_to 试试,我的KS2可以正常触发的

trigger: state
entity_id:

  • event.linp_cn_blt_3_1***_ks2bb_click_e_5_1012
    not_from: unavailable
    not_to: unavailable

加上这个就不触发了,还是xiaomi_gateway3更稳定

not_from: unavailable
not_to: unavailable

@SusanPhevos
Copy link
Contributor

邮件日志针对的问题是“米家APP与homeassistant的按键事件不一致”,原因是昨晚出现了流量高峰触发了云服务限流策略导致推送给云端 xiaomi_home 的消息丢失。云服务针对此问题做了修改,请再观察一下。
按键事件误报的问题也请继续帮忙抓取日志,发送日志时也请详细说明误报的时间点。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants