mhoogenbosch
(Martijn Hoogenbosch)
December 20, 2023, 6:45pm
22
I know this is a very old topic. But I switched to the native frigate card PTZ implementation.
Config of card can be found here: dermotduffy/frigate-hass-card: A Lovelace card for Frigate in Home Assistant (github.com)
Most config examples are explained here: PTZ Config Examples · AlexxIT/WebRTC Wiki (github.com)
My config for an IMOU camera:
cameras:
- camera_entity: camera.fynncam_highres
live_provider: ha
view:
default: live
menu:
style: none
live:
zoomable: true
elements:
- type: custom:frigate-card-conditional
conditions:
media_loaded: true
view:
- live
- image
elements:
- type: custom:frigate-card-ptz
orientation: horizontal
style:
right: 85%
top: 75%
transform: scale(3, 3)
service: imou_life.ptz_move
data_left:
device_id: 409787523270cd6a136ece46e403f8fa
duration: 250
operation: LEFT
data_right:
device_id: 409787523270cd6a136ece46e403f8fa
duration: 250
operation: RIGHT
data_up:
device_id: 409787523270cd6a136ece46e403f8fa
duration: 250
operation: UP
data_down:
device_id: 409787523270cd6a136ece46e403f8fa
duration: 250
operation: DOWN
Which looks like this:
benchen27
(Benchen27)
February 8, 2024, 11:11pm
23
Just figured out how to enable frigate-card to handle PTZ. I have Amcrest cameras. Following are my setups.
1, you need to create Amcrest integration, which must be done in config/config.yml Amcrest - Home Assistant This creates amcrest.ptz_control service. If you have other camera brand, you need to figure out how to get ptz control service. frigate card need to use this service to handle PTZ control of the camera.
2, follow GitHub - dermotduffy/frigate-hass-card: A Lovelace card for Frigate in Home Assistant frigate-card-ptz to complete the setup. Note, you need frigate-card-conditional to tell the cameras apart.
My setup also uses go2rtc. I am posting it below for your reference. Note, I have one camera capable to handle two-way audio and the other one doesn’t
type: custom:frigate-card
cameras:
- camera_entity: camera.great_room
live_provider: go2rtc
go2rtc:
modes:
- webrtc
stream: great_roomFeed
- camera_entity: camera.study
live_provider: go2rtc
go2rtc:
stream: studyFeed
menu:
buttons:
timeline:
enabled: false
microphone:
enabled: true
download:
enabled: false
cameras:
enabled: false
live:
controls:
next_previous:
style: none
microphone:
always_connected: false
elements:
- type: custom:frigate-card-conditional
conditions:
camera:
- camera.great_room
elements:
- type: custom:frigate-card-ptz
service: amcrest.ptz_control
style:
right: 0%
top: 70%
background: rgba(255, 255, 255, 0.0)
data_left:
entity_id: camera.great_room_ptz
movement: left
data_right:
entity_id: camera.great_room_ptz
movement: right
data_up:
entity_id: camera.great_room_ptz
movement: up
data_down:
entity_id: camera.great_room_ptz
movement: down
- type: custom:frigate-card-conditional
conditions:
camera:
- camera.study
elements:
- type: custom:frigate-card-ptz
service: amcrest.ptz_control
style:
right: 0%
top: 70%
background: rgba(255, 255, 255, 0.0)
data_left:
entity_id: camera.study_ptz
movement: left
data_right:
entity_id: camera.study_ptz
movement: right
data_up:
entity_id: camera.study_ptz
movement: up
data_down:
entity_id: camera.study_ptz
movement: down
2 Likes
Thanks benchen. Your config example really helped me get my Reolink E1 Pros going.
I added the Onvif integration and configured my camera there then was able to use the service: onvif.ptz.
Then I referenced this configuration as well to guide me: PTZ Config Examples · AlexxIT/WebRTC Wiki · GitHub
mhoogenbosch
(Martijn Hoogenbosch)
April 1, 2024, 10:59am
25
Does anyone know what the controls of frigate.ptz are?
elements:
- type: custom:frigate-card-ptz
orientation: horizontal
style:
right: 85%
top: 75%
transform: scale(3, 3)
service: frigate.ptz
data_left:
entity_id: camera.fynncam
action: move
argument: left
Works but keeps on going left. I don’t know how to stop or set a duration. Adding duration gives an error.
xoripleix
(Xoripleix)
October 14, 2024, 6:26am
26
Hi mhoogenbosch. I managed to get the buttons to start and stop the movement with the following code. While the button is pressed, the camera moves, and when released, it stops. I’m still struggling to get PTZ preset buttons working.
My cam is a Tapo C-500.
type: custom:frigate-card
cameras:
- camera_entity: camera.entrada_bj
elements:
- type: custom:frigate-card-ptz
orientation: horizontal
style:
transform: none
right: 5%
top: 60%
actions_left:
start_tap_action:
action: call-service
service: frigate.ptz
service_data:
entity_id: camera.entrada_bj
action: move
argument: left
end_tap_action:
action: call-service
service: frigate.ptz
service_data:
entity_id: camera.entrada_bj
action: stop
actions_right:
start_tap_action:
action: call-service
service: frigate.ptz
service_data:
entity_id: camera.entrada_bj
action: move
argument: right
end_tap_action:
action: call-service
service: frigate.ptz
service_data:
entity_id: camera.entrada_bj
action: stop
actions_up:
start_tap_action:
action: call-service
service: frigate.ptz
service_data:
entity_id: camera.entrada_bj
action: move
argument: up
end_tap_action:
action: call-service
service: frigate.ptz
service_data:
entity_id: camera.entrada_bj
action: stop
actions_down:
start_tap_action:
action: call-service
service: frigate.ptz
service_data:
entity_id: camera.entrada_bj
action: move
argument: down
end_tap_action:
action: call-service
service: frigate.ptz
service_data:
entity_id: camera.entrada_bj
action: stop
view:
default: live
menu:
style: none
mhoogenbosch
(Martijn Hoogenbosch)
October 14, 2024, 4:33pm
27
I have installed the beta of 6.0.0 card. Which supports native ptz from frigate. Works better for me.