slydiman / ha_custom_onvif

11 stars 2 forks source link

Error on init #7

Open pplanteg opened 2 years ago

pplanteg commented 2 years ago

Hi I'm trying to use your custom onvif intergration but i have this error on startup :

Can you help Please ?

Cette erreur provient d'une intégration personnalisée

Logger: homeassistant.config Source: custom_components/onvif/init.py:5 Integration: ONVIF First occurred: 07:38:48 (1 occurrences) Last logged: 07:38:48

Platform error: camera Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config.py", line 887, in async_process_component_config platform = p_integration.get_platform(domain) File "/usr/src/homeassistant/homeassistant/loader.py", line 530, in get_platform cache[full_name] = self._import_platform(platform_name) File "/usr/src/homeassistant/homeassistant/loader.py", line 535, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") File "/usr/local/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 972, in _find_and_load_unlocked File "", line 228, in _call_with_frames_removed File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 850, in exec_module File "", line 228, in _call_with_frames_removed File "/config/custom_components/onvif/init.py", line 5, in from homeassistant.const import ( ImportError: cannot import name 'Platform' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)

slydiman commented 2 years ago

What version of Homeassistant are you using?

ha_custom_onvif v2021.12.12 requires at least Homeassistant v2021.12.0.

You can try some previous version of ha_custom_onvif: https://github.com/slydiman/ha_custom_onvif/releases

pplanteg commented 2 years ago

Ah yes it could be that.. I’ll give a try tomorrow and let you know

thanks

pplanteg commented 2 years ago

hello, That was my problem, it running fine now. But still no discovery of sensors nor ptz for my camera :( I only have main and second stream added.

my camera is a Ctronic "Device type : C6F0SoZ3N0PcL2" and have sensor and ptz working with "ONVIF Device Manager" on Win10.

Any idea ?

thanks a lot for your help.

pplanteg commented 2 years ago

Update PTZ is working but no sensor If it could help you finding a solution for me, here screen capture of onvif manager :

Capture Capture2
slydiman commented 2 years ago

The topic tns1:RuleEngine/CellMotionDetector/Motion is exist in the event parser. Please check the log of HomeAssistant for more info. Probably you need to enable the debug log in configuration.yaml:

logger:
  default: info
  logs:
    homeassistant.components.onvif: debug
    zeep.transport: debug
    custom_components.onvif: debug
    zeeep.transport: debug

Note sometimes the log did not help. I have recorded the traffic between HomeAssistant and the camera using WireShark to investigate the issue.