Core: ONVIF integration is not working anymore, PTZ was not working before!

Created on 20 May 2020  ·  50Comments  ·  Source: home-assistant/core

The problem


In the version before my ONVIF camera was working fine and showed a video without any problem.
PTZ was not working, there is already an issue with it from me.

Environment

  • Home Assistant Core release with the issue: 0.110.0
  • Last working Home Assistant Core release (if known): 1.109.x
  • Operating environment (Home Assistant/Supervised/Docker/venv): HassOS on a Pi 4B
  • Integration causing this issue: ONVIF
  • Link to integration documentation on our website:

Problem-relevant configuration.yaml


This is the config I used before:

ffmpeg:

camera:
  - platform: onvif
    host: 192.168.178.32
    port: 5000
    username: <Username>
    password: <Password>
    rtsp_transport: udp
    extra_arguments: -rtsp_flags none -rtsp_transport udp -q:v 2 
    name: Rundum

Traceback/Error logs


These are the messages in the log:

2020-05-20 14:05:53 WARNING (MainThread) [homeassistant.components.onvif] Couldn't get device 'Rundum' date/time. Error: None
2020-05-20 14:05:55 WARNING (MainThread) [homeassistant.components.onvif] Couldn't connect to camera 'Rundum', but will retry later. Error: None
2020-05-20 14:05:55 WARNING (MainThread) [homeassistant.config_entries] Config entry for onvif not ready yet. Retrying in 5 seconds.
2020-05-20 14:06:07 WARNING (MainThread) [homeassistant.components.onvif] Couldn't get device 'Rundum' date/time. Error: None
2020-05-20 14:06:12 WARNING (MainThread) [homeassistant.components.onvif] Couldn't connect to camera 'Rundum', but will retry later. Error: None
2020-05-20 14:06:12 WARNING (MainThread) [homeassistant.config_entries] Config entry for onvif not ready yet. Retrying in 10 seconds.
2020-05-20 14:06:24 WARNING (MainThread) [homeassistant.components.onvif] Couldn't get device 'Rundum' date/time. Error: None
2020-05-20 14:06:26 WARNING (MainThread) [homeassistant.components.onvif] Couldn't connect to camera 'Rundum', but will retry later. Error: None
2020-05-20 14:06:26 WARNING (MainThread) [homeassistant.config_entries] Config entry for onvif not ready yet. Retrying in 20 seconds.
2020-05-20 14:06:48 WARNING (MainThread) [homeassistant.components.onvif] Couldn't get device 'Rundum' date/time. Error: None
2020-05-20 14:06:50 WARNING (MainThread) [homeassistant.components.onvif] Couldn't connect to camera 'Rundum', but will retry later. Error: None
2020-05-20 14:06:50 WARNING (MainThread) [homeassistant.config_entries] Config entry for onvif not ready yet. Retrying in 40 seconds.

Additional information

Now I set the name to “Rundum”, host to “192.168.178.32”, port to “5000”, username to the same username, password to the same password, extra options to: “-rtsp_flags none -rtsp_transport udp -q:v 2” and transport to “udp”.
But it doesn’t work!

Here is the old issue with PTZ not working: https://github.com/home-assistant/core/issues/34641

onvif

Most helpful comment

Also my cameras work with ODM.

Sorry @hunterjm but I do not understand. I get that this is a free project and we are extremely grateful for your efforts/work. But our cameras were working before the latest update.

I am not a professional coder but usually newer software versions improve things by extending support, not by breaking what was working before.

When I started using Home Assistant I was able to use my cameras with PTZ, then I had to switch to generic camera. Then ONVIF was working again but without PTZ. Now we have to switch back to generic camera...

It seems to me that the real problem is that every camera manufacturer does whatever he wants with ONVIF spec...

All 50 comments

Did you try to set it up via the integration panel?

Hey there @hunterjm, mind taking a look at this issue as its been labeled with a integration (onvif) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

Did you try to set it up via the integration panel?

Yes, that is what I described in Additional information. It is not possible to use the config in configuration.yaml anymore.

What is the device Make/Model? Were you getting the same date/time warning in earlier versions? Can you turn on debug for homeassistant.components.onvif in logger to see if there is more info? Failing to get date/time should not fail setup, but it's possible your device is not responding correctly to a subsequent API setup step.

I added the link to the old PTZ issue.

What is the device Make/Model?

The camera is this one: https://extrastar-led.de/elektronik-fuer-haushalt/81-960p-hd-wi-fi-ueberwachungskamera-ip-kamera-8432011627501.html
It is controlled by the Yoosee-App: https://apps.apple.com/de/app/yoosee/id981863450

There were no date/time warnings before.

Can you turn on debug for homeassistant.components.onvif in logger

I set this in configuration.yaml:

logger:
  default: critical
  logs:
    homeassistant.components.onvif: debug

But there are no more messages.

These are the messages at new start:

2020-05-20 22:42:11 WARNING (MainThread) [homeassistant.components.onvif] Couldn't connect to camera 'Rundum', but will retry later. Error: None
2020-05-20 22:42:11 WARNING (MainThread) [homeassistant.config_entries] Config entry for onvif not ready yet. Retrying in 5 seconds.
2020-05-20 22:42:27 DEBUG (MainThread) [homeassistant.components.onvif] Setting up the ONVIF device management service
2020-05-20 22:42:28 DEBUG (MainThread) [homeassistant.components.onvif] Retrieving current device date/time
2020-05-20 22:42:29 WARNING (MainThread) [homeassistant.components.onvif] Couldn't get device 'Rundum' date/time. Error: None
2020-05-20 22:42:33 WARNING (MainThread) [homeassistant.components.onvif] Couldn't connect to camera 'Rundum', but will retry later. Error: None
2020-05-20 22:42:33 WARNING (MainThread) [homeassistant.config_entries] Config entry for onvif not ready yet. Retrying in 10 seconds.
2020-05-20 22:42:44 DEBUG (MainThread) [homeassistant.components.onvif] Setting up the ONVIF device management service
2020-05-20 22:42:45 DEBUG (MainThread) [homeassistant.components.onvif] Retrieving current device date/time
2020-05-20 22:42:45 WARNING (MainThread) [homeassistant.components.onvif] Couldn't get device 'Rundum' date/time. Error: None

Kind of same problem. Removed 3 ONVIF cameras in configuration.yaml, restarted and trying to set up via integration in the UI. It finds the cameras but when selecting one of them and giving in user and password for it I get the error "Could not configure unique ID for ONVIF device"

I don't know if it is important, the integration panel looks like this:
Bildschirmfoto 2020-05-20 um 22 48 48

So the camera can not be clicked.

Kind of same problem. Removed 3 ONVIF cameras in configuration.yaml, restarted and trying to set up via integration in the UI. It finds the cameras but when selecting one of them and giving in user and password for it I get the error "Could not configure unique ID for ONVIF device"

Exactly the same problem on my installation. Before 0.110 works fine.

Kind of same problem. Removed 3 ONVIF cameras in configuration.yaml, restarted and trying to set up via integration in the UI. It finds the cameras but when selecting one of them and giving in user and password for it I get the error "Could not configure unique ID for ONVIF device"

This is a different issue than the one this ticket was created for. Please create a new issue at https://github.com/home-assistant/core/issues if one does not yet exist and include the exact error message and relevant homeassistant.log entries.

same problem onvif don't work after update to 0.110 :( have to delete everything in yaml because otherwise HA wont boot :( after configurating integration it was added but cant view camera

Error setting up entry * - 00:12:41:67:d6:7a for onvif
Error setting up entry *
- 00:12:41:40:a9:d0 for onvif
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 217, in async_setup
hass, self
File "/usr/src/homeassistant/homeassistant/components/onvif/__init__.py", line 73, in async_setup_entry
if not await device.async_setup():
File "/usr/src/homeassistant/homeassistant/components/onvif/device.py", line 99, in async_setup
self.capabilities = await self.async_get_capabilities()
File "/usr/src/homeassistant/homeassistant/components/onvif/device.py", line 234, in async_get_capabilities
pullpoint = event_capabilities.WSPullPointSupport
AttributeError: 'NoneType' object has no attribute 'WSPullPointSupport'

same problem onvif don't work after update to 0.110 :( have to delete everything in yaml because otherwise HA wont boot :( after configurating integration it was added but cant view camera

Error setting up entry * - 00:12:41:67:d6:7a for onvif
Error setting up entry *
- 00:12:41:40:a9:d0 for onvif
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 217, in async_setup
hass, self
File "/usr/src/homeassistant/homeassistant/components/onvif/init.py", line 73, in async_setup_entry
if not await device.async_setup():
File "/usr/src/homeassistant/homeassistant/components/onvif/device.py", line 99, in async_setup
self.capabilities = await self.async_get_capabilities()
File "/usr/src/homeassistant/homeassistant/components/onvif/device.py", line 234, in async_get_capabilities
pullpoint = event_capabilities.WSPullPointSupport
AttributeError: 'NoneType' object has no attribute 'WSPullPointSupport'

This is a different issue See #35846 and #35885

Actually looks like the two may be related. The result looks similar... @carsten-h, do you see any other errors anywhere in your log that looks like the one above?

No, there are no other errors!
Maybe it is interesting that the automatic search doesn‘t show the camera, I have to enter it manually.

Also my cameras stopped working. My cameras look exactly the same model as the ones from @carsten-h, and are controlled by the Yoosee-App. I get the same errors in the log.

However I was actually able to add those cameras from the integrations panel and I can click and modify their properties.

BTW, I also have the same problems with PTZ controls.

However I was actually able to add those cameras from the integrations panel and I can click and modify their properties.

That is also possible here! But not more.

Have same problem like TS

@carsten-h (or anybody who has an empty integration pane with no devices) - Can you update your logger configuration to look like the following and post a link to the entire contents to help debug?

logger:
  default: critical
  logs:
    homeassistant.components.onvif: debug
    zeep: debug

Yes, i will do this evening!

The integration pane shows the camera, but it is not clickable if it should be. It also shows the correct MAC address.

... I found the time now to log it.
onvif.log

Does anyone got it working?
It’s driving me crazy!!

Same problem here, similar cam, same app to control it, same error:

May 22 17:07:12 raspberrypi hass[4210]: 2020-05-22 17:07:12 WARNING (MainThread) [homeassistant.components.onvif] Couldn't connect to camera 'Ingresso', but will retry later. Error: None
May 22 17:07:12 raspberrypi hass[4210]: 2020-05-22 17:07:12 WARNING (MainThread) [homeassistant.config_entries] Config entry for onvif not ready yet. Retrying in 80 seconds.
May 22 17:08:26 raspberrypi hass[4210]: 2020-05-22 17:08:26 WARNING (MainThread) [homeassistant.components.onvif] Couldn't get device 'Box' date/time. Error: None
May 22 17:08:29 raspberrypi hass[4210]: 2020-05-22 17:08:29 WARNING (MainThread) [homeassistant.components.onvif] Couldn't connect to camera 'Box', but will retry later. Error: None
May 22 17:08:29 raspberrypi hass[4210]: 2020-05-22 17:08:29 WARNING (MainThread) [homeassistant.config_entries] Config entry for onvif not ready yet. Retrying in 80 seconds.

Schermata 2020-05-22 alle 16 36 57

no entity created, can't use it

Hi, @hunterjm I have a similar issue:

my Chinese PTZ camera worked in onvif before 110 but now I have no device/entity in integrations:

image

Onvif Device Manager v2.2.250 detects it perfectly.

Ha error says:

Error setting up entry cancelloonvif - 00:2a:2a:41:9f:91 for onvif Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 217, in async_setup hass, self File "/usr/src/homeassistant/homeassistant/components/onvif/__init__.py", line 83, in async_setup_entry if device.capabilities.events and await device.events.async_start(): File "/usr/src/homeassistant/homeassistant/components/onvif/event.py", line 83, in async_start await self.async_parse_messages(response.NotificationMessage) File "/usr/src/homeassistant/homeassistant/components/onvif/event.py", line 147, in async_parse_messages topic = msg.Topic._value_1 AttributeError: 'NoneType' object has no attribute '_value_1

I activated onvif and zeep debug but the log is more than 40000 lines,
I posted here https://paste.ubuntu.com/p/8Sc3VjnSNZ/ the first 5000.
If you need more lines tell me how to send them to you.
Thanks

@mgiako - this is definitely a separate issue than the one here. Please create a new issue in GitHub. Also, generally speaking the last lines in the log are more helpful than the first.

@hunterjm ok, opened a new issue: https://github.com/home-assistant/core/issues/35990.
Thanks

Just updated to HomeAssistant 0.110.2 which as far as I understand should include the fix. However, the problem mentioned by @carsten-h is still present for me.

Yes, 0.110.2 is not fixing it for me also!

I deleted the ONVIF integration, rebooted HassOS and then added the camera again, rebooted a second time, but nothing changed. It is still not working in 0.110.2!

@Veda82 @carsten-h - Can you provide the latest log files with the configuration below enabled:

logger:
  default: critical
  logs:
    homeassistant.components.onvif: debug
    zeep: debug

Can you provide the latest log files

Here they are:
onvif0.110.2.log

One question: I have to have "ffmpeg:" inside the configuration.yaml and "camera:" is not necessary?

Same for me, 110.2 is not fixing

Do you all have the same device? This is 100% an issue with the firmware on your camera reporting the wrong services:

        <tds:GetCapabilitiesResponse>
            <tds:Capabilities>
                <tt:Device>
                    <tt:XAddr>http://192.168.178.32:5000/onvif/device_service</tt:XAddr>
                    <tt:Network>
                        <tt:IPFilter>false</tt:IPFilter>
                        <tt:ZeroConfiguration>false</tt:ZeroConfiguration>
                        <tt:IPVersion6>false</tt:IPVersion6>
                        <tt:DynDNS>false</tt:DynDNS>
                        <tt:Extension>
                            <tt:Dot11Configuration>false</tt:Dot11Configuration>
                        </tt:Extension>
                    </tt:Network>
                </tt:Device>
                <tt:Events>
                    <tt:XAddr>http://192.168.178.32:5000/onvif/media_service</tt:XAddr>
                    <tt:WSSubscriptionPolicySupport>true</tt:WSSubscriptionPolicySupport>
                    <tt:WSPullPointSupport>true</tt:WSPullPointSupport>
                    <tt:WSPausableSubscriptionManagerInterfaceSupport>true</tt:WSPausableSubscriptionManagerInterfaceSupport>
                </tt:Events>
                <tt:Media>
                    <tt:XAddr>http://192.168.178.32:5000/onvif/ptz_service</tt:XAddr>
                    <tt:StreamingCapabilities>
                        <tt:RTPMulticast>false</tt:RTPMulticast>
                        <tt:RTP_TCP>true</tt:RTP_TCP>
                        <tt:RTP_RTSP_TCP>true</tt:RTP_RTSP_TCP>
                    </tt:StreamingCapabilities>
                </tt:Media>
                <tt:PTZ>
                    <tt:XAddr>http://192.168.178.32:5000/onvif/deviceio_service</tt:XAddr>
                </tt:PTZ>
                <tt:Extension>
                    <tt:DeviceIO>
                        <tt:XAddr>http://192.168.1.33:5000/onvif/device_service</tt:XAddr>
                        <tt:VideoSources>1</tt:VideoSources>
                        <tt:VideoOutputs>0</tt:VideoOutputs>
                        <tt:AudioSources>1</tt:AudioSources>
                        <tt:AudioOutputs>0</tt:AudioOutputs>
                        <tt:RelayOutputs>0</tt:RelayOutputs>
                    </tt:DeviceIO>
                </tt:Extension>
            </tds:Capabilities>
        </tds:GetCapabilitiesResponse>

It's telling us that the events service endpoint is the media service url, and the media service is the PTZ service, and the PTZ service is the deviceio service. There's nothing I can really do here. My recommendation would be to add these cameras as generic cameras using the RTSP and Snapshot URLs directly, instead of ONVIF.

This is mine:
https://www.amazon.it/gp/product/B01DMBQULG/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

and this is working configuration in 109.6:

camera:
  - platform: onvif
    host: 192.168.1.114
    name: Ingresso
    username: admin
   password: !secret camera_passwd

@Scialla - Can I see your log file as well?

There's nothing I can really do here. My recommendation would be to add these cameras as generic cameras using the RTSP and Snapshot URLs directly, instead of ONVIF.

Ok, if it is so, then I will have to live with it. I thought that it will be possible to use the PAN and TILT functions with the ONVIF integration. And it was great that ONVIF worked in 0.109.x.

It's telling us that the events service endpoint is the media service url, and the media service is the PTZ service, and the PTZ service is the deviceio service.

I don't really know what that means. :-)

Basically it means that the firmware on your camera is not conforming to the ONVIF specifications which means that it is impossible to control the camera through ONVIF. That is also why PTZ didn't work for you in earlier versions. It may be possible to update the firmware on your camera and get better support, or file a support ticket with the manufacturer if they explicitly advertise ONVIF support.

Basically it means that the firmware on your camera is not conforming to the ONVIF specifications

Ok! Interestingly it is working with the ONVIF device manager. I can control the PAN and TILT there without any problems. But OK, I will live with it!

Thank you for your very fast support!

If it works in ODM, they could be jumping through some hoops that I'm not yet. I would need one of those cameras to test with, but it might be interesting getting one to the US...

Also my cameras work with ODM.

Sorry @hunterjm but I do not understand. I get that this is a free project and we are extremely grateful for your efforts/work. But our cameras were working before the latest update.

I am not a professional coder but usually newer software versions improve things by extending support, not by breaking what was working before.

When I started using Home Assistant I was able to use my cameras with PTZ, then I had to switch to generic camera. Then ONVIF was working again but without PTZ. Now we have to switch back to generic camera...

It seems to me that the real problem is that every camera manufacturer does whatever he wants with ONVIF spec...

I would need one of those cameras to test with, but it might be interesting getting one to the US...

This one: https://www.amazon.com/dp/B07FM24DLJ or this one should be nearly the same: https://www.amazon.com/dp/B071JNT8TS
They are all controlled by the Yoosee App. But maybe the firmware is different. I searched for a newer one but I don't find any.

Besides: if we use generic camera platform, we lose the possibility of using the stream platform, since generic camera does not support rtsp protocol for streaming...

since generic camera does not support rtsp protocol for streaming

I used this configuration before I used ONVIF integration and it worked with video:

  - platform: ffmpeg
    input: -rtsp_transport udp -i rtsp://<username>:<password>@192.168.178.32:554/onvif1
    extra_arguments: -q:v 2 
    name: Rundum

@carsten-h thanks, will try that!

since generic camera does not support rtsp protocol for streaming

I used this configuration before I used ONVIF integration and it worked with video:

  - platform: ffmpeg
    input: -rtsp_transport udp -i rtsp://<username>:<password>@192.168.178.32:554/onvif1
    extra_arguments: -q:v 2 
    name: Rundum

Thanks, for me works fine

Besides: if we use generic camera platform, we lose the possibility of using the stream platform, since generic camera does not support rtsp protocol for streaming...

That’s not true. Generic camera was the very first platform to support stream.

@hunterjm my bad, I didn’t express myself clearly.

My cameras work with the stream component only if you use the udp protocol instead of tcp, which is not working.

As far as I know, but I may be wrong, with the generic camera component it is not possible to select udp protocol.

I have this camera: https://www.amazon.com/Victure-Weatherproof-Surveillance-Detection-Compatible/dp/B07VC7TLHD/ref=sr_1_5?dchild=1&keywords=victure+1080p&qid=1590439028&sr=8-5
(81XXF IPC365)
I can watch the stream via ONVIF integrations but i can't use the built in pir sensor. why?
thanks

This is mine:
https://www.amazon.it/gp/product/B01DMBQULG/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

and this is working configuration in 109.6:

camera:
  - platform: onvif
    host: 192.168.1.114
    name: Ingresso
    username: admin
   password: !secret camera_passwd

The same for me (same cam, same configuration, same results). In the 110.3 onvif integration work (1 device and 2 entity, but really just 1 entity created). Ptz don't work: tell everytime "ContinuousMove not supported on device 'Cam-salotto' also if I use RelativeMove or AbsoluteMove. Ptz worked until 92.2

In the 110.3 onvif integration work (1 device and 2 entity, but really just 1 entity created)

It works? Really? Here it is still not working.

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Hi, here the same on 0.114.4. I've set to 'RelativeMove' but when i see the log this show me ContinuousMove not supported on device 'ONVIF'.

Hi, here the same on 0.114.4. I've set to 'RelativeMove' but when i see the log this show me ContinuousMove not supported on device 'ONVIF'.

Same here.

Was this page helpful?
0 / 5 - 0 ratings