AlexxIT / WebRTC

Home Assistant custom component for real-time viewing of almost any camera stream using WebRTC and other technologies.
https://github.com/AlexxIT/Blog
MIT License
1.43k stars 168 forks source link

Simplify custom PTZ controls #147

Open Vinndimon opened 2 years ago

Vinndimon commented 2 years ago

I use a Chinese camera with XMEYE/Sofia. Its' PTZ is controlled with some Python scripts that look like this in my config:

#Street Camera PTZ control
shell_command:
  street_turn_right: python3 /config/python-dvr/right.py
  street_turn_left: python3 /config/python-dvr/left.py
  street_turn_up: python3 /config/python-dvr/up.py
  street_turn_down: python3 /config/python-dvr/down.py

Is it possible to just add shell commands as PTZ controls? Without extra complications such as creating scripts and services? Could you explain how to add my scripts into your integration's PTZ config?

geolos commented 2 years ago

I also have a similar problem. It would be great if I could define what to be called once I press on a PTZ button. For instance currently I am using rest commands to control the camera's up,down,left,right, IR on/off; example for 'up' button is:

rest_command: bobo_room_cam_up: url: http://USERNAME:PASSWORD@10.2.124.80:1024/cgi-bin/hi3510/ytup.cgi

dbuezas commented 1 year ago

See here https://github.com/AlexxIT/WebRTC/wiki/PTZ-Config-Examples#icseedvr-ipnetsurveillancesofia