本帖最后由 evantalk 于 2018-8-11 04:51 编辑
更新一下,我不能工作的正真原因无线路由器的问题,wifi连接怎么都不行,改成网线连接瞬间ok, 这条语句self._should_poll = True加不加都无所谓,答案在此
https://github.com/home-assistant/home-assistant/issues/15482
汇报一下,设备lumi.sensor_motion.aq2,环境ubuntu18.04+ha0.75,用了你的方法,没有效果
binary_sensor.motion_sensor_158d00023e38e7 不管怎么都是无效果(未触发)
app里面是有日志的,郁闷了两天了
#小米网关,子设备会自动添加
xiaomi_aqara:
discovery_retry: 5
gateways:
- key: wgtvddi7yk2fsblv
mac: 7811DCF9AFBC
host: 192.168.1.100
class XiaomiMotionSensor(XiaomiBinarySensor):
"""Representation of a XiaomiMotionSensor."""
def __init__(self, device, hass, xiaomi_hub):
"""Initialize the XiaomiMotionSensor."""
self._hass = hass
self._no_motion_since = 0
if 'proto' not in device or int(device['proto'][0:1]) == 1:
data_key = 'status'
else:
data_key = 'motion_status'
XiaomiBinarySensor.__init__(self, device, 'Motion Sensor', xiaomi_hub,
data_key, 'motion')
self._should_poll = True
|