Coder Social home page Coder Social logo

Cell Go support? about imou_life HOT 42 OPEN

user2684 avatar user2684 commented on May 29, 2024 2
Cell Go support?

from imou_life.

Comments (42)

tango13 avatar tango13 commented on May 29, 2024 3

Good news!
After some debugging and analysis, I managed to see the Cell Go device correctly in HA!
What I did was to add a "channelId":"0" to the payload in function async_api_setDeviceCameraStatus in file api.py.
I know that in the Imou API documentation the channelId parameter is not mandatory but I verified with Postman that without it the API call doesn't work and returns the OP1003 error as per above.
I don't know if this change breaks the compatibility with other cameras, but at least for the Cell Go model apparently it is required.
Controls and sensors now seem to work as expected, and I also get a live stream through the Camera HD sensor.

from imou_life.

user2684 avatar user2684 commented on May 29, 2024 2

Thanks for the logs. From what I can see, the device is recognized as a "dormant" device correctly but the method we found in #36 by calling the closeDormant function to wake it up, it doesn't work here since not supported (invalid parameter). Unfortunately Imou is not keeping up to date the API specs at https://open.imoulife.com/book/en/start.html and there are no evidence on how to interact with those devices, how to wake them up etc. There is for sure a way because this is what the Imou Life app does but it is not easy to guess like we did in #36 since it is not publicly documented. I'll keep this open and in case I can get such a device for more detailed tests I'll dig into. Meanwhile if anybody identifies the right api to interact with those devices, please let me know.

from imou_life.

giddorah avatar giddorah commented on May 29, 2024 1

I also have one of these cameras and would gladly do whatever I can to assist in finding a way through its limitations. Ask away :)

from imou_life.

tango13 avatar tango13 commented on May 29, 2024 1

I've set up Postman and followed some directions as outlined in request #36, so far with some success.
The closeDormant function actually does seem to wake the camera up: if I call it and then go to see the live stream on the app, the camera responds immediately, without the initial delay when it typically wakes up.
I can also get information about the status of the battery.
Still trying some functions at random, but things seem to work as expected.
Please let me know if I should test something specific.
Thank you.

from imou_life.

user2684 avatar user2684 commented on May 29, 2024 1

Hi, I run a test against two other models that I have here (IPC-C22C-D and IPC-C22F-C) and as expected the channelId addition had no impact and everything works correctly. I will add the fix in the next release, I'll keep you posted. Thanks!

from imou_life.

user2684 avatar user2684 commented on May 29, 2024

Hi, can you please both diagnostic and debug logs so to have a better look at it? Might be this model does not expose certain capabilities. Thanks!

from imou_life.

erich74 avatar erich74 commented on May 29, 2024

Thanks for your answer, sorry to ask but do you have a link about which exact information you need? I am pretty new to HA, not sure how/where to get the requested diag/debug logs.
Thanks

from imou_life.

user2684 avatar user2684 commented on May 29, 2024

Sure no problem, have a look at this: https://github.com/user2684/imou_life#troubleshooting
Thanks

from imou_life.

erich74 avatar erich74 commented on May 29, 2024

Thanks for the info.
Here is the information (diag + HA logs)

Device Diagnostic data:

{
"home_assistant": {
"installation_type": "Home Assistant OS",
"version": "2023.3.6",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.10.10",
"docker": true,
"arch": "aarch64",
"timezone": "Europe/Paris",
"os_name": "Linux",
"os_version": "5.15.84-v8",
"supervisor": "2023.03.2",
"host_os": "Home Assistant OS 9.5",
"docker_version": "20.10.22",
"chassis": "embedded",
"run_as_root": true
},
"custom_components": {
"heatzy": {
"version": "5.7.1",
"requirements": [
"heatzypy==2.1.1"
]
},
"alexa_media": {
"version": "4.6.2",
"requirements": [
"alexapy==1.26.5",
"packaging>=20.3",
"wrapt>=1.12.1"
]
},
"imou_life": {
"version": "1.0.13",
"requirements": [
"imouapi==1.0.13"
]
},
"hacs": {
"version": "1.31.0",
"requirements": [
"aiogithubapi>=22.10.1"
]
}
},
"integration_manifest": {
"domain": "imou_life",
"name": "Imou Life",
"documentation": "https://github.com/user2684/imou_life",
"issue_tracker": "https://github.com/user2684/imou_life/issues",
"dependencies": [],
"config_flow": true,
"codeowners": [
"@user2684"
],
"requirements": [
"imouapi==1.0.13"
],
"version": "1.0.13",
"iot_class": "cloud_polling",
"is_built_in": false
},
"data": {
"entry": {
"entry_id": "REDACTED",
"version": 3,
"domain": "imou_life",
"title": "Jardin derri\u00e8re",
"data": {
"api_url": "https://openapi.easy4ip.com/openapi",
"device_name": "Jardin derri\u00e8re",
"app_id": "REDACTED",
"app_secret": "REDACTED",
"device_id": "REDACTED"
},
"options": {},
"pref_disable_new_entities": false,
"pref_disable_polling": false,
"source": "user",
"unique_id": "REDACTED",
"disabled_by": null
},
"device_info": {
"api": {
"base_url": "https://openapi.easy4ip.com/openapi",
"timeout": 10,
"is_connected": true
},
"device": {
"device_id": "REDACTED",
"name": "Jardin derri\u00e8re",
"catalog": "IPC-B32-V2",
"given_name": "Jardin derri\u00e8re",
"model": "IPC-B32-V2",
"firmware": "2.800.0000000.1.R.221209",
"manufacturer": "Imou",
"status": "4",
"sleepable": true
},
"capabilities": [
{
"name": "CloseCamera",
"description": "Support to close the camera (CloseCamera)"
},
{
"name": "other",
"description": "other"
},
{
"name": "WideDynamic",
"description": "Wide Dynamic (WideDynamic)"
},
{
"name": "PlaySound",
"description": "Device sound switch capability (PlaySound)"
},
{
"name": "RTSV1",
"description": "Real-time streaming supports private protocol to pull streaming (RTSV1)"
},
{
"name": "RTSV2",
"description": "Real-time streaming supports private protocol streaming, supports dynamic port modification (RTSV2)"
},
{
"name": "AECV3",
"description": "AECV3"
},
{
"name": "Dormant",
"description": "Sleepable, with wake-up and sleep states (Dormant)"
},
{
"name": "LinkDevAlarm",
"description": "Associated Device Alarm (LinkDevAlarm)"
},
{
"name": "ChnLocalStorage",
"description": "Support channel local storage, such as SD card or hard disk (ChnLocalStorage)"
},
{
"name": "CloudStorage",
"description": "Support for cloud storage of China Vision WeChat platform (CloudStorage)"
},
{
"name": "BreathingLight",
"description": "The device has a breathing light (indicator light) (BreathingLight)"
},
{
"name": "ChnSiren",
"description": "ChnSiren"
},
{
"name": "LocalStorage",
"description": "Support device local storage, such as SD card or hard disk (LocalStorage)"
},
{
"name": "TLSEnable",
"description": "Support TLS transmission (TLSEnable)"
},
{
"name": "LRRF",
"description": "Local recording supports fast forward LocalRecordReplayForward (LRRF)"
},
{
"name": "HeaderDetect",
"description": "Support head detection (HeaderDetect)"
},
{
"name": "TimeFormat",
"description": "Support time format setting (TimeFormat)"
},
{
"name": "MDW",
"description": "motion-detect-window supports motion detection window settings (MDW)"
},
{
"name": "LinkageSiren",
"description": "Alarm Linkage Siren (LinkageSiren)"
},
{
"name": "RQD",
"description": "RQD"
},
{
"name": "SLAlarm",
"description": "The device supports sound and light alarm (sound and light alarm) (SLAlarm)"
},
{
"name": "Siren",
"description": "Siren (Siren)"
},
{
"name": "FrameReverse",
"description": "Support screen flip (FrameReverse)"
},
{
"name": "AudioTalk",
"description": "Support voice intercom (AudioTalk)"
},
{
"name": "Reboot",
"description": "The device supports restarting (Reboot)"
},
{
"name": "AudioTalkV1",
"description": "Support voice intercom (AudioTalkV1)"
},
{
"name": "ELCM",
"description": "Electricity Mode (ELCM)"
},
{
"name": "SirenTime",
"description": "Support siren duration configuration (SirenTime)"
},
{
"name": "PBSV1",
"description": "Playback stream supports private protocol to pull stream (PBSV1)"
},
{
"name": "PBSV2",
"description": "The playback stream supports private protocol streaming and supports dynamic port modification (PBSV2)"
},
{
"name": "TSV2",
"description": "Voice intercom streaming supports private protocol streaming, supports dynamic port modification (TSV2)"
},
{
"name": "RASV1",
"description": "Unmute volume, 1-5 gears, default 4 gears (RASV1)"
},
{
"name": "TSV1",
"description": "Voice intercom streaming supports private protocol to pull streaming (TSV1)"
},
{
"name": "PlaybackByFilename",
"description": "The device supports playback based on the file name (PlaybackByFilename)"
},
{
"name": "TCM",
"description": "Support Three code megre (TCM)"
},
{
"name": "MotionDetect",
"description": "Motion detection (MotionDetect)"
}
],
"switches": [
{
"name": "motionDetect",
"description": "Motion detection (motionDetect)",
"state": null,
"is_enabled": true,
"is_updated": false,
"attributes": {}
},
{
"name": "breathingLight",
"description": "Status indicator (breathingLight)",
"state": null,
"is_enabled": true,
"is_updated": false,
"attributes": {}
},
{
"name": "headerDetect",
"description": "Human detection (headerDetect)",
"state": null,
"is_enabled": true,
"is_updated": false,
"attributes": {}
},
{
"name": "linkageSiren",
"description": "Siren Armed (linkageSiren)",
"state": null,
"is_enabled": false,
"is_updated": false,
"attributes": {}
},
{
"name": "closeCamera",
"description": "Close camera (closeCamera)",
"state": null,
"is_enabled": true,
"is_updated": false,
"attributes": {}
},
{
"name": "tlsEnable",
"description": "Tls enable (tlsEnable)",
"state": null,
"is_enabled": false,
"is_updated": false,
"attributes": {}
},
{
"name": "linkDevAlarm",
"description": "Siren Armed (linkDevAlarm)",
"state": null,
"is_enabled": true,
"is_updated": false,
"attributes": {}
},
{
"name": "playSound",
"description": "Device sound (playSound)",
"state": null,
"is_enabled": false,
"is_updated": false,
"attributes": {}
},
{
"name": "wideDynamic",
"description": "HDR (wideDynamic)",
"state": null,
"is_enabled": false,
"is_updated": false,
"attributes": {}
}
],
"sensors": [
{
"name": "battery",
"description": "Battery (battery)",
"state": null,
"is_enabled": true,
"is_updated": false,
"attributes": {}
},
{
"name": "storageUsed",
"description": "Storage used (storageUsed)",
"state": null,
"is_enabled": true,
"is_updated": false,
"attributes": {}
},
{
"name": "callbackUrl",
"description": "Callback url (callbackUrl)",
"state": null,
"is_enabled": true,
"is_updated": false,
"attributes": {}
},
{
"name": "status",
"description": "Status (status)",
"state": null,
"is_enabled": true,
"is_updated": false,
"attributes": {}
}
],
"binary_sensors": [],
"selects": [],
"buttons": [
{
"name": "restartDevice",
"description": "Restart device (restartDevice)",
"is_enabled": true,
"is_updated": false,
"attributes": {}
},
{
"name": "refreshData",
"description": "Refresh all data (refreshData)",
"is_enabled": true,
"is_updated": false,
"attributes": {}
},
{
"name": "refreshAlarm",
"description": "Refresh alarm (refreshAlarm)",
"is_enabled": true,
"is_updated": false,
"attributes": {}
}
],
"sirens": [
{
"name": "siren",
"description": "Activate siren (siren)",
"state": false,
"is_enabled": true,
"is_updated": false,
"attributes": {}
}
],
"cameras": [
{
"name": "camera",
"description": "Camera (HD) (camera)",
"is_enabled": true,
"is_updated": false,
"attributes": {}
},
{
"name": "cameraSD",
"description": "Camera (SD) (cameraSD)",
"is_enabled": false,
"is_updated": false,
"attributes": {}
}
]
}
}
}

HA Logs

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

Logger: aiohttp.server
Source: custom_components/imou_life/camera.py:98
Integration: Imou Life (documentation, issues)
First occurred: 11:02:03 (2 occurrences)
Last logged: 11:02:04

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 67, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 234, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 724, in get
return await self.handle(request, camera)
File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 742, in handle
image = await _async_get_image(
File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 170, in _async_get_image
if image_bytes := await camera.async_camera_image(
File "/config/custom_components/imou_life/camera.py", line 98, in async_camera_image
return await self.sensor_instance.async_get_image()
File "/usr/local/lib/python3.10/site-packages/imouapi/device_entity.py", line 555, in async_get_image
if not await self._async_is_ready():
File "/usr/local/lib/python3.10/site-packages/imouapi/device_entity.py", line 86, in _async_is_ready
awake = await self._device_instance.async_wakeup()
File "/usr/local/lib/python3.10/site-packages/imouapi/device.py", line 384, in async_wakeup
await self._api_client.async_api_setDeviceCameraStatus(self._device_id, "closeDormant", True)
File "/usr/local/lib/python3.10/site-packages/imouapi/api.py", line 359, in async_api_setDeviceCameraStatus
return await self._async_call_api(api, payload)
File "/usr/local/lib/python3.10/site-packages/imouapi/api.py", line 216, in _async_call_api
raise APIError(error_message)
imouapi.exceptions.APIError: OP1003: Invalid parameter (incorrect or null), please modify parameter

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/imou_life/camera.py:106
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 11:02:04 (1 occurrences)
Last logged: 11:02:04

[547178262352] Error handling message: Unknown error (unknown_error) eric from fe80::2bb4:70f7:2921:9905 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 800, in ws_camera_stream
url = await _async_stream_endpoint_url(hass, camera, fmt=msg["format"])
File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 957, in _async_stream_endpoint_url
stream = await camera.async_create_stream()
File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 518, in async_create_stream
source = await self.stream_source()
File "/config/custom_components/imou_life/camera.py", line 106, in stream_source
return await self.sensor_instance.async_get_stream_url()
File "/usr/local/lib/python3.10/site-packages/imouapi/device_entity.py", line 666, in async_get_stream_url
await self.async_open_stream()
File "/usr/local/lib/python3.10/site-packages/imouapi/device_entity.py", line 586, in async_open_stream
if not await self._async_is_ready():
File "/usr/local/lib/python3.10/site-packages/imouapi/device_entity.py", line 86, in _async_is_ready
awake = await self._device_instance.async_wakeup()
File "/usr/local/lib/python3.10/site-packages/imouapi/device.py", line 384, in async_wakeup
await self._api_client.async_api_setDeviceCameraStatus(self._device_id, "closeDormant", True)
File "/usr/local/lib/python3.10/site-packages/imouapi/api.py", line 359, in async_api_setDeviceCameraStatus
return await self._async_call_api(api, payload)
File "/usr/local/lib/python3.10/site-packages/imouapi/api.py", line 216, in _async_call_api
raise APIError(error_message)
imouapi.exceptions.APIError: OP1003: Invalid parameter (incorrect or null), please modify parameter

Thanks for your support & feedback!
Eric

from imou_life.

MiAutomations avatar MiAutomations commented on May 29, 2024

Hello

And thank you I also have the same issue with the new Imou Cell Go it´s added in to Home Assistant, but is not showing the image stream and also some of sensors and features are unavailable

Is there any chance to get this work?

Thank you for your support

from imou_life.

MiAutomations avatar MiAutomations commented on May 29, 2024

Please let me know if you need any further information or logs in order to try support this device

Thank you

from imou_life.

erich74 avatar erich74 commented on May 29, 2024

Ok no problem, thanks a lot for your help and for your great work with this imou integration
Eric

from imou_life.

MiAutomations avatar MiAutomations commented on May 29, 2024

Thanks for the logs. From what I can see, the device is recognized as a "dormant" device correctly but the method we found in #36 by calling the closeDormant function to wake it up, it doesn't work here since not supported (invalid parameter). Unfortunately Imou is not keeping up to date the API specs at https://open.imoulife.com/book/en/start.html and there are no evidence on how to interact with those devices, how to wake them up etc. There is for sure a way because this is what the Imou Life app does but it is not easy to guess like we did in #36 since it is not publicly documented. I'll keep this open and in case I can get such a device for more detailed tests I'll dig into. Meanwhile if anybody identifies the right api to interact with those devices, please let me know.

Probably if anyone have access to the new model Imou Cell 2 is a good test also in order to check this parameter

from imou_life.

user2684 avatar user2684 commented on May 29, 2024

agree, it is really try and error and the complexity is also that since looks like Imou is updating their API but not their documentation, sometimes is really difficult to guess what to call. maybe one way could be to intercept in the network the calls issued by the camera but the SSL certificate could prevent this. Another could be to ask the Imou support but I never got decent answers from them.

from imou_life.

tango13 avatar tango13 commented on May 29, 2024

I just got a Cell Go camera, which I thought I could manage with Home Assistant through this integration. Instead, this particular model seems to have a lot of problems which, from what I read, don't seem to have the possibility to be solved easily or quickly. Please let me know if I can be of any help, otherwise I believe I might be forced to return the camera. Thank you.

from imou_life.

user2684 avatar user2684 commented on May 29, 2024

Great, thank you. Unfortunately without having the model to test it is very difficult for me to implement something when blind :-)
First of all we need to understand why when the integration calls the closeDormant api will get not supported (from your logs) while for you it is working fine. Are you calling it with different parameters? Thanks

from imou_life.

tango13 avatar tango13 commented on May 29, 2024

Here's what I am doing with Postman, tried some different functions:

get camera status through the "deviceOnline" call with these parameters
{
"system": {
"ver": "1.0",
"sign": "{{sign}}",
"appId": "{{appId}}",
"time": {{time}},
"nonce": "{{nonce}}"
},
"params":{
"token":"{{accessToken}}",
"deviceId":"XXXXXXXXXXXXXXX"
},
"id": "{{id}}"
}

I get
{"result":{"msg":"Operation is successful.","code":"0","data":{"productId":"XXXXXXX","channels":[{"channelId":"0","onLine":"4"}],"deviceId":"XXXXXXXXXXX","onLine":"4"}},"id":"7"}

the onLine=4, if I got it correctly, means sleeping, right?

Then I call the wakeUpDevice function with the following parameters

{
"system":{
"ver":"1.0",
"appId":"{{appId}}",
"sign":"{{sign}}",
"time":{{time}},
"nonce":"{{nonce}}"
},
"id":"{{id}}",
"params":{
"token":"{{accessToken}}",
"deviceId":"XXXXXXXXXXXXXXXXXXX",
"url":"/device/wakeup"
}
}

and I get in response

{"result":{"msg":"Operation is successful.","code":"0"},"id":"39"}

Right after calling the wakeup function, if I send a deviceOnline call I get

{"result":{"msg":"Operation is successful.","code":"0","data":{"productId":"XXXXXXX","channels":[{"channelId":"0","onLine":"1"}],"deviceId":"XXXXXXXXXXXXX","onLine":"1"}},"id":"21"}

the online=1 means online, correct?

Please let me know if you need me to do further testing.

Thank you.

from imou_life.

user2684 avatar user2684 commented on May 29, 2024

Yes, online should mean the device is actually online. Just check maybe that after this message you can get a snapshot, move the switches etc. so to be sure the device is really back online. Thanks!

from imou_life.

tango13 avatar tango13 commented on May 29, 2024

Some further progress, even though I confess I haven't read the documentation thoroughly and I may be doing things not the proper way.
I can bind (and unbind) a source live address for my device by using bindDeviceLive and unbindLive API calls.
After calling the wakeup function, the camera comes alive and I can get and watch a live stream with mplayer or vlc etc.
I'm still playing with API calls (and reading the documentation) but things seem to work as expected so far.
Thank you.

from imou_life.

tango13 avatar tango13 commented on May 29, 2024

This is the log HA produces about the imou_life custom component:

2023-12-04 16:36:55.187 ERROR (MainThread) [custom_components.imou_life] APIError: OP1003: Invalid parameter (incorrect or null), please modify parameter
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 285, in async_update
if not await self._async_is_ready():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/imouapi/device_entity.py", line 86, in _async_is_ready
awake = await self._device_instance.async_wakeup()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/imouapi/device.py", line 384, in async_wakeup
await self._api_client.async_api_setDeviceCameraStatus(self._device_id, "closeDormant", True)
File "/usr/local/lib/python3.11/site-packages/imouapi/api.py", line 359, in async_api_setDeviceCameraStatus
return await self._async_call_api(api, payload)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/imouapi/api.py", line 216, in _async_call_api
raise APIError(error_message)
imouapi.exceptions.APIError: OP1003: Invalid parameter (incorrect or null), please modify parameter

from imou_life.

MiAutomations avatar MiAutomations commented on May 29, 2024

Good news! After some debugging and analysis, I managed to see the Cell Go device correctly in HA! What I did was to add a "channelId":"0" to the payload in function async_api_setDeviceCameraStatus in file api.py. I know that in the Imou API documentation the channelId parameter is not mandatory but I verified with Postman that without it the API call doesn't work and returns the OP1003 error as per above. I don't know if this change breaks the compatibility with other cameras, but at least for the Cell Go model apparently it is required. Controls and sensors now seem to work as expected, and I also get a live stream through the Camera HD sensor.

Great News!

Can you please let us know if you are able to see the live stream of this camera model over the HA? If Yes can you please give us more details how to perform this?

Thank you

from imou_life.

tango13 avatar tango13 commented on May 29, 2024

Yes, I can see the live stream in HA but it's kind of hit or miss, sometimes it works, sometimes not. I am also verifying the battery drain: it seems that after connecting the camera in HA the battery has a much higher discharge rate.

from imou_life.

MiAutomations avatar MiAutomations commented on May 29, 2024

Yes, I can see the live stream in HA but it's kind of hit or miss, sometimes it works, sometimes not. I am also verifying the battery drain: it seems that after connecting the camera in HA the battery has a much higher discharge rate.

This is great even if for some times works or not ...

Yes its expected that the battery drain more faster once the stream is always active

Can you please give more information about how to achieve this integration in HA?

Thank you

from imou_life.

user2684 avatar user2684 commented on May 29, 2024

Excellent job @tango13 !! Just to fully understand the process here: the device is correctly identified as a "dormant" but was not correctly woke up by the integration. If you instead manually call async_api_setDeviceCameraStatus with the channel id, then the device wakes up and you can interact with it, correct? Battery drain is normal and the fact that the imou service with these devices is not always perfect is unfortunately also kind of expected.

Now if what we need is just to make the channel explicit, can be an easy change in the code so if so let me know.
Of course I would also need to check if this would not bring any impact on other camera models but regardless can be an easy fix.
Let me know.
Thanks!

from imou_life.

user2684 avatar user2684 commented on May 29, 2024

Linking this also with #36

from imou_life.

tango13 avatar tango13 commented on May 29, 2024

Excellent job @tango13 !! Just to fully understand the process here: the device is correctly identified as a "dormant" but was not correctly woke up by the integration. If you instead manually call async_api_setDeviceCameraStatus with the channel id, then the device wakes up and you can interact with it, correct?

Yes, correct.

Now if what we need is just to make the channel explicit, can be an easy change in the code so if so let me know.

What I did was simply adding a "channelId" line to the payload in async_api_setDeviceCameraStatus function (in file api.py), like this:

    api = "setDeviceCameraStatus"
    # prepare the payload                                           
    payload = {      
        "deviceId": device_id,
        "enableType": enable_type,
        "enable": value,
        "channelId": "0",
    } 

After this modification, the integration started interacting correctly with the device, apart from some hiccups in the live stream (sometimes it works, sometimes not).

Of course I would also need to check if this would not bring any impact on other camera models but regardless can be an easy fix. Let me know. Thanks!

Unfortunately, I don't have any other Imou camera to check, so I agree with you that possible impacts on other models is something that should be verified.
Thank you very much!

from imou_life.

user2684 avatar user2684 commented on May 29, 2024

Perfect thanks, I will do some tests on other models and report back!

from imou_life.

tango13 avatar tango13 commented on May 29, 2024

Great, thank you!
One thing I noticed is that the device is lacking a "motion detected" sensor, which could be used to trigger an alarm: is it expected?

from imou_life.

user2684 avatar user2684 commented on May 29, 2024

Do you mean the motion detection switch or the motion alarm sensor? The first one should be there regardless of the camera's capabilities, the latter only if the device supports the AlarmMD capability. Thanks

from imou_life.

tango13 avatar tango13 commented on May 29, 2024

I mean the motion alarm sensor. Actually the motion detection switch is there correctly, but the motion alarm sensor is not. As far as I understand though, the device doesn't support it, because if I call a device capability list function I don't see the AlarmMD one in the response.
Too bad, because such a capability would have been very useful inside Home Assistant.
Thank you!

from imou_life.

user2684 avatar user2684 commented on May 29, 2024

Correct! it shows up only if the device is AlarmMD capable. However, this was more an educated guess from my side. If you are familiar with python you could try installing pip install imouapi and run python -m imouapi.cli --app-id <app_id> --app-secret <app_secret> get_device_raw <device_id> which should "bruteforce" all the possibile capabilities and switches. Feel free to share the result here (but ensure there are no sensitive information in the output). Thanks!

from imou_life.

tango13 avatar tango13 commented on May 29, 2024

Thank you for the info.
Here's what I get in response to the get_device_raw command:

Capabilities:
WLAN: off
DHP2P: off
MT: off
NetSDK: off
HSEncrypt: off
CloudStorage: off
DPS: off
AGW: off
LocalStorage: off
LocalStorageEnable: off
PlaybackByFilename: off
BreathingLight: off
ShineLight: off
RegCode: off
RD: off
RD: off
FaceCapture: off
CK: off
NMP: off
NMPRC: off
TextPush: off
SLAlarm: off
LocalRecord: off
SR: off
QA: off
AntiAddiction: off
AntiAddictionSet: off
AntiAddictionForbid: off
XUpgrade: off
AGWDisarm: off
REMINDER: off
Auth: off
ModifyPassword: off
TimeSync: off
BRestartFormat: off
Siren: off
LinkageSiren: off
SirenTime: off
WhiteLight: off
WL: off
InfraredLight: off
SearchLight: off
NonAccessoriesAdd: off
CallAbility: off
CA: off
NoVA: off
Dormant: off
RTS: off
PBS: off
TS: off
RTS: off
PBS: off
TS: off
ES: off
CallByRtsp: off
DaySummerTime: off
WeekSummerTime: off
SummerTimeOffset: off
TAP: off
SceneMode: off
SMT: off
TimeFormat: off
DDT: off
ACT: off
SIMCA: off
OpenDoorByFace: off
OpenDoorByTouch: off
Ring: off
CustomRing: off
CustomReply: off
LinkDevAlarm: off
LinkAccDevAlarm: off
AbAlarmSound: off
PlaySound: off
PlaySoundModify: off
DLOCS: off
CheckAbDecible: off
Reboot: off
SCCode: off
RingAlarmSound: off
RAS: off
AccessoryAlarmSound: off
InstantDisAlarm: off
IDAP: off
DeviceAlarmSound: off
AX: off
TimingGraphics: off
Talk: off
ErrReport: off
DevReset: off
TLSEnable: off
TCM: off
NEC: off
ME: off
EWL: off
TSVO: off
TSVS: off
DLS: off
DHPenetrate: off
MesTrans: off
PicTrans: off
DataTrans: off
LRRF: off
LRRB: off
UPNP: off
AH: off
IOTTUNNEL: off
AlarmMD: off
PTZ: off
PT: off
PT1: off
PT2: off
AudioEncodeOff: off
AudioEncodeControl: off
AudioEncodeControl: off
FrameReverse: off
RemoteControl: off
Panorama: off
PanoOrder: off
WideAngle: off
MDW: off
MDS: off
HeaderDetect: off
FaceDetect: off
CollectionPoint: off
TimedCruise: off
SmartLocate: off
SmartTrack: off
NumberStat: off
ManNumDec: off
AlarmPIR: off
AlarmPIR: off
HUBAlarmPIR: off
AlarmPIR: off
AlarmPIR: off
MobileDetect: off
ZoomFocus: off
CloseCamera: off
HoveringAlarm: off
HA: off
HA: off
HA: off
BeOpenedDoor: off
RtFaceDetect: off
RtFaceCompa: off
CloseDormant: off
ElecReport: off
WifiReport: off
HeatMap: off
AiHumanCar: off
AiHuman: off
AiCar: off
WideDynamic: off
WDR: off
TalkSoundModify: off
VideoMotionSMD: off
ChnLocalStorage: off
OSD: off
1080P: off
MSS: off
ChnErrReport: off
CCR: off
CLW: off
CLDA: off
NVM: off
LEDS: off
ELCM: off
RL: off
CCS: off
CCSS: off
SDLIFE: off
PostFaceDetect: off
PostFaceAnalysis: off
OPLOG: off
INTERALARM: off
RUNLOG: off
LEDSW: off
DEVSHA: off
AudioTalk: off
AudioTalk: off
AlarmSound: off
Electric: off
WIFI: off
Linkagewhitelight: off
WLM : off
MotionDetect: off
pushNotifications: off

Switches:
localRecord: off
motionDetect: off
faceCapture: off
speechRecognition: off
breathingLight: off
smartLocate: off
smartTrack: off
localAlarmRecord: off
regularCruise: off
headerDetect: on
numberStat: off
manNumDec: off
alarmPIR: on
autoZoomFocus: off
audioEncodeControl: on
aecv3: on
faceDetect: off
localStorageEnable: on
whiteLight: off
linkageWhiteLight: off
linkageSiren: off
infraredLight: off
searchLight: off
hoveringAlarm: off
beOpenedDoor: off
closeCamera: off
mobileDetect: on
rtFaceDetect: off
rtFaceCompa: off
closeDormant: off
heatMap: off
tlsEnable: on
aiHumanCar: off
aiHuman: off
aiCar: off
openDoorByFace: off
openDoorByTouch: off
linkDevAlarm: off
linkAccDevAlarm: off
abAlarmSound: off
playSound: off
wideDynamic: off
smdHuman: off
smdVehicle: off
instantDisAlarm: off
periodDisAlarm: off
ccss: off
inll: off
ledsw: off
pushNotifications: off

Almost everything seems to be set to off, though...
Can this be useful to you? Can I help further? I really like this camera, so I am willing to cooperate to get the best of it in HA.
Thank you very much for your great work!

from imou_life.

user2684 avatar user2684 commented on May 29, 2024

Closing this since in v1.0.14 just released the additional parameter with channelId has been added. Thanks!

from imou_life.

user2684 avatar user2684 commented on May 29, 2024

Sorry @tango13 I missed your message. Yeah, not very informative the output of the command as I was afraid of :-(

from imou_life.

MiAutomations avatar MiAutomations commented on May 29, 2024

Hello

I just installed the new update for this integration

image

But I still not able to access the Live stream for the cell go device... even if I try to "activate" the stream from the IMOU APP

Is there any way to access the live stream for this camera model?

Thank you

from imou_life.

user2684 avatar user2684 commented on May 29, 2024

Reopening the issue. @tango13 is this new release working for you? I've added the channelId information in the API call. Thanks

from imou_life.

tango13 avatar tango13 commented on May 29, 2024

Yes, the new release works well for me, even though sometimes the video stream doesn't start from within HA.
Thank you.

from imou_life.

MiAutomations avatar MiAutomations commented on May 29, 2024

Yes, the new release works well for me, even though sometimes the video stream doesn't start from within HA. Thank you.

I still not able to load the stream from the cell go model camera with this new integration update ...

image

Can you please let me know if I need performing something more in order to get this working?

Thank you

from imou_life.

user2684 avatar user2684 commented on May 29, 2024

Thanks guys, So looks like the new version is working indeed but there is a problem with the streaming. Couple of questions:

  • Was the streaming working with the previous version of the integration?
  • Is the device a shared device from a different Imou account?

Thanks

from imou_life.

tango13 avatar tango13 commented on May 29, 2024
* Was the streaming working with the previous version of the integration?

For me, it was the same as now, that is sometimes it works, sometimes (well, I should say most of the times) it does not. When it doesn't work, I get a "Error with media stream contents".

* Is the device a shared device from a different Imou account?

Not in my case.

Thank you!

from imou_life.

tango13 avatar tango13 commented on May 29, 2024

By the way, is there any chance in your opinion to have the motion alarm sensor supported for this camera?
For me it is the most important feature I would use in HA, so I'm afraid I will be forced to return the camera if such a sensor is not available.
Thanks a lot for your precious work.

from imou_life.

MiAutomations avatar MiAutomations commented on May 29, 2024

Hello

I try several times during the last days with the new integration update and I never get the stream working SD or HD, even if I have Preload camera stream option available or even IF I start the stream with IMOU application in order to try "preload" the stream...

from imou_life.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.