-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetSystemDateAndTime #138579
Comments
Hey there @hunterjm, @jterrace, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) onvif documentation |
@bdraco this looks like it might be another instance of the fix I made in openvideolibs/python-onvif-zeep-async#54 - we are sending this: <ns0:GetSystemDateAndTime xmlns:ns0="http://www.onvif.org/ver10/device/wsdl"/> and I suspect the camera might not understand the inline namespace. @dkuzmenko-dsr not sure what your ha installation looks like, but if you have the ability to edit the code to do a quick test, it would be a single line here: adding: self.set_ns_prefix("tds", "http://www.onvif.org/ver10/device/wsdl") |
@jterrace thank you for the idea. I've tried that. My hass is installed as a system-wide AUR package. Hass is working in python venv. So it's easy enough to do the test. I've updated the diff --git a/onvif/client.py b/onvif/client.py
index 5f4f7b3..79e2432 100644
--- a/onvif/client.py
+++ b/onvif/client.py
@@ -158,6 +158,7 @@ class ZeepAsyncClient(BaseZeepAsyncClient):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
+ self.set_ns_prefix("tds", "http://www.onvif.org/ver10/device/wsdl")
self.set_ns_prefix("wsnt", "http://docs.oasis-open.org/wsn/b-2")
self.set_ns_prefix("wsa", "http://www.w3.org/2005/08/addressing") After that I've restarted hass and re-added the camera integration. Unfortunately result is the same:
|
Thanks for checking. Looking closer, I'm actually a little confused because all of the call sites in https://github.com/home-assistant/core/blob/e767863ea4229ca53d23f0378ad2e29aa153ba37/homeassistant/components/onvif/device.py that call |
You're right. There is nothing. |
I've tried to change the To catch any exception and log it: except Exception as err:
LOGGER.debug("%s: CHECKPOINT 300: Error: %s", self.name, type(err))
LOGGER.warning(
"Couldn't get device '%s' date/time. Error: %s", self.name, err
)
return Here's the result:
As a result camera has been added with 4 objects:
|
Thanks, so you're right, the issue is here: core/homeassistant/components/onvif/device.py Line 238 in e767863
Only the core/homeassistant/components/onvif/device.py Line 306 in e767863
additional exceptions are caught ( |
If we want to expand the exception caught in more places, we can make the tuple a constant and change it out where needed so we don't have to keep writing it out. |
zeep has a base |
I'd only include the ones we know are issues so we should keep the exception catch as narrow as possible so we don't hide bugs. |
Wow! That was extremely fast! |
The problem
I'm trying to add my Kojima Onvif camera. It works fine with python Onvif GUI application. But it looks the cam does not implement required because Onvif integration says the following:
I understand that the problem is highly likely is on the camera side but since Onvf GUI is able to connect and control the camera, maybe Onvif integration could do it as well by just ignoring system datetime setup step?
What version of Home Assistant Core has the issue?
core-2025.2.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Core
Integration causing the issue
onvif
Link to integration documentation on our website
https://www.home-assistant.io/integrations/onvif/
Diagnostics information
home-assistant_onvif_2025-02-15T07-01-01.103Z.log
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
My setup is pretty straightforward. Adding Onvif integration I'm passing the following parameters:
Name: Camera
Host:
Port: 5000
Username: admin
Password:
This configuration works with the mentioned onvif-gui
The text was updated successfully, but these errors were encountered: