core: ONVIF AttributeError: 'NoneType' object has no attribute 'WSPullPointSupport'

The problem

Since 0.110.0 my ONVIF cameras stopped working (Cheap AliExpress outdoor cameras). I got this error:

  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'

I guess the event_capabilities is None in my case, then it raises the AttributeError. Probably fixed by adding an if check to see if event_capabilities is not None.

Environment

  • Home Assistant Core release with the issue: 0.110.0
  • Last working Home Assistant Core release (if known): 0.109.7
  • Operating environment (Home Assistant/Supervised/Docker/venv): Docker
  • Integration causing this issue: ONVIF
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/onvif/

Problem-relevant configuration.yaml

The folowing config was working flawlessly:

- platform: onvif
  name: Frontyard
  host: 192.168.0.113
  port: 8899
  username: xxxxx
  password: xxxxx
  profile: 1
  extra_arguments: "-q:v 8"  

With the new integration, i got a message to remove this config. I removed it, but no image stream pops up.

Traceback/Error logs

2020-05-20 15:18:49 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Frontyard - 00:12:17:1b:4b:89 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'

Additional information

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

I found the issue with the MJPEG stream along with the AttributeError. Will put up a PR to fix.

Yeap, however that is strange for the Reolink camera - it conforms to the onvif protocol, which means that the hassio implementation might have some issues?

Pullpoint subscriptions are optional for Profile S. Not all cameras are created equal, and it goes to show you get what you pay for most of the time 🤷‍♂️