Skip to content
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

APIError: DV1026: The device does not support the call of this function #82

Closed
TheBisk opened this issue Dec 27, 2023 · 14 comments
Closed
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@TheBisk
Copy link

TheBisk commented Dec 27, 2023

Version of the custom_component

1.0.14

Configuration

This error originated from a custom integration.

Logger: custom_components.imou_life
Source: custom_components/imou_life/coordinator.py:44
Integration: Imou Life (documentation, issues)
First occurred: 13:57:23 (5 occurrences)
Last logged: 14:57:23

APIError: DV1026: The device does not support the call of this function. Traceback (most recent call last): File "/config/custom_components/imou_life/coordinator.py", line 42, in _async_update_data return await self.device.async_get_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/imouapi/device.py", line 414, in async_get_data await sensor_instance.async_update() File "/usr/local/lib/python3.11/site-packages/imouapi/device_entity.py", line 294, in async_update data = await self.api_client.async_api_getDeviceCameraStatus(self._device_id, self._name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/imouapi/api.py", line 355, in async_api_getDeviceCameraStatus return await self._async_call_api(api, payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/imouapi/api.py", line 227, in _async_call_api raise APIError(error_message) imouapi.exceptions.APIError: DV1026: The device does not support the call of this function.

Device info

Device info
IPC-C26E-V2
by Imou
Firmware: Eng_P_V2.680.0000000.28.R.20210911
Hardware: 6G071B2PAZ8DAE2

@user2684 user2684 added the bug Something isn't working label Dec 27, 2023
@user2684
Copy link
Owner

Hi, was this working with the previous version of the integration? Just to understand if it is a new error after having upgraded to 1.0.14 or not :-)
Thanks!

@TheBisk
Copy link
Author

TheBisk commented Dec 28, 2023

Yes, it was working with the previous version. It is the first time that I see this kind of error.
Thanks for your work user2684.

@user2684
Copy link
Owner

Ok, that function which is throwing the error has been indeed modified with 1.0.14 so it must be related. Strange because I tested with with a few models and had no problems, but I didn't have your model. Can you please share diagnostic and debug logs (https://github.com/user2684/imou_life?tab=readme-ov-file#troubleshooting) so I can try to understand what's going on? If you need a temporary workaround meanwhile you can always manually downgrade to 1.0.13.
Many thanks

@Diegocampy
Copy link

Ok, that function which is throwing the error has been indeed modified with 1.0.14 so it must be related. Strange because I tested with with a few models and had no problems, but I didn't have your model. Can you please share diagnostic and debug logs (https://github.com/user2684/imou_life?tab=readme-ov-file#troubleshooting) so I can try to understand what's going on? If you need a temporary workaround meanwhile you can always manually downgrade to 1.0.13. Many thanks

Thanks, how can I put an earlier version? I have the same problem. Thanks

@user2684 user2684 reopened this Jan 27, 2024
@Diegocampy
Copy link

same problem with 1.0.15
Questo errore ha avuto origine da un'integrazione personalizzata.

Logger: custom_components.imou_life
Source: custom_components/imou_life/entity.py:81
Integration: Imou Life (documentation, issues)
First occurred: 14:46:43 (2 occurrences)
Last logged: 14:46:44

APIError: DV1026: The device does not support the call of this function. Traceback (most recent call last): File "/config/custom_components/imou_life/entity.py", line 79, in async_added_to_hass await self.sensor_instance.async_update() File "/usr/local/lib/python3.11/site-packages/imouapi/device_entity.py", line 294, in async_update data = await self.api_client.async_api_getDeviceCameraStatus(self._device_id, self._name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/imouapi/api.py", line 355, in async_api_getDeviceCameraStatus return await self._async_call_api(api, payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/imouapi/api.py", line 227, in _async_call_api raise APIError(error_message) imouapi.exceptions.APIError: DV1026: The device does not support the call of this function.

@user2684
Copy link
Owner

user2684 commented Feb 4, 2024

Hi @Diegocampy was it working with previous version? Thanks

@Diegocampy
Copy link

Hi @Diegocampy was it working with previous version? Thanks

No, same problem

@user2684
Copy link
Owner

Ok so it means it did not stop working because of the change. I expect then that this happens because on some models a different API is called but without knowing which one is impossible to fix :-/

@Strixx76
Copy link

Strixx76 commented Apr 26, 2024

I have noticed the same problem since I upgraded the other week. Don't know which version I had before, or it there was the same error.
Device is IMOU Ranger 2

"device": {
        "device_id": "**REDACTED**",
        "name": "Garage",
        "catalog": "IPC",
        "given_name": "Garage",
        "model": "IPC-A26H-V2",
        "firmware": "Eng_P_V2.680.0000000.28.R.20210911",
        "manufacturer": "Imou",
        "status": "1",
        "sleepable": false
      },

Debug log:

2024-04-26 13:43:29.673 DEBUG (MainThread) [imouapi] [Garage] update requested
2024-04-26 13:43:32.646 DEBUG (MainThread) [imouapi] [Garage] updating Motion detection, value is OFF {}
2024-04-26 13:43:34.663 ERROR (MainThread) [custom_components.imou_life] APIError: DV1026: The device does not support the call of this function.
Traceback (most recent call last):
  File "/config/custom_components/imou_life/coordinator.py", line 42, in _async_update_data
    return await self.device.async_get_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/imouapi/device.py", line 414, in async_get_data
    await sensor_instance.async_update()
  File "/usr/local/lib/python3.12/site-packages/imouapi/device_entity.py", line 294, in async_update
    data = await self.api_client.async_api_getDeviceCameraStatus(self._device_id, self._name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/imouapi/api.py", line 355, in async_api_getDeviceCameraStatus
    return await self._async_call_api(api, payload)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/imouapi/api.py", line 227, in _async_call_api
    raise APIError(error_message)
imouapi.exceptions.APIError: DV1026: The device does not support the call of this function.
2024-04-26 13:43:34.664 DEBUG (MainThread) [custom_components.imou_life] Finished fetching imou_life data in 4.991 seconds (success: False)

I have one more camera which is working fine without any error in the logg

@user2684
Copy link
Owner

I do wonder if there are also changes from the Imou side on APIs of old models since this errors are becoming more frequent and difficult to troubleshoot. It shouldn't be the case though since this would make the devices not backward compatible and should break the app as well theoretically speaking...

@Strixx76
Copy link

Strixx76 commented May 2, 2024

I just had a very quick glance in the code trying to find what is wrong. But since I don't have had the time to learn the API it is hard. One thing I am missing is to be able to see a log entry of which switch it is that is throwing the error. I can only see the entities that successfully was updated.

And a second thing I noticed is that as soon as one entity is failing the exception is thrown casing the rest to not be updated. Maybe the there should be a logic for handling this in async_get_data()?. Maybe you could even do all the individual updates as asyncio jobs, and then only log the ones failing?

@Strixx76
Copy link

Strixx76 commented May 2, 2024

So I have done some more testing and added some extra logging to imouapi (ugly and not ready for a pull request) and found out that the switch that is throwing the error is the Status indicator (breathingLight). There is a status indicator on the camera, and it is possible to change it from the native app.
So I investigated the API (getDeviceCameraStatus) and I have now discovered that the description in the API documentation is partly wrong.

If the "enableType is device-level enable" you must omit the channelId parameter. That is what is casing the error. After removing it my camera is working perfectly fine in the development environment. This also applies to setDeviceCameraStatus. The strange thing is that this only applies for one of my cameras. There rest is working fine without this fix.

Since this is not an issue with the imou_life integration, but the api package, do you want me to create an issue in that repo instead?

@user2684
Copy link
Owner

Continuing on user2684/imouapi#10 for this specific topic

@user2684
Copy link
Owner

Closing this and working on user2684/imouapi#10

@user2684 user2684 added the duplicate This issue or pull request already exists label Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
Archived in project
Development

No branches or pull requests

4 participants