Imou Life - cloud integration

bonjour , je me permet que venir vers vous car j essai de mettre mais camera imou sur mon home assistant , j ai bien trouver mon ID et la clée secret mais il me dis que l a l url de base de l api n ai pas bonne https://openapi.easy4ip.com/openapi

avez vous eu ce souci ou une autre adresse merci

finalement apres plusieur essai , je pense que le probleme viens de mon ID et de ma clée secret
je ne comprend pas je fais bien un copié coller mais message erruer id ou clée secret

Try English, you’ll be understood then.

1 Like

I’ve just had the same issue. Try to reset AppSecret in the Imou console, then Edit App Information (you don’t have to change anything) and Save. The try again to add an Imou device in HA. For me it worked.

Hi all

it’s happening that sometimes one or more fo cam defined in the Imou integration does not respond to commands and in the Imou integration page I found them with error.
Just clicking on the 3-dots of the cam and click reload and it return working again.

What can be the cause?
Is there a way to do a reload of the cam integration without doing it via the menu?

Thanks

Hi, just wanted to make everyone using this integration aware that Imou has applied restrictions to the the usage of the APIs that this integration is using, adding a free tier and a paid tier. You may have received an email from them saying something like:

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.

You may monitor your current usage through this link: Imou Cloud OpenPlatform

How does this affect the integration?
Since this limitations have been introduced, you may have hit one or more of those limits, resulting in the integration no more working correctly.

How can I know if the integration is not working for this issue?

  • Go to ImouLife Console to check if this is the case by monitoring your API usage
  • Search your Home Assistant logs looking for imou, If you find an error like APIError: OP1013: Call interface times exceed limit (total) you have hit the limit

I hit the new limits, what can I do to mitigate this situation?

Please note since these are monthly limits, you may need to wait to the next month to have the counters resetted

If you instead are fine with the fee Imou is asking for increasing the limit, you can charge your account through the Imou Cloud Platform website. Please note this has nothing to do with the Home Assistant integration.

How many API calls the integration does?

For each polling cycle the integration does the following calls:

  • For each device:
    • a call to check if the device is online (via deviceOnline)
    • For each (enabled) entity (e.g. any Home Assistant entity like switches, sensors, cameras, etc.):
      • a call to refresh the status of the entity

So the calculation to do is something like:
#entities * #devices * 4 (assuming a refresh per hour with the default polling of 15 minutes) * 24 (hours per day)
Plus a few other calls per refresh cycle to update the device status itself.

I’m using ONVIF and/or RTSP, does this new limits affect also those integrations?

No, RTSP and ONVIF will continue to work since not leveraging the Imou APIs.

What can the developer of the HA integration do?
Not many things unfortunately since this change is completely managed on the Imou server side. I’m evaluating to increase the default polling value to 30/60 minutes and to provide a way to monitor API calls as additional mitigation factors, plus of course adding this information to the documentation of the integration

4 Likes

Hello , Je viens d’avoir le même problème que toi.
Tu as certainement dû recevoir il y a quelques jours un email de imou pour signaler que
l’utilisation de leur API devenait payante.


Du coup, je viens de créditer mon compte de 5€
J’ai 5 caméras.
Curieux de voir combien de temps ce montant va me donner en délais d’utilisation.
en espérant avoir pu t’éclairer sur la raison de la perte du flux de tes équipements IMOU.

Hi @user2684

I recharged my Imou balance a couple of days ago and these are my statistics.

The calls are also counted when using their native app or when using frigate that is connected via rtsp?
Or only when I use the Imou integration?

I don’t understand the 5761 calls just yesterday…

Thanks

My guess is that the Imou app does not count in these statistics. Same for RTSP so I assume are all made by the integration. Just to clarify, at every polling cycle, the integration makes the following:

  • For each device:
    • a call to check if the device is online (via deviceOnline)
    • For each (enabled) entity (controls and sensors):
      • a call to refresh the status of the entity (via getDeviceCameraStatus and the others)

So the calculation to do is something like:
#entities * #devices * 4 (refresh per hour with the default polling of 15 minutes) * 24 (hours per day)
Plus a bunch of other calls per refresh cycle to update the device status itself.
Does this resonate with the number you see?

Another option I have on my side is also to limit the number of entities which are enabled by default by the integration.

1 Like

What do you mean by #entities ?
The HA entities that interact with the Imou cams ?

I have 7 cams defined in the open.imoulife.com.
One question is, can I delete some of them that I haven’t defined in the Imou integration or is not needed if not defined?
And if I delete from there, they will still be visible in my Imou app?

So the calculation in my case should be:

X * 7 * 4 *24

where X is the number of #entities that for now I cannot calculate…

Thanks

It’s all day that I have two cams with issue

I get this error in the log

2024-03-10 19:51:15.102 ERROR (MainThread) [imouapi] ConnectionFailed: 
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/imouapi/api.py", line 190, in _async_call_api
    response = await self._session.request("POST", url, json=body, timeout=self._timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 504, in _request
    with timer:
  File "/usr/local/lib/python3.12/site-packages/aiohttp/helpers.py", line 735, in __exit__
    raise asyncio.TimeoutError from None
TimeoutError

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

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 192, in _async_call_api
    raise ConnectionFailed(f"{exception}") from exception
imouapi.exceptions.ConnectionFailed

I have enough credit on the developer site, so there should be no issue on that side.

What can I check?

Thanks

Hi all, I’ve updated my post here with additional FAQ on this issue.

@woody4165 correct, an entity is any home assistant entity (switches, sensors, cameras, etc.). On my HA I’ve disabled most of the sensors I’m not using and went from 6000 calls per day overall to 1000.

For the other error you were reporting, looks like a connection issue, if still persists, try searching for errors like APIError: OP1013: Call interface times exceed limit (total) in the logs, I know you have credit but better to double check. Thanks

1 Like

Ok, thanks.

I’ve now disabled most of the Imou sensors and entities and will check in the next days.
Now I have no sensors and some entities

Since the API called most of the time, in my case, is getDeviceCameraStatus, disabling sensors and entities will reduce calls?

I have seven cameras but two of them are in the list, but I have not integrated in HA. They will be consuming API anyway?
If I remove them from the open.imoulife.com , will I remove also from the app?

I solved it like this:
taken from the Imou app the name of the camera
found the ip inside the router
added the camera with ONVIF integration
User: admin
Password: from the Imou Android program read “device label” → security code
once this is done the camera works in Onvif.
HI
Joseph

1 Like

Correct, disabling sensors (e.g. those in entità nascoste in your screenshot) would reduce API calls. Since I use only Human Decetion and Motion decetion switches I left there only those. Buttons like Restart devices instead do not consume API calls unless they are pressed of course. Devices not integrated in HA do not consume API calls so don’t worry about them

@peppeman75 yes, if you need to view the video stream, ONVIF is way better than the video stream provided by the integration/Imou since connection is local and does not go through the cloud so is way faster and more reliable.

Since I’m having a $ 0.01 charging every day, I’ve opened a ticket on https://open.imoulife.com and this is the answer

Hello, I have confirmed to you that the excess part on our side is deducted regularly every day, not accumulated. The charging method is calculated according to (number of overruns/10000) * 0.02, with a minimum deduction of US $0.01, so you will deduct US $0.01 per day.

If someone exceed the standard values, there will be a $ 0.01 charging every day, so there will be $ 3.65 charging per year. If daily API calls does not exceed 5.000 daily [(number of overruns/10000) * 0.02 ], it will be a $ 0.01 charge, otherwise it will be $ 0.02 until 10.000 calls per day.

Charging is also related to the traffic is used, you can check in the statistics at the Flows item. I have almost 0 traffic daily.

So prepare to charge the account to avoid malfunctions…

How did you dertemine the IP address inside the router? Should I look for manufacturer name? I find different names like e.g. Zhejiang Dahua Technology Co Ltd. or Hangzhou huacheng network technology co Ltd

Could you please provide an example of your configuration?

unless you have changed the name, it should contain or start with IPC.
Imou is a Dahua brand

Thanks for the quick reply. I could figure out the IP address now. In my router it shows NOMI-IPC-GS7E-5M0WE.However when I tried to add onvif://admin:[email protected]?subtype=Profile000 I don’t see the stream