[RELEASE] Amcrest IPM-721 & IP2M-841 LIVE Video/PTZ/Night Vision/Motion/Video Record/+More IP Camera DTH

Yea, will have to look into it. I have to say, this is kind of a disappointing catch-22 coming from Foscam, and the main reason I moved from Foscam was the better resolution and general support/interface - there are improvements over my old Foscam but it sounds like there’s not as much flexibility ST-wise. Guess you can’t have your cake and eat it too.

Blue Iris software:

ST Blue Iris Fusion SmartApp to allow trigger configuration:

Some information on Blue Iris Profiles (I do not use “Schedules”. I just have a global Profiles set as Active, Home, Home Armed & Away under Options->Profiles within Blue Iris running as a service):

I do not have a lot of time to spend on a lengthy write-up, but read through some of this stuff and install the software, then let me know if you have specific questions.

Good luck!

I think we are confusing the functionality here… an API call is a GET, almost by definition. There is nothing that AMCrest could add to their API that would effectively create a “PUSH” notification. What is missing in this equation. and what I was referring to in my previous comments, was the existence of a web service (or cloud service) that would receive notifications from the camera and forward them to ST.

I do not believe this will ever happen with most IP camera manufacturers as it would require their writing some form of interface from their cloud service to ST, or the introduction of some form of “hub” for AMCrest IP cameras (similar to the Blink paradigm).

All of that being said, using something like Blue Iris and coding some kind of Perl script on your own web server to effectively push notifications is certainly possible, but it is waaay outside of my available “free time” to code.

And, as I have pointed out several times before, you can get around many of these limitations by using Open/Close sensors wire to the external Alarm hard-contacts available on some AMCrest camera models, you can use IFTTT to act on emails received from individual cameras, etc…

Can you please clarify? What specific functionality did you lose coming from a Foscam IP camera??

I thought I read somewhere that motion detection is something that was actionable via Foscam. Mode setting for Supplementary Foscam App, Foscam Motion Alarm Monitor - unless that’s something completely different?

Other references:

Okay, I will respond to these individually…

This setup uses a separate SmartApp in addition to the DTH that directly monitors Foscam alerts and requires OAuth authentication.

I already pointed this approach out as a workaround in post #426 of this thread.

This is the link to the DTH that references the SmartApp approach you mentioned in the first part of your post… so same setup for 1 & 3.

Sorry, but there is nothing new here short of everything that I already mentioned in my previous responses.

ps.

I want to add that nothing I have said here should be interpreted as a knock on RBoy’s work… his SmartApps and DTHs are top notch and well worth the small fee he charges for access!

My point was that his motion monitoring SmartApp has 2 modes, depending on the functionality of the Foscam camera in use. I believe the SD cameras have the ability for you to define a callback uri to “PUSH” alerts to, but the HD cameras require a periodic polling, in which case the SmartApp will “ask” if the motion sensor is active during every polling cycle (15 seconds?). You can reach out to RBoy if you want clarification.

Thanks for all the clarification!

Just like the Blue Iris suggestion above, you can use Synology’s Surveillance Station to expose the cameras to ST. SS can notify ST of events. Same idea. And you include the SS cameras as ST devices. . . . Blue Iris is probably better. I dunno. But you get lots of nice features with a diskstation. For instance, you can have the cloud backup software copy all your videos to cloud storage. I’m using Amazon’s unlimted drive storage. I can view my recordings online via the Amazon app (as well as the Synology app.) . . .

fwiw. I don’t watch camera feeds locally via ST. I use Tiny Cam Pro. It’s a great app. Nothing I’ve seen comes close.

Now if I could only get stills from my new Amcrest camera to show up in Action Tiles. . . . My HIKVision cameras work fine. Oh well.

Just define a Media tile as a still image with a refresh rate using the following URL, adjust the IP to your value (substitute your [username] and [password] without the ):

http://[username]:[password]@192.168.2.219/cgi-bin/snapshot.cgi?1

Works like a charm.

I’ve tried that. It works fine in Chrome on my computer, but it fails on the tablet. The tablet can’t get the image. I think it’s the outdated authentication format. I tried allowing anonymous access and other things, such as defining a use with no password. . . Nothing works.

Just an update for those with the IP2M-841B camera (and possibly others) with the latest firmware. Amcrest has officially acknowledged this as a bug and is working on a firmware fix. Unfortunately they would not tell me a timeframe. They originally told me a new firmware was to be released last week but I think that it has been delayed for this bug fix. If I hear more I will let you all know.

2 Likes

Did something change/break recently? I know there are issues with the Digest-Authenitcation issue but when I added my first Amcrest IPM-841 (which was after that firmware upgrade), I had no problem connecting to the cam via port 80 in the device settings. I was able to view the stream in the ST device at that point in time but I just checked earlier today and now, after adding the second IPM-841, and both say “Camera Unavailable”

Are they on the same port?

Amcrest has released a new firmware for the IP2M-841B. I will try it tonight to see if it resolves the Basic Authentication issue. I’ll let everyone know of the results.

As a note: I don’t see a specific mention of this bug in the change log. Also this new version requires resetting the camera to factory default.

The firmware can be found at https://amcrest.com/firmware

1 Like

As an update, this new firmware unfortunately does not fix the issue. I just received an update from Amcrest and they said that they are still working on the bug and that yes it is not resolved in the latest firmware.

1 Like

Thanks for testing. Will have to wait for next firmware update if it’s included

@Belgarion Can the authentication type in the header be changed to try basic auth and if it fails, attempt digest?

I have used the Python Amcrest module and this is how they solved this particular issue. See the code below:

def _generate_token(self):
    """Discover which authentication method to use.
    Latest firmwares requires HttpDigestAuth
    Older firmwares requires HttpBasicAuth
    """
    url = self.__base_url('magicBox.cgi?action=getMachineName')
    try:
        # try old firmware first to force 401 if fails
        self._authentication = 'basic'
        auth = requests.auth.HTTPBasicAuth(self._user, self._password)
        req = requests.get(url, auth=auth)
        req.raise_for_status()

    except requests.exceptions.HTTPError:
        # if 401, then try new digest method
        self._authentication = 'digest'
        auth = requests.auth.HTTPDigestAuth(self._user, self._password)
        req = requests.get(url, auth=auth)
        req.raise_for_status()

        # check if user passed
        if 'invalid' in req.text.lower() or \
           'error' in req.text.lower():
            _LOGGER.info("%s Invalid credentials", req.text)
            raise
    return auth

This is the problem. There is no such animal in ST world.

As far as I know ST does not expose any Digest authentication API, which is why I have not attempted to resolve the issue.

@Belgarion
Is it possible to write our own implementation of Digest Auth. There is one example in PHP for reference:

We need to make two rest call, first one to get the header, “nonce, realm etc.” the other to use those headers and generate digest hash. All we need is MD5, I know we have that feature available in smartthings groovy.

import java.security.MessageDigest
def MD5(s) {
	def digest = MessageDigest.getInstance("MD5")
	new BigInteger(1,digest.digest(s.getBytes())).toString(16).padLeft(32,"0")
}
1 Like

Hi Kins,

I understand how to code Digest Authentication. The issue is that the ST platform back-and-forth parsing would make this almost impossible.

You essentially would need to:

  1. Post the first request, which would fail and present the pieces needed to perform the Digest Authentication.
  2. Parse the response of the failure to gather the pieces of information needed and post the corrected Digest Authentication request.
  3. Parse the new response and act accordingly.

During this process you would need to keep track of each request that was going on, whether it is taking a snapshot, PTZ functions, etc…

Could all of this be coded and tested? Possibly. But it would be a hack job at best to even make the attempt.

This requires a ST supported API, IMHO.

If someone can point me in the direction of a model that ST supports, I will be happy to add it… I just do not think such an animal exists.

1 Like