本帖最后由 zxyny1989 于 2022-10-28 17:06 编辑
你看下服务里的例子,然后在自动化-脚本里写
alias: turn_left
sequence:
- service: onvif.ptz
data:
pan: RIGHT
distance: 0.18
target:
entity_id: camera.men_kou_jian_kong_mainstream
mode: single
icon: mdi:arrow-left-bold-circle
上下左右、截图、录制都是可以的。
然后在lovelace中调用
type: custom:button-card
icon: mdi:arrow-left-bold
color: rgb(123, 255, 97)
aspect_ratio: 1.2/0.8
tap_action:
action: call-service
service: script.turn_left
styles: null
card:
- '--mdc-ripple-color': blue
- '--mdc-ripple-press-opacity': 0.5
|