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.Configuration
Adding ONVIF to your Home Assistant instance can be done via the userinterface, by taking the following steps:
- Browse to your Home Assistant instance.
- In the sidebar click on Configuration.
- From the configuration menu select: Integrations.
- In the bottom right, click on theAdd Integration button.
- From the list, search and select “ONVIF”.
- Follow the instruction on screen to complete the set up.
Step 1: Get a security camera app running on your old phone(s) To begin, you will need to choose a security-camera app for your phone. Most apps offer many of the same features, such as local. The settings for Onvif cameras are built right into our free surveillance software - click 'Add' then 'IP camera with wizard' to automatically setup your Onvif cameras. Remember to also try connecting via ONVIF as Onvif cameras may support ONVIF connections as well. Start typing in the 'Make' box to find your camera.
After completing, the ONVIF integration will be immediately available for use.
![Camera Camera](https://i.ebayimg.com/images/g/rs0AAOSw6bFdifqJ/s-l300.jpg)
It is recommended that you create a user on your device specifically for Home Assistant. For all current functionality, it is enough to create a standard user.
- To add a camera, use the add device option in the Homey app, select the ONVIF app and follow the prompts. The app uses the ONVIF discovery protocol to detect compatible cameras on you network. The cameras have to be on the same subnet as Homey. Therefore you will have to configure the cameras as directed by the manufacturer first.
- Support for ONVIF compatible cameras. This app supports cameras that comply with the ONVIF S and T profiles. The app has the following features:. Current snapshot. Plus, if the camera supports motion detection:. Motion alert with flow trigger,. Motion snapshot.
- The MVR app is designed to work with as many different devices from various manufacturers that support ONVIF as well as plain HTTP/HTTPS URLs to public or private cameras. Features:. Beautiful and intuitive interface. ONVIF Profile S & G supporting more than 1500+ devices. H263/H264/H265/MJPEG/.
If running Home Asssistant Core in a venv, ensure that libxml2 and libxslt python interfaces are installed via your package manager.
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
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”.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 |
![Onvif Onvif](https://apk4free.net/wp-content/uploads/2018/05/ONVIF-IP-Camera-Monitor-Onvifer.png)
If you are running into trouble with this sensor, please refer to the Troubleshooting section.
Help us to improve our documentation
Suggest an edit to this page, or provide/view feedback for this page.
Suggest an edit to this page, or provide/view feedback for this page.
CONNECTING THE CAMERA TO NETWORK
Getting the camera to connect to the network is still a device-dependent task.For my camera there's no ethernet port for configuration, so it relies ononboard microphone as I/O:
- connect to iOS app
- Specify WIFI connection info in the app
- The app modulates the info in audio wave and use phone's microphone to sendthe info to the camera
- Camera now connects to LAN
Onvif Software For Ip Cameras
GETTING INFORMATION ABOUT THE CAMERA
Now this is where ONVIF shines. It defines a set of standard web services. Thespecs are here. Those services are in WSDL, so using .NET core togenerate client code is really each:
Finding the device IP
I found the device IP by going into my router and searching by MAC (MAC is printed on a label on the camera). Alternatively, device IP can be obtained from the app.
Finding servive endpoints
The ONVIF core spec states that the device management (
devicemgmt.wsdl
)endpoint is fixed to http://onvif_host/onvif/device_service
(section 5.1.1).One useful tool is
camera-probe
. It's a NPM CLI that discoversdevices on LAN. It was able to detect my camera.Using WSDL clients
.NET Core has tool to generate WSDL client given WSDL documents. Adobe photoshop indir. The two web services that're particularly useful are
device.wsdl
(or confusingly devicemgmt.wsdl
) and media.wsdl
.Onvif Windows
To use WSDL clients, the most important namespace is
System.ServiceModel.*
. Creating service clients requires specifying a binding(BasicHttpBinding
), and the servicec endpoint:I used below code to get various information about the device, the streams, andthe detail for each stream:
The
GetStreamUriAsync
call gives the RTSP stream address for stream profileprofile_VideoSource_1
: rtsp://192.168.0.xx:2600/stream0
.Note that this stream needs authentication. The user and password is,unfortunately, device-dependent. For my device, the instrucment is mentioned atAmiccom website under NVR section. It basically says the username is
admin
,the password must be obtained from the app. I do see a generated password in theapp.So I was able to connect to the stream in VLC using the following URI: