The onvif
camera platform allows you to use an ONVIF Profile S conformant device in Home Assistant. This requires the ffmpeg
component to be already configured.
Onvif is a standard in the IP/Security world, which allows interoperability between IP security devices, even if they are branded differently. It's important to note that there are various profiles of Onvif. For example, LTS/Hikvision, ACTi, and KT&C are Onvif Profile-S. And Dahua and Uniview are Onvif 2 or higher. Suppose your router's public IP is 109.173.137.12 and you have forwarded external port 8080 to the camera's ONVIF port 80, you can set up your camera with address 109.173.1, and access it anywhere in the world. The above method of WAN access assumes the public IP address of the router is static (i.e. Does not change).
Configuration
Home Assistant offers ONVIF integration through Configuration -> Integrations -> ONVIF. Follow the instructions to get it set up.
Configuration Notes
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.
Option | Description |
---|---|
RTSP transport mechanism | RTSP transport protocols. The possible options are: tcp , udp , udp_multicast , http . |
Extra FFmpeg arguments | Extra options to pass to ffmpeg , e.g., image quality or video filter options. More details in ffmpeg component. |
Supported Sensors
Onvif Port Settings
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 component, enable info
level logging for homeassistant.components.onvif
and create an issue on GitHub for any messages that show 'No registered handler for event'.
Foscam Rtsp
Topic(s) | Entity Type | Device Class | Description |
---|---|---|---|
tns1:VideoSource/MotionAlarm | Binary Sensor | Motion | Generic motion alarm. |
tns1:RuleEngine/FieldDetector/ObjectsInside | Binary Sensor | Motion | Polygonal field detection determines if each object in the scene is inside or outside the polygon. |
tns1:RuleEngine/CellMotionDetector/Motion | Binary Sensor | Motion | Cell based motion detection determined by placing a grid over the video source and determining changes. |
tns1:AudioAnalytics/Audio/DetectedSound | Binary Sensor | Sound | Device detected sound. |
tns1:VideoSource/ImageTooBlurry/AnalyticsService tns1:VideoSource/ImageTooBlurry/ImagingService tns1:VideoSource/ImageTooBlurry/RecordingService | Binary Sensor | Problem | Device reports blurry image. |
tns1:VideoSource/ImageTooDark/AnalyticsService tns1:VideoSource/ImageTooDark/ImagingService tns1:VideoSource/ImageTooDark/RecordingService | Binary Sensor | Problem | Device reports dark image. |
tns1:VideoSource/ImageTooBright/AnalyticsService tns1:VideoSource/ImageTooBright/ImagingService tns1:VideoSource/ImageTooBright/RecordingService | Binary Sensor | Problem | Device reports bright image. |
tns1:VideoSource/GlobalSceneChange/AnalyticsService tns1:VideoSource/GlobalSceneChange/ImagingService tns1:VideoSource/GlobalSceneChange/RecordingService | Binary Sensor | Problem | Device reports a large portion of the video content changing. The cause can be tamper actions like camera movement or coverage. |
tns1:RuleEngine/TamperDetector/Tamper | Binary Sensor | Problem | Tamper Detection. |
tns1:Device/HardwareFailure/StorageFailure | Binary Sensor | Problem | Storage failure on device. |
tns1:Monitoring/ProcessorUsage | Sensor | Percent | Device processor usage. |
tns1:Monitoring/OperatingTime/LastReboot | Sensor | Timestamp | When the device was last rebooted. |
tns1:Monitoring/OperatingTime/LastReset | Sensor | Timestamp | When the device was last reset. |
tns1:Monitoring/OperatingTime/LastClockSynchronization | Sensor | Timestamp | When the device clock was last synchronized. |
Service onvif.ptz
If your ONVIF camera supports PTZ, you will be able to pan, tilt or zoom your camera.
Service data attribute | Description |
---|---|
entity_id | String or list of strings that point at entity_id s of cameras. Use entity_id: all to target all. |
tilt | Tilt direction. Allowed values: UP , DOWN , NONE |
pan | Pan direction. Allowed values: RIGHT , LEFT , NONE |
zoom | Zoom. Allowed values: ZOOM_IN , ZOOM_OUT , NONE |
distance | Distance coefficient. Sets how much PTZ should be executed in one request. Allowed values: floating point numbers, 0 to 1. Default : 0.1 |
speed | Speed coefficient. Sets how fast PTZ will be executed. Allowed values: floating point numbers, 0 to 1. Default : 0.5 |
preset | PTZ preset profile token. Sets the preset profile token which is executed with GotoPreset. |
move_mode | PTZ moving mode. Allowed values: ContinuousMove , RelativeMove , AbsoluteMove , GotoPreset , Stop . Default :RelativeMove |
continuous_duration | Set ContinuousMove delay in seconds before stoping the move. Allowed values: floating point numbers or integer. Default : 0.5 |
Foscam Onvif Port
If you are running into trouble with this sensor, please refer to the Troubleshooting section.
ONVIF profiles make it easy to recognize how ONVIF conformant devices and clients are compatible with one another. An ONVIF profile has a fixed set of features that must be supported by a conformant device and client. It ensures that a client that conforms to Profile S, for example, will work with a device that also conforms to Profile S. There are also conditional features, which are features that shall be implemented by an ONVIF device or ONVIF client if it supports that feature in any way, including any proprietary way. The underlying functions of the features included in a profile are defined in the ONVIF Network Interface Specifications.
Clients and devices can support more than one ONVIF profile; for instance, a network camera with local storage can conform to both Profile S and G.
Conformance to profiles is the only way that ensures compatibility between ONVIF conformant products; therefore, only registered products with conformance to a profile are considered to be ONVIF conformant.
Profiles A and C are relevant for access control systems. Profiles G, Q, S and T are relevant for video systems.
To ensure effective interoperability of IP-based physical security products, ONVIF provides specifications referencing state-of-the-art cybersecurity standards. Compliance to regulations, however, are outside the scope of ONVIF.
Manufacturers, system architects and/or integrators are responsible for checking regulatory and other local requirements, ensuring solid product and system design, and implementing the appropriate security level for the use case.
ONVIF Profile Feature Overview
Click on the ONVIF Profile Feature Overview v2.3 (Dec. 2019) to get an overview and a comparison of the features supported by all ONVIF profiles, and whether the features are considered mandatory (M) or conditional (C) for a conformant device or client. This allows you to determine at a glance the set of ONVIF profiles that may be of interest to you. You can then search on the ONVIF Conformant Product page for device and/or client products that implement those profiles.
Video
ONVIF Profile Policy
The following Profile Policy document details the underlying principles of the profile concept. It explains how and why a new profile can be proposed, a step-by-step description for the creation, modification and deprecation process, as well as rules to ensure the profile concept stays consistent over time. ONVIF Profile Policy v2.0 (Sept. 2014)