-
Notifications
You must be signed in to change notification settings - Fork 90
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
Support for iMou devices (DAHUA based) #6
Comments
My guess is I need to implement this #4 and it'll work. I don't have the hardware to test with so it makes implementing it a little difficult. I'll try to buy one of these cameras soon to test with. |
Greatly appreciate it! |
Hi, I have cameras model IPC-A22E (Imou Ranger2) and another IPC-C22EP-IMOU (Imou Cue2). I have tried adding them and neither of the two models works but I want to try to do more tests and activate the debug mode that you mention in the readme.md. If you need me to try something to test the cameras, do not hesitate to let me know. |
@gelokatil that would be the same issue as #4 I'm buying one of those cameras this week so I can build in support for it. Not sure how long shipping will take, but hopefully not to long. |
I also have two iMou Ranger 2 IPC-A22E cameras. With the windows app Smart PSS can be controlled locally, even the PTZ. When configuring, the program uses port 37777. If you need us to do any testing, here we are. Thanks for everything! |
I just ordered this. It’ll arrive Monday and I’ll try to get it working ASAP. |
I'am not able to connect to a IPC-HFW2100P. Is it the same issue? br, |
@paalj69 I'm not sure. |
The hardware arrived today. I hope to test it out soon. Will report back as soon as I know more. |
I have an Imou Ranger 2 (IPC-A22E) too! Thanks! |
Just have a imou Ranger Pro which is a new version having 2K, is it similar with the imou ranger 2? Look like it is IPC-A26HP. |
@inevity probably the same API. Just a heads up, I finally got this device hooked up so now I can start hacking away :) I'll continue to keep you posted. Sorry for the delays! |
OK this is going to take some work. This camera uses the RPC2 API (which is better because it's json based). The other cameras support the same RPC2 API but the way I coded this integration up was with the REST API. I'll have to either build a translation layer or switch to the RPC2 API (it'll just take some time). I'll see what I can do. |
Ok rroller, thanks in advance for all your work |
Thank you for the work you are doing. I don't think it's very useful, but with the ConfigTool app, which is inside the ToolBox app, you can change the image settings, like switching the compression of the main video to H264, making it compatible with HA, the bitrate, resolution etc ... |
Just to keep everyone posted, I've started to write the first bit of code for this. Nowhere near done, but at least it's a start 😆 |
I have the basic commands working with the RPC2 API (login, logout, get device details). This works great for all my Dahua cameras but it still doesn't work for the iMou camera. It will require more digging to understand what's going on. |
As far as I can tell, these cameras do not have an HTTP API. Unfortunately you have to connect over a socket and send the commands according to their protocol as seen here https://github.com/mcw0/PoC/blob/master/Dahua-3DES-IMOU-PoC.py |
I doubt this will help at all... but I just released 0.8.13 which uses the rpc2 API during the config flow. Can some of you try with the latest 0.8.13 release to see if you get further along when trying to add an iMou camera? I really doubt it will help, but I'd like to rule it out. |
Hi, I've tested with IPC-A22E and IPC-C22EP-IMOU and gives on both this error message. DEBUG (MainThread) [custom_components.dahua] Attempting login with URL http://192.168.20.34:80/RPC2_Login Traceback (most recent call last): |
Imou Ranger 2 Logger: custom_components.dahua TimeoutError fetching information from http://192.168.1.134:80/cgi-bin/magicBox.cgi?action=getMachineName - :( I already use this camera in HA with a standard onvif config, but I have a lot of lag and no PTZ (so I can't control the camera), just image. |
Nevermind, i've got the same result with or without the ONVIF integration |
Hello rroller, Maybe this is wasting time but I have been playing with the code you have named and I have successfully managed to connect to my camera through the IMOU cloud, passing it as the camera serial parameter. I'm not a programmer at all, but maybe the part of the code that authenticates to the cloud could be redirected to the local IP of the camera instead of going through their cloud. I have achieved it with this command passing the camera serial as a parameter. python3 dahua_3des.py --dhp2p XXXXXXXXXXXX -dd |
@gelokatil thanks. We don't want to use the cloud here and would like to stay completely local. I should have mentioned this before... the local username is With the mcw0 tools I was able to restart the device which means everything we want to do is doable, but it's doing all of this over socket communication. Writing a client for that is very tedious |
@mabusdogma that's the same that I'm getting. It's because the Dahua integration is trying to speak HTTP to an API that doesn't understand HTTP so the iMou device just hangs waiting for the right header bytes. If I send the right bytes over a socket I can make progress but it's going to take me awhile to really write something that works and to fully understand the protocol based on @mcw0's work (and hope that the API isn't different from Dahua's HTTP api). Right now this is going to be low on my list of things to do as I want to build in more support for native Dahua cams. |
Guys, thanks for "alerting" in the post, please let me know how I could help you out. FYI, I mostly use Dahua undocumented API, not the same as their official CGI API. |
By the way, the undocumented API I am mostly using working 99.9% with both HTTP/HTTPS and DHIP (DHIP, what I guess you refer as socket), and 2nd, I do have few IMOU devices that I testing/playing with ) |
With this 'coaxial control' variant, I can enter the Imou IPC-A22E. Also the camera view works, the other entities don't seem to work. |
Hey, I have the same Imou camera, how did you make it work? I Installed the coaxial_control, set the username/password and so on, but I just get this message: Dahua device at 192.168.1.xxx isn't fully initialized yet Did you select some specific features? (at the beginning, there was a lot of checkboxes and I set them all on 'check', did you?) something else I'm missing, maybe? |
this is the error log:
|
Well, installing the coaxial control version, restart HA, and log in. If I reload the integration, it gives me the same error as you, but if I disable it and reactivate it, it logs in without problems. But little else can be done, since no sensor gives correct information, no switch works because from what I understand the cgi commands don't work. |
Now it works! but... is there a chance to use PTZ to control from HA? To be honest I started to follow this thread more than a year ago because I want to control on HA what the camera sees, and to open/close the camera, so I could inactivate video when I'm home for privacy. |
In fact, I'm the same as you, right now they are in a drawer precisely because there is no option to move or disable the video. I commented to report that the coaxial control version was logging into the Imou Ranger 2 IPC-A22E, the current main version never gets around to logging in. |
I can confirm this is working with the Cruiser SE+ (IPC-S21FE), including pan+tilt controls, but no mic support. |
Good news for people with Imou cameras: Just look at this! Now I can automate when to open and close the transmission (from HA) or detect people, or to set the alarm... |
Sadly that is a non-local solution, which is a deal-breaker for me. |
I hope there's a local solution soon, I like the idea too |
Hello, I bought the Ranger 2C... this is the fourth camera I bought, as you I am upset by manufacturers applications and clouds, I was thinking after few reading that this one was able to work locally without any requirment of creating an account or using a mobile app... I am also trying to hack this thing but dont want to loose a huge amount of time, I wonder if I am not going to re-sent this device... I got a ten years old camera from TPLink in my garage that I was able to make running in a cupple of minutes using its web gui... nowadays all mannufacturers try to force theirs applications this is really discouraging |
For now I have just connected to it using its Wifi AP and password written on the camera, doing a port scan give me 80 & 554 TCP open but no HTTP layer, any HTTP request fall in timeout, no response, at TCP layer just an ACK no payload. I'll try to use my computer as a wifi AP and make the first official steps, see what I can grab but I have few hopes to get anything usable. |
I knew, it was not going to be that simple... After a bit more than one hour here is what I was able to make : 1 - make my computer appear as to be the camera for the mobile application. 2 - make my computer appear as to be the mobile application for the camera So finally, the start of the scenario is : So next step, is to respond to the webcam for its DNS request for devaccess.easy4ipcloud.com an try to proxy all requests. Not sure I will do this. |
Use the SmartPSS application to change the DNS and hostname. You need to connect over TCP port 37777. The username is "admin" and the password is your |
The correct RTSP format looks like this
|
Yes in the mean time I bought an Amcrest camera (because it works with it own integrated web interface) and was nicely surprise to see that the mobile Amcrest application detect it aswell as other camera configuration application like Dahua conifg tool. Anyway, thanks for your tips. EDIT: SmartPSS is very nice |
Does your RTSP stream still work? Bought a brandnew IPC A22EP-0 (Ranger 2C), updated to firmware version 2.800.0000000.13.R.230708 and did not manage to make RTSP work Update: The problem was my VLC media player. |
HI eadmaster |
I have to ask again about this old post. :-) I just got an Imou Cruiser Dual (IPC-S7X-8M0WED) and can configure it individually using the Config Tool or Smart PSS. The integration with HA via HA Onvif integration also works. The same goes for the integration with my Dahua NVR via port 37777. But if I understand this correctly, it still doesn't work with the Dahua integration. Right? |
Most of the Imou consumer grade cameras do not have local HTTP API support. Most Imou cameras have ONVIF support and port 37777 is the default port for all cameras. A few exceptions do exist, mainly the older/first generation Imou cameras like the DH-IPC-K42 which is rebranded as an Imou Cube 4MP. The Imou product range is targeted for plug-n-play end users, baby cameras, etc. If you want to integrate with HA, stick with Dahua branded cameras. |
Are you sure? |
I am referring to the local Dahua HTTP API which is what this integration is built on. The Imou cloud API is entirely different. |
Hi, I've been using Dahua cameras and NVRs for many years, so I'm quite familiar with the differences between Dahua and Imou. ;-) I also know that not every Imou camera uses the Dahua API or is compatible with it. For example, I also use an Imou DB61i video doorbell/doorbell, which is 100% identical to the Dahua DH-DB6i and can also be used with Dahua integration via the Dahua API. The Imou Cruiser Dual (IPC-S7X-8M0WED) appears to me to also use the Dahua API, precisely because my Dahua NVR automatically recognizes it as a Dahua camera, and I don't have to integrate it via Onvif. The same applies to Dahua Smart PSS , the Dahua Config Tool and DMSS. Your statement "to change the DNS and hostname." sounded to me like I could change the settings via Smart PSS or the Config Tool so that the Imou camera would then be recognized by the Dahua integration and the error message "Username, Password, or Address is wrong" would no longer occur. Or maybe rroller has made some kind of adjustment over the years, since it seems to "only" be an issue with the auth.request. But I'm not a developer, so I can't judge how difficult it would be to fix the problem. `Dieser Fehler stammt von einer benutzerdefinierten Integration Logger: custom_components.dahua Could not connect to Dahua device. For iMou devices see #6 During handling of the above exception, another exception occurred: Traceback (most recent call last): Dieser Fehler stammt von einer benutzerdefinierten Integration Logger: custom_components.dahua TimeoutError fetching information from http://192.168.1.x:80/cgi-bin/magicBox.cgi?action=getMachineName |
The RTSP video stream is on port 37777 and this is how the DVR is connecting, it doesn't mean the camera has a local API. They are completely different things. You can easily test whether your camera has a local API by running a simple CURL. Just update the IP address and password
The DB61 should respond with
Try the same command with other cameras. |
The issue is already resolved for me, as I've already packed the Imou camera up again after extensive testing, and it's going back to Amazon tomorrow. :-) There were simply too many things that bothered me. For example, a limited PTZ control under HA with Onvif Integration and no presets. Since the Dahua integration apparently doesn't work with it, and cloud integration via https://open.imoulife.com/ is out of the question for me, I'll stick with the "real" Dahua cameras. I might also test the TP-Link Vigi models (e.g., Vigi C540), which I believe are also Dahua OEM models. The only difference is that the Vigi models don't seem to be as "slimmed down" as the Imou or Dahua Picoo models. PS: It's a shame that rroller hasn't had the time to further develop its integration in recent years. Although I can certainly understand that. If you look at the development of the Reolink or TP-Link Tapo integration over the last one to two years and how extensively they've been maintained and developed, it's clear why more and more HA users are turning to Reolink or Tapo cameras, while Dahua cameras under HA are playing a less and less important role. Personally, I find that a real shame. |
I'm familiar with all of that, too. I used to use also Axis and Hikvision cameras and then switched to Dahua about seven years ago. If I want high-quality IP cameras, I already know what to choose, but here/for me, it's also about HA. In other words: If I were to recommend high-quality IP cameras to someone, I would recommend Axis, Dahua, Hikvision, or possibly Hanwha. If I were to recommend IP cameras that work best with HA, I would currently recommend Reolink or TP-Link. Precisely because there is currently no such well-maintained and comprehensive integration for Axis, Dahua, Hikvision, or Hanwha for HA. Perhaps in the future, a developer will be found who has the time and desire to develop and maintain a new Dahua integration for HA. Until then, I will continue to use my Dahua cameras and Dahua NVR via HA Onvif integration. Maybe I'll get a Hikvision or even a Reolink camera again to test them out, although I have a certain aversion to Reolink due to their aggressive marketing and, in my opinion, rather poor quality. :-)) But that's all rather off-topic here, and my question about the Imou camera has been resolved. It doesn't work with the Dahua integration, and that's it. |
Is there chance of this working with imou Ranger 2 cameras, which are based on DAHUA IPC-A22EP?
The text was updated successfully, but these errors were encountered: