Camera: control ONVIF-compatible cameras

The camera integration currently allows displaying on the dashboard the image from a camera publishing an RTSP stream, and activating the video stream. You can also send a camera image to Telegram from a scene. But we could do more :wink:

When a camera is ONVIF-compatible (this is, for example, the case for TP-Link Tapo cameras), it is technically possible via this standardized protocol to control the camera. See explanations here.

I think it would be useful in Gladys to be able to access the following functions from a scene or the dashboard:

  • enable/disable a camera
  • change the camera’s « horizontal Â» orientation (pan)
  • change the camera’s « vertical Â» orientation (tilt)
  • change the camera’s zoom (zoom)
  • (and if possible) position the camera to one of its presets (pan+tilt+zoom)
  • manage the camera’s motion detection (to use it as a scene trigger)
  • Broadcast text via ‹ text-to-speech â€º on a camera (by making a camera selectable in the action « speak on a speaker Â»).

Some use cases:

  • when I leave the house, enable the cameras (and vice versa when I return)
  • every evening, when I’m away, send me on Telegram a photo from my camera by successively looking at different angles of the room
  • in case of intrusion, broadcast a deterrent message on my camera
  • …

From what I understand of the ONVIF standard, it is the « Profile S Â» that should be taken into account. The ONVIF profiles are described here.

I don’t know if this can help development, but there is a Home Assistant plug-in available on GitHub that handles the ONVIF protocol for Tapo cameras: here