onvif camera platform allows you to use an ONVIF Profile S conformant device in Home Assistant. This requires the
ffmpeg integration to be already configured.
Adding ONVIF to your Home Assistant instance can be done via the user interface, by using this My button:
If the above My button doesn’t work, you can also perform the following steps manually:
Browse to your Home Assistant instance.
In the sidebar click on Settings.
From the configuration menu select: Devices & Services.
In the bottom right, click on the Add Integration button.
From the list, search and select “ONVIF”.
Follow the instruction on screen to complete the set up.
Most of the ONVIF devices support more than one audio/video profile. Each profile provides different image quality, or in the case of an NVR, separate connected cameras. This integration will add entities for all compatible profiles with the video encoding set to H.264. Usually, the first profile has the highest quality and it is the profile used by default. However, you may want to use a lower quality image. You may disable unwanted entities through the Home Assistant UI.
Extra configuration of the integration
You can configure specific FFmpeg options through the integration options flow by clicking the gear icon on the top right of the integration details page.
|RTSP transport mechanism||RTSP transport protocols. The possible options are:
|Extra FFmpeg arguments||Extra options to pass to
|Use wallclock as timestamps||(Advanced Mode only) Rewrite the camera timestamps. This may help with playback or crashing issues from Wi-Fi cameras or cameras of certain brands (e.g., EZVIZ).|
This integration uses the ONVIF pullpoint subscription API to process events into sensors that will be automatically added to Home Assistant. Below is a list of currently supported event topics along with the entities they create.
To help with development of this integration, enable
info level logging for
homeassistant.components.onvif and create an issue on GitHub for any messages that show “No registered handler for event”.
|Topic(s)||Entity Type||Device Class||Description|
|Motion Alarm||Binary Sensor||Motion||Generic motion alarm.|
|Field Detection||Binary Sensor||Motion||Polygonal field detection determines if each object in the scene is inside or outside the polygon.|
|Cell Motion Detection||Binary Sensor||Motion||Cell based motion detection determined by placing a grid over the video source and determining changes.|
|Motion Region Detector||Binary Sensor||Motion||Detects any motion against the specified motion region. The rule is configured for an area defined by a polygon.|
|Detected Sound||Binary Sensor||Sound||Device detected sound.|
|Digital Input||Binary Sensor||None||A digital input was triggered on the device. Amcrest is known to use this as a doorbell button press on the AD410.|
|Relay Triggered||Binary Sensor||None||Device relay output was triggered.|
|Image Too Blurry||Binary Sensor||Problem||Device reports blurry image.|
|Image Too Dark||Binary Sensor||Problem||Device reports dark image.|
|Image Too Bright||Binary Sensor||Problem||Device reports bright image.|
|Global Scene Change||Binary Sensor||Problem||Device reports a large portion of the video content changing. The cause can be tamper actions like camera movement or coverage.|
|Tamper Detector||Binary Sensor||Problem||Detects any kind of tampering to the image sensor.|
|Storage Failure||Binary Sensor||Problem||Storage failure on device.|
|Recording Job State||Binary Sensor||None||Whether or not the device is actively recording.|
|Processor Usage||Sensor||Percent||Device processor usage.|
|Last Reboot||Sensor||Timestamp||When the device was last rebooted.|
|Last Reset||Sensor||Timestamp||When the device was last reset.|
|Last Clock Synchronization||Sensor||Timestamp||When the device clock was last synchronized.|
|Last Backup||Sensor||Timestamp||When the last backup of the device configuration has been retrieved.|
If you are running into trouble with this sensor, please refer to the Troubleshooting section.
If your ONVIF camera supports PTZ, you will be able to pan, tilt or zoom your camera.
|Service data attribute||Description|
||String or list of strings that point at
||Tilt direction. Allowed values:
||Pan direction. Allowed values:
||Zoom. Allowed values:
||Distance coefficient. Sets how much PTZ should be executed in one request. Allowed values: floating point numbers, 0 to 1. Default : 0.1|
||Speed coefficient. Sets how fast PTZ will be executed. Allowed values: floating point numbers, 0 to 1. Default : 0.5|
||PTZ preset profile token. Sets the preset profile token which is executed with GotoPreset.|
||PTZ moving mode. Allowed values:
||Set ContinuousMove delay in seconds before stopping the move. Allowed values: floating point numbers or integer. Default : 0.5|
This integration uses the ONVIF auxiliary command and imaging service to send certain settings and information to the camera via switch entities. Below is a list of currently supported switches.
||Turn infrared lamp on and off via
||Turn autofocus on and off via
||Turn on the lens wiper on and off via the