Hi @apomper
So I’ve got my cameras finally working. They don’t always respond every time I try move them but a reboot of the camera seems to work.
Firstly, I’m using a Picture Elements Card Configuration which I had to setup with the code editor as the visual editor won’t allow it. The coding, for the one camera, is as follows:
type: picture-elements
camera_view: live
camera_image: camera.sonoff_main_camera
elements:
- type: icon
icon: 'mdi:arrow-left-drop-circle'
tap_action:
action: call-service
service: script.main_camera_left
style:
bottom: 45%
left: 5%
color: white
opacity: 0.5
transform: 'scale(1.5, 1.5)'
- type: icon
icon: 'mdi:arrow-right-drop-circle'
tap_action:
action: call-service
service: script.main_camera_right
style:
bottom: 45%
right: 5%
color: white
opacity: 0.5
transform: 'scale(1.5, 1.5)'
- type: icon
icon: 'mdi:arrow-up-drop-circle'
tap_action:
action: call-service
service: script.main_camera_up
style:
top: 10%
left: 46%
color: white
opacity: 0.5
transform: 'scale(1.5, 1.5)'
- type: icon
icon: 'mdi:arrow-down-drop-circle'
tap_action:
action: call-service
service: script.main_camera_down
style:
bottom: 10%
left: 46%
color: white
opacity: 0.5
transform: 'scale(1.5, 1.5)'
- type: icon
icon: 'mdi:arrow-expand-all'
tap_action:
action: more-info
entity: camera.sonoff_main_camera
style:
top: 5%
right: 5%
color: white
opacity: 0.5
transform: 'scale(1.5, 1.5)'
My configuration.yaml file has the following:
camera:
- platform: ffmpeg
name: Sonoff Main Camera
input: -rtsp_transport tcp -i rtsp://rtsp:[email protected]:554/av_stream/ch0
The scripts I have for the PTZ buttons are up, down, left and right. Example below…
main_camera_up:
alias: Main Camera Up
sequence:
- service: sonoff.send_command
data:
device: *input your 6 digit camera number here including the ZERO if it's starts with a ZERO*
cmd: up
mode: single
To answer the issue with the dropping from ‘123456’ to 123456, I configured it in my scripts.yaml with the ’ and ’ and it also dropped it again, after saving the file and restarting HA, but itworks. In my visual editor of my script it looks like this.
The device number shows in a pinky red colour.
Let me know if you don’t come right.
And if anyone knows how to get rid of the, roughly, 7 second delay between pressing the up, down, left or right arrows, before you see the picture actually move, please share.
So the final product looks like this…