Support for ONVIF (standard for IP cameras etc)

the ONVIF standard for IP cameras among other things seems to be something that could be supported by Home Assistant.

There is even a Python module to communicate with ONVIF-enabled devices: https://github.com/quatanium/python-onvif

5 Likes

did you ever started with that? Iā€™m in the same situation now.

ONVIF Support would be great!

I thought i need the ONVIF support, because I was not able to get my rstp stream.
But with RTSP support i could get my ONVIF RSTP Stream on HA.

Hi. I donā€™t understand what is wrong with my configuration.
In VLC software, if i put the stream like this, i had the stream working well.
rtsp://ip/onvif1
rtsp://ip:554/onvif1
rtsp://ip:554/onvif2
In the home assistant, i try to use the ffmeg like it was suggest here and itā€™s not working.

camera:
platform: ffmpeg
input: rtsp://ip:554/onvif1

What am I doing wrong?

ffmpeg:
  ffmpeg_bin: /usr/bin/avconv

camera 1:
   - platform: ffmpeg
     ffmpeg_bin: /usr/bin/avconv
     name: Camera
     input: -rtsp_transport tcp -i rtsp://192.168.1.30/live/ch00_1
     extra_arguments: -pred 1 -q:v 2

This is the code I am using and it is working for me. The /live/ch00_1 might be different for you.

2 Likes

Thanks for the response. Iā€™ll try again with this setting when I get home.

This reply help me to understand what was wrong in my config.

https://community.home-assistant.io/t/rtsp-support/2306/9

tmjpugh2d
@mischoe
Below if for install on Raspberry pi that does not use Virtual Env

1.install ffmpeg. AKA ā€œavconvā€

sudo apt install libav-tools

2.add location of ffmpeg (or avconv) to configuration.yaml file. below location is example only. you must find yours

ffmpeg:
ffmpeg_bin: /usr/bin/avconv
3.add camera to configuration.yaml file
FYI. There are many android/ios app support ONVIF to find IP cam RTSP address if you do not know this

camera:

  • platform: ffmpeg
    input: rtsp://192.168.0.20:554/live0.264
    name: CAM_1_RTSP
    you can run FFMPEG at command line to verify camera playback

Iā€™ve written the onvif component. Iā€™ve had is as a custom component for a few weeks now and itā€™s similified the IP cameraā€‹ setup.
I have several Chinese ipcams and it works fine with them all.
I canā€™t see why it wouldnā€™t work with others.

It does require ffmpeg to be installed and setup.

1 Like

Is anyone able to pull a .jpg with an ONVIF camera for notification in HA?

Is it going to make its way in to a future release? Is it capable of recording on motion detect/alarm?

My raspberry pi 3 crashes a few minutes after enabling my Chinese IP cameras because of ffmpegā€¦ looking for a alternative to integrate them with hass.io. any ideas?

I had struggled to get the correct URL for the stream and then had to fiddle with the ffmpeg commands to get it working reliably. I also first used avconv but that was unreliable so i switched to use ffmpeg from the Jessie backports, that resolved several issues with the rtsp streams.
Thatā€™s what made me write the component. Mine is running on a pi2 with hassbian.
I wanted to release the working version, then extra features can be added. The main issue I have found is trying to work out what the camera supports. Currently Iā€™ve got PTZ working but itā€™s not user friendly so Iā€™ll be working on that once the first version is merged.

Matt

1 Like

Any further work on the PTZ aspects?

Thoughts on subscriptions to Onvif events, e.g. movement?

1 Like

Not really as several people have had issues which meant I spent time fixing them, and Iā€™ve not had much time due to my 6 month old daughter.

I simply canā€™t get my Sricam SP009 camera to work with Hassio V53. I have tried both of the config settings below with the same result. I get an image under ā€œFront Windowā€ in my dashboard, but it quickly locks everything up where I canā€™t refresh the dashboard page and there are no new entries in the log. A ā€˜hassio host rebootā€™ is the only way to recover. Also, the rtsp url below works fine with FFMPEG from the command line (on my Mac at least).

Both of these config settings seemed to work initially, but eventually locked up the system

camera:
  - platform: onvif
    name: Front Window
    host: 192.168.0.53

camera:
  - platform: ffmpeg
    name: Front Window
    input: rtsp://192.168.0.53:554/onvif1

Here is the log right after it locks, nothing new is ever recorded after this:

2017-09-14 09:29:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=media_player.porch, old_state=None, new_state=<state media_player.porch=off; friendly_name=Porch, supported_features=21437 @ 2017-09-14T09:29:05.912794-04:00>>
2017-09-14 09:29:05 INFO (MainThread) [homeassistant.components.http] Serving /api/camera_proxy/camera.front_window to 192.168.0.6 (auth: True)
2017-09-14 09:29:11 INFO (SyncWorker_5) [pychromecast] Querying device status
2017-09-14 09:29:11 WARNING (MainThread) [homeassistant.components.media_player] Setup of platform cast is taking over 10 seconds.
2017-09-14 09:29:11 INFO (SyncWorker_5) [pychromecast] Querying device status
2017-09-14 09:29:12 INFO (SyncWorker_5) [pychromecast] Querying device status
2017-09-14 09:29:12 INFO (SyncWorker_5) [pychromecast] Querying device status
2017-09-14 09:29:12 INFO (SyncWorker_5) [pychromecast] Querying device status
2017-09-14 09:29:12 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=media_player.home_group, old_state=None, new_state=<state media_player.home_group=off; friendly_name=Home group, supported_features=21437 @ 2017-09-14T09:29:12.387023-04:00>>
2017-09-14 09:29:12 INFO (MainThread) [homeassistant.components.http] Serving /api/camera_proxy/camera.front_window to 192.168.0.6 (auth: True)

Any help appreciated here!
Bob

1 Like

Hi there. Same goes for my Digoo DG-M1Xā€¦
I hope someone finds a solution, I have to remove the camera for now because it freezes everythingā€¦ :-S

Same problem here. I donā€™t know whyā€¦

As a temporary workaround, I have a secondary raspberry with a clean raspbian + ffmpeg transforming the rtsp stream into mjpegā€¦ The mjpeg stream is imported without an issueā€¦ :-S

1 Like