本帖最后由 chenquanhao 于 2024-12-26 22:55 编辑
TPLINK的遮蔽功能,在使用onvif方式接入并没有相应的功能,论坛有人发过折中的办法,我也是在使用这个办法:在app中云台新建两个预置点1和2,配置一个自动化,根据回家和离家情况调用onvif.ptz服务,move_mode选GotoPreset,将镜头旋转到预置点1或2,代码如下,你参考,我这触发条件除了device_tracker.xxxx状态变化,还有特定时间每晚22:01,判断设备是否离家且时间在08:00至22:00之间,是就转到监控位置,否就面壁思过。这个自动化最大的缺点是监控仍一直录音录像,只是不会拍到隐私。
alias: 摄像头-镜头遮蔽
description: ""
mode: single
triggers:
- entity_id:
- device_tracker.xxxx
trigger: state
- at: "22:01:00"
trigger: time
conditions: []
actions:
- if:
- condition: state
entity_id: device_tracker.xxxx
state: not_home
- condition: time
after: "08:00:00"
before: "22:00:00"
then:
- target:
entity_id: camera.xxxx
data:
distance: 0.1
speed: 0.5
continuous_duration: 0.5
preset: "1"
move_mode: GotoPreset
action: onvif.ptz
else:
- target:
entity_id: camera.xxxx
data:
distance: 0.1
speed: 0.5
continuous_duration: 0.5
preset: "2"
move_mode: GotoPreset
action: onvif.ptz
|