Foscam HD Camera Device Type

Any word on when something like this might be done?

I have this set up and working. It turns on the motion alarm but doesn’t turn on, take snapshot, video record and email. I was wanting to turn on the motion detection, which it does, but then also email me pictures. Is this something that can be added? Or is it supposed to do this and mine just isn’t.

1 Like

I was under the impression I would be able to see the camera motion (VIDEO STREAM) (Foscam) here. But then I read some postings stating it’s only the image capture. So I am confused. How can I capture an image if I can’t see what’s happening. So I just capture random images at random times to emulate having a camera and knowing what’s going on based on static images? Is that the idea? If not, where would I see the camera image rolling? I do have all settings correct. It used to say active but now it says inactive. So I don’t understand. Regardless, I see the whole interface on the ST app for the camera.

1 Like

The idea is that you set up your system to capture images based on events like motion detection, door/window opening, etc. Streaming video would be nice, but it’s not possible with current ST hardware.

Has anyone looked at modifying the code for Foscam Smart Preset? I am not to good with coding but this app works great for the Foscam 8910w using Imbrianj’s code. However when I used the Foscam Hd Device Type, which is awesome by the way,I loose this capability because presets are not the same coding. This is a feature I would really like to have with 9821w. Please let me know if there is anyone that can help. I have pasted the code below. Thanks

/**

  • Foscam Smart Preset
  • Copyright 2014 Jake Rorrer
  • Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at:
  •  http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
  • on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
  • for the specific language governing permissions and limitations under the License.

*/
definition(
name: “Foscam Smart Preset”,
namespace: “”,
author: “Jake Rorrer”,
description: “Moves Foscam cameras to a preset based on activity detected by motion or multi-sensors. That way your Foscam will be properly positioned and ready to snap a photo when a burglar comes into frame.”,
category: “Safety & Security”,
iconUrl: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png”,
iconX2Url: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png”)

preferences {
section(“When there’s movement or a door opens
”) {
input “motion”, “capability.motionSensor”, title: “Motion Here”, required: false, multiple: true
input “contact”, “capability.contactSensor”, title: “Contact Opens”, required: false, multiple: true
input “acceleration”, “capability.accelerationSensor”, title: “Acceleration Detected”, required: false, multiple: true
}

section("Move to this preset...") {
	input "preset", "enum", metadata:[values:[1, 2, 3]], required: false
}

section("For these Foscam cameras...") {
	input "foscams", "capability.imageCapture", multiple: true, required: false
}

}

def installed()
{
subscribeToEvents()
}

def updated()
{
unsubscribe()
subscribeToEvents()
}

def subscribeToEvents() {
subscribe(contact, “contact.open”, motionActiveHandler)
subscribe(acceleration, “acceleration.active”, motionActiveHandler)
subscribe(motion, “motion.active”, motionActiveHandler)
}

def motionActiveHandler(evt) {
log.trace “$evt.value: $evt, $settings”

log.debug "Detected movement or door opening, moving Foscam to preset $newpreset position"


if(newPreset) {
def preset = new Integer(newPreset)

log.info("Preset: ${preset}")
foscams?.preset(preset)

}

}

1 Like

Detects motion and sets off motion event! Note I do not have HD foscam so only fitted for other none HD, but someone with HD should be able to take what was done and implement and test.

I have the HD Foscam 9821 V2. I believe the problem is when the camera is unchecked to not record motion, it loses all of its settings. So when I leave my house, this app will check to record motion, but none of the other settings are correct because the foscam has forgotten them. I would need to go back in there an manually tell it to send email, select the area to record motion, ect. Is this something that can be added to the app?

Yep, that is the case. I have the same one. The device type can be easily modified to do that. Here are the instructions (it was based off @jody.albritton’s code in that thread)

You would modfy this section in @justinlhudson’s code

def alarmOn() {
 // //log.debug "Enabling Alarm"
    sendEvent(name: "alarmStatus", value: "on");
    if(hdcamera == "true") {
    hubGet("cmd=setMotionDetectConfig&isEnable=1")
    }
    else {
      hubGet("/set_alarm.cgi?motion_armed=1&")
    }
}

Thanks! This fixed my issue.

I’ve installed this device type, but can’t figure out what category it appears in in the ST app. So I can’t select it when connecting a new device.

I’ve hard restarted the app to refresh and still no luck.

I don’t think you can install it from the app any more. You have to add it from the devices page in the IDE and then configure it

I added it in the IDE. It does not appear in my app.

I installed this device handler. Click take photo in android app but nothing happens.
I assume the picture would show in the smartthings app, correct?

any ideias?

regards

The picture taken was broken due to ST API changes. I got them fixed last night and will post the source code later. There are other things need to be fixed for example LED light and alarm switch.

I checked other version of this DH. The V2 and V3 are in worse shape. I decided to work on the original version. Let me know if you need any particular feature from v2 or v3.

I am also thinking to integrate alarm notification into the device. There is no way to do that with Foscam CGI interface. It will not be a straightforward integration and most likely need a web server to relay the event.