本帖最后由 xiaopi 于 2020-11-2 15:06 编辑
环境:门口树莓派运行monitor服务(带参数-x -u),门口有一个小米人体感应,一个门磁。离家检测测如下:
-alias: '离家检测 '
description: ''
trigger:
- platform: state
entity_id: binary_sensor.motion_sensor_158d0002f0dd2a
from: 'off'
to: 'on'
- platform: state
entity_id: binary_sensor.door_window_sensor_158d0002a1637a
attribute: 'off'
from: 'on'
condition:
- condition: state
entity_id: alarm_control_panel.home_alarm
state: disarmed
action:
- service: mqtt.publish
data:
topic: monitor/scan/DEPART
- delay: '60'
- service: mqtt.publish
data:
topic: monitor/scan/DEPART
mode: single
回家检测:
alias: 回家检测
description: ''
trigger:
- platform: state
entity_id: binary_sensor.door_window_sensor_158d0002a1637a
from: 'off'
to: 'on'
- platform: state
entity_id: binary_sensor.motion_sensor_158d0002f0dd2a
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: alarm_control_panel.home_alarm
state: armed_away
action:
- service: mqtt.publish
data:
topic: monitor/scan/ARRIVE
mode: single
遇到了几个问题
回家开门时,能迅速检测到手机,然后执行回家模式,但是当我手机拿到书房后,蓝牙从100到0,又马上执行离家模式了。
我的思考和疑问:
1,能不能通过MQTT发送消息检测,平时不检测,比如回家检测时检测到在家,就一直认为在家,直到下一个mqtt消息来。
2,在现有条件下没有蓝牙全覆盖的情况下怎么做有人没人的判断呢。有路由traker,不知道怎么和这个结合。
3,能你把你的自动化作业给我抄抄吗。
4,不知道哪里逻辑不对,望扶正,谢谢。
|