I can confirm that my camera configured according to your instructions works as ONVIF one in this Lovelace card:
entity: dericam
type: picture-entity
I played with it a bit and can say that the only important thing is port as it’s 5000 by default, hence the camera won’t work without setting it in the component or in the camera settings.
My camera works just fine with NTP/DST enabled, Time Zone enabled and Privilege: Check (have no idea what it is).
The most interesting bit is profile
: I presumed that 0 is first stream, 1 is second stream and 2 is mobile phone stream, but it says in the logs:
WARNING (MainThread) [homeassistant.components.onvif.camera] ONVIF Camera ‘dericam’ doesn’t provide profile 2. Using the last profile.
Any idea how to find out what video resolution does the component get to map profiles to streams?
If you run HA on a hardware that struggles to render hi-resolution video, try a stream with lower resolution (i.e profile 1, 2, etc).
The main reason of having ONVIF camera to me was in being able to call camera.onvif_ptz
service, but it doesn’t work on 0.93.1 - if I try to tilt or pan, if says in the logs:
ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1862350864] Cannot be called from within the event loop
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py”, line 121, in handle_call_service
connection.context(msg))
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1141, in async_call
self._execute_service(handler, service_call))
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1163, in execute_service
await handler.func(service_call)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/onvif/camera.py”, line 84, in async_handle_ptz
entity_ids = extract_entity_ids(hass, service)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py”, line 99, in extract_entity_ids
async_extract_entity_ids(hass, service_call, expand_group), hass.loop
File "/usr/local/lib/python3.7/site-packages/homeassistant/util/async.py", line 138, in run_coroutine_threadsafe
raise RuntimeError(‘Cannot be called from within the event loop’)
RuntimeError: Cannot be called from within the event loop
And when HA starts, there is:
WARNING (MainThread) [homeassistant.components.onvif.camera] PTZ is not available on this camera
but we can PT if logging in via a browser.
Any ideas how to make that work in HA?
It cannot connect to my camera on Step 4 - “Disconnected”.
I also tried their Android app - doesn’t work, sees my camera but always says “Connect Failed” on Step 4. Manual setup fails as well.
On the other hand, Onvifer successfully connects to it and allows PT and transfers video-audio via LAN. G726 codec doesn’t work for me (G711 only).