Release Foscam HD - Video feed with camera controls, and motion/sound detection preview
Possible fix for cheap 40.00 IP Cams from China under various names.

1) Download and install PyCharm.
2) Download Filezilla or some other FTP program.
3) If your using an android set top box, download EZ file via playstore.
4) If using android. Load EZ File and go to network to start sharing so you can access your box via FTP.
5) If on android go to Android/data/org.xbmc.files/.kodi/addons/packages
6) Copy to your local drive.
7) Extract the file to a directory.
8) Open these two files using PyCharm:

Make the following changes:
Add this under self._url_cameracontrol inside __init__
        self.url_camerastatus = "http://{0}:{1}/get_status.cgi?{{0}}&user={2}&pwd={3}".format(host,
top of send_command should be replaced and it should read:
        print cmd
        if 'param=5' in cmd: url = self._url_cameracontrol.format(cmd)
        elif 'getDevState' in cmd: url=self.url_camerastatus.format(cmd)
        else: url = self._url_fmt.format(cmd)
        if params is not None:
            url += "&" + urllib.urlencode(params)
search for alarm_check and top of routine should read this:
    def alarm_check(self):
        if self.motion_enable or self.sound_enable:
            player = xbmc.Player()
            if player.isPlaying() and player.getPlayingFile() ==

            self.alarm_active = False
            dev_state =
            if dev_state:
                for alarm, enabled in (('alarm_status', self.motion_enable),
                                       ('sound_status', self.sound_enable)):
                    if enabled:
                        param = "{0}Alarm".format(alarm)
                        alarm_status = dev_state[param]
                        utils.log_verbose("{0:s} = {1:d}".format(param, alarm_status))
                        if alarm_status == 1:
                            self.alarm_active = True
                            utils.log_normal("Alarm detected")

This is simply a hack to get the program to check the cheap china cams for the alarm status of motion being detected. the existing routines were trying to find the status for a URL that doesn't exist on the cheaper cams.
I didn't add any support for you to be able to SET your motion detection from the Kodi arena... You still have to set that on the camera.
I also don't believe the sound detection will function on the cheaper china cams like the one I have. Maybe if I get some time and a better DEV env I could work it out... But for now I wanted to share.

Once your done with all your changes you must zip it back up (using standard zip) and place it back in the same directory you got it from.
Then go into Kodi and find it in your list... Install it.

This code is untested... But should be pretty close.

Here is the URL to get the alarm (motion) status from your cheap china cam:

Good luck.

Messages In This Thread
RE: Foscam HD - by George - 2014-03-27, 17:30
Code changes for the cheap China Cameras - by vtwin4Christ - 2015-12-07, 11:03

Logout Mark Read Team Forum Stats Members Help
Foscam HD - Video feed with camera controls, and motion/sound detection preview1
This forum uses Lukasz Tkacz MyBB addons.