Hi, have the same problem, can’t get my camera to work with HomeAssitant
This is my config:
camera:
- platform: onvif
host: 192.168.0.110
I am able to open the steam in VLC and see the video real time with this:
rtsp://192.168.0.110:554/onvif1
Also, I can save a video file to disk using ffmpeg with this:
ffmpeg -i rtsp://192.168.0.110:554/onvif1 -an -c copy -map 0 foo.mp4
When I start HomeAssistant, the startup process is freezes on this line:
2018-02-25 18:20:59 INFO (MainThread) [homeassistant.components.camera] Setting up camera.onvif
It hangs for 90 seconds and then I get:
2018-02-25 18:22:30 ERROR (MainThread) [homeassistant.components.camera] Error while setting up platform onvif
Traceback (most recent call last):
File "/Users/raphaelrissato/.homeassistant/deps/lib/python/site-packages/onvif/client.py", line 34, in wrapped
return func(*args, **kwargs)
File "/Users/raphaelrissato/.homeassistant/deps/lib/python/site-packages/onvif/client.py", line 201, in wrapped
return call(params, callback)
File "/Users/raphaelrissato/.homeassistant/deps/lib/python/site-packages/onvif/client.py", line 191, in call
ret = func(**params)
File "/Users/raphaelrissato/.homeassistant/deps/lib/python/site-packages/suds/client.py", line 559, in __call__
return client.invoke(args, kwargs)
File "/Users/raphaelrissato/.homeassistant/deps/lib/python/site-packages/suds/client.py", line 618, in invoke
result = self.send(soapenv)
File "/Users/raphaelrissato/.homeassistant/deps/lib/python/site-packages/suds/client.py", line 652, in send
reply = transport.send(request)
File "/Users/raphaelrissato/.homeassistant/deps/lib/python/site-packages/suds/transport/http.py", line 178, in send
return HttpTransport.send(self, request)
File "/Users/raphaelrissato/.homeassistant/deps/lib/python/site-packages/suds/transport/http.py", line 78, in send
fp = self.u2open(u2request)
File "/Users/raphaelrissato/.homeassistant/deps/lib/python/site-packages/suds/transport/http.py", line 119, in u2open
return url.open(u2request, timeout=tm)
File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1346, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1321, in do_open
r = h.getresponse()
File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1331, in getresponse
response.begin()
File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 258, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 586, in readinto
return self._sock.recv_into(b)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 189, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/futures.py", line 243, in result
raise self._exception
File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/coroutines.py", line 212, in coro
res = func(*args, **kw)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/camera/onvif.py", line 51, in async_setup_platform
async_add_devices([ONVIFCamera(hass, config)])
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/camera/onvif.py", line 72, in __init__
self._input = media.GetStreamUri().Uri
File "/Users/raphaelrissato/.homeassistant/deps/lib/python/site-packages/onvif/client.py", line 36, in wrapped
raise ONVIFError(err)
onvif.exceptions.ONVIFError: Unknown error: timed out
I am still trying to figure it out. Thanks in advance.