Created
December 3, 2017 16:22
-
-
Save willwhui/00d15d3e3d13744573ad3d2acedb1bc0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
在hass中使用小米网关人体感应器 |
在automation中使用小米人体感应器
- 方法1
官方文档中提到的激活方式是通过binary sensor的state (on / off),比如:
- alias: "test on sensor turn bool on"
trigger:
- platform: state
entity_id: binary_sensor.motion_sensor_158d000xxxxxc2
from: 'off'
to: 'on'
action:
- service: input_boolean.turn_on
entity_id: input_boolean.test
- 方法2
但是有的地方写道可以用event:type motion
(参见 https://github.com/lazcad/homeassistant)
- alias: "test on sensor turn bool on"
trigger:
- platform: event
event_type: motion
event_data:
entity_id: binary_sensor.motion_sensor_158d000xxxxxc2
action:
- service: input_boolean.turn_on
entity_id: input_boolean.test
但这种模式在官方文档中并不能找到?
- 2017年12月12日注:
请教@cxlwill 之后得知lazcad同志已经不维护这些代码了,还是要用官方的方法
但实际情况发现官方的方法时灵时不灵,有时候hass只会触发event,有时候只会触发motion,不知道为什么?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
经反复测试,发现小米人体感应器有如下问题:
官方文档:
https://home-assistant.io/components/binary_sensor.xiaomi_aqara/