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

Integration failed to set up #93

Open
GGSSDD opened this issue Feb 25, 2024 · 21 comments
Open

Integration failed to set up #93

GGSSDD opened this issue Feb 25, 2024 · 21 comments
Labels
documentation Improvements or additions to documentation

Comments

@GGSSDD
Copy link

GGSSDD commented Feb 25, 2024

It has been 2 maybe 3 days since the integration is down. Nothing is working. I have entries for 3 Imou cameras, all 3 are down… I get “Failed to set up” warnings for all of them. I don’t know what caused it, but i suspect it happened after the core update to 2024.2.3. Every core update so far since 2024.2.1 broke something in my setup.

I also redownloaded the integration, and it didn’t fix anything.

Version of the custom_component

1.0.15

Debug log

Logger: imouapi
Source: custom_components/imou_life/__init__.py:89
Integration: Imou Life ([documentation](https://github.com/user2684/imou_life), [issues](https://github.com/user2684/imou_life/issues))
First occurred: 15:49:16 (9 occurrences)
Last logged: 15:49:18

APIError: OP1013: Call interface times exceed limit (total). Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/imouapi/api.py", line 155, in _async_call_api await self.async_connect() File "/usr/local/lib/python3.12/site-packages/imouapi/api.py", line 117, in async_connect data = await self._async_call_api("accessToken", {}, True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/imouapi/api.py", line 227, in _async_call_api raise APIError(error_message) imouapi.exceptions.APIError: OP1013: Call interface times exceed limit (total).
Too many unsuccesful connection attempts

Logger: custom_components.imou_life
Source: custom_components/imou_life/__init__.py:91
Integration: Imou Life ([documentation](https://github.com/user2684/imou_life), [issues](https://github.com/user2684/imou_life/issues))
First occurred: 15:49:18 (3 occurrences)
Last logged: 15:49:18

NotConnected: Traceback (most recent call last): File "/config/custom_components/imou_life/__init__.py", line 89, in async_setup_entry await device.async_initialize() File "/usr/local/lib/python3.12/site-packages/imouapi/device.py", line 182, in async_initialize device_array = await self._api_client.async_api_deviceBaseDetailList([self._device_id]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/imouapi/api.py", line 279, in async_api_deviceBaseDetailList return await self._async_call_api(api, payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/imouapi/api.py", line 160, in _async_call_api raise NotConnected() imouapi.exceptions.NotConnected

Logger: homeassistant.config_entries
Source: config_entries.py:444
First occurred: 15:49:18 (3 occurrences)
Last logged: 15:49:18

Error setting up entry Cruiser for imou_life
Error setting up entry Bullet for imou_life
Error setting up entry Versa for imou_life
Traceback (most recent call last):
  File "/config/custom_components/imou_life/__init__.py", line 89, in async_setup_entry
    await device.async_initialize()
  File "/usr/local/lib/python3.12/site-packages/imouapi/device.py", line 182, in async_initialize
    device_array = await self._api_client.async_api_deviceBaseDetailList([self._device_id])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/imouapi/api.py", line 279, in async_api_deviceBaseDetailList
    return await self._async_call_api(api, payload)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/imouapi/api.py", line 160, in _async_call_api
    raise NotConnected()
imouapi.exceptions.NotConnected

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/imou_life/__init__.py", line 92, in async_setup_entry
    raise ImouException() from exception
imouapi.exceptions.ImouException

IMG_1249

@pothirak
Copy link

https://openapi.easy4ip.com/openapi
API Error

@GGSSDD
Copy link
Author

GGSSDD commented Feb 25, 2024

So it’s not related to HA or the integration!?

@pothirak
Copy link

Not related to HA
I'm looking for information from imou docs and tried change to https://openapi-sg.easy4ip.com:443/openapi or https://openapi-fk.easy4ip.com:443/openapi or https://openapi-or.easy4ip.com:443/openap but it didn't work.

@ncosta24
Copy link

I've the same problem. But in 8 cameras, 3 work:
image

@vgomenyuk
Copy link

The same issue after the last major HA upgrade 2024.2. Devices are "failed to setup", but they become online after reloading integration for each camera. After HA restart an issue happens again and need to reload each camera one more time to fix it.

@xCapeITA
Copy link

Imou has recently changed their API.
Here's the letter sent to developers

Dear Developers,
Greetings! I would like to sincerely thank you for your continuous support and trust in us. In order to provide better service and meet the needs of more users, Imou Open Platform(https://open.imoulife.com/) has recently made some adjustments and optimizations to the billing rules, which are as follows:

  1. The platform charges for the following three items:
    ① Interface call times: There is a monthly free limit of 30,000 times, and the excess is charged at a unit price of $0.02/10,000 times;
    ② Message push times: There is a monthly free quota of 30,000 times, and the excess is charged at a unit price of $0.01/10,000 times;
    ③ Media Flow: There is a free quota of 2GB per month, and overage is charged at a unit price of $0.25/GB.
    For more details, please see [the link here] (https://open.imoulife.com/price).
    (Note: The free quota will be refreshed on the 1st of each month.)
  2. If the free quota does not meet your usage needs, please click the following address to recharge your account balance:
    https://open.imoulife.com/consoleNew/resourceManage/myResource

If you have any questions or suggestions regarding the new billing rules, please feel free to contact us through our email address: cloud_openteam_intl@imou.com or through our platform technical work orders at [the link here] (https://open.imoulife.com/consoleNew/workSheet/submitSheet).
Our operation staff will be happy to answer and resolve any issues for you.

Stay tuned!

Imou Open Platform Team

@Paga777
Copy link

Paga777 commented Feb 27, 2024

so what should we do now?

@xCapeITA
Copy link

I've temporarily reverted to onvif.
Hope the plugin is fixed soon..

@pothirak
Copy link

After I tried rechage Balance 1 dollar it worked again.

@GotierLdl
Copy link

I'm in the same situation. I have everything on ONVIF by chance but ONVIF doesn't show the "confidentiality" of the cameras, only the IMOU integration does... so no activation on non presence. If the devellopper can fix it, that would be cool.

@ncosta24
Copy link

After I tried rechage Balance 1 dollar it worked again.

Confirm.

@GotierLdl
Copy link

GotierLdl commented Feb 27, 2024

① Interface call times: There is a monthly free limit of 30,000 times

Strange... wait the next month...

@GGSSDD
Copy link
Author

GGSSDD commented Feb 27, 2024

Yeah, just received the email myself. Anyone knows what was the limit before this?

@remcovdb79
Copy link

1 dollar and it worked again...

@Beppuz81
Copy link

After I tried rechage Balance 1 dollar it worked again.

Thanks!

@Paga777
Copy link

Paga777 commented Feb 29, 2024

it works, but so now you have to pay for everything?
no more live streams, no more interface operations.
practically useless.

@pothirak
Copy link

it works, but so now you have to pay for everything? no more live streams, no more interface operations. practically useless.

disable unused entities and use onvif for live streams to reduce API usage

@ncosta24
Copy link

ncosta24 commented Mar 1, 2024

it works, but so now you have to pay for everything? no more live streams, no more interface operations. practically useless.

disable unused entities and use onvif for live streams to reduce API usage

How can I reduce api usage?
I've 8 cameras:
image

With polling for 3600:
image

I've all the entities enabled and my monthly free limit is drain to fast! :(
image

Is the sensor entities or the control entities that consume the Interface Request Service?

@user2684 user2684 added the documentation Improvements or additions to documentation label Mar 9, 2024
@user2684
Copy link
Owner

user2684 commented Mar 9, 2024

Related also to #94. Yes there is been a restriction on Imou API usage.
Polling interval is what would need to be changed in order to avoid hitting the limit, agreed. For selecting a good value which stays below the threshold you also need to take into account how many devices you have attached to the imou account since the limit is per account, not per device.
I will try to identify a safe value and change it in the next version of the integration, this is the only thing I can do unfortunately :-(
And for video streaming, unless someone has specific needs, ONVIF or RTSP can be used as alternatives.

@anpak
Copy link

anpak commented Mar 22, 2024

Hi everyone...same problem for me :( I rolled back on Onvif integration. Any time estimation for this fix? thank you in advance

I charged 1$ on my account and the integration works again. I even reduce the polling time to 3600s as suggested. Hope that this works...

@user2684
Copy link
Owner

Hi, no fix would be possible unfortunately since this is completely managed by Imou on their side, only think we can do with the integration is to provide defaults which would consume less API calls :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: High Priority
Development

No branches or pull requests