# Android IP Camera Device

**URL:** <https://community.smartthings.com/t/android-ip-camera-device/12027>\
**Category:** Devices & Integrations\
**Created:** [March 1, 2015, 5:19pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027 "2015-03-01T17:19:35Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![rob\_a\_landry](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/rob_a_landry/32/13726_2.png) [@rob\_a\_landry](https://community.smartthings.com/u/rob_a_landry)\
**Post date:** [March 1, 2015, 5:19pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/1 "2015-03-01T17:19:35Z")

</div>

This is a custom device type. This works with the Android IP Camera app. It allows you to take photos, record video, turn on/off the led, focus, overlay, and night vision. It displays various sensors including battery level, humidity, temperature, and light (lux). The sensor data is all dependent on what your phone supports.

1. First you must create the device type:  
[https://graph.api.smartthings.com/ide/devices](https://graph.api.smartthings.com/ide/devices).  
Copy this code there.
2. Then you must create the device:  
[https://graph.api.smartthings.com/device/list](https://graph.api.smartthings.com/device/list).
3. Install the app on your phone.  
[https://play.google.com/store/apps/details?id=com.pas.webcam.pro](https://play.google.com/store/apps/details?id=com.pas.webcam.pro).  
I recommend the paid version, but the free works as well.
4. You have to adjust your router settings to allow the port to be forwarded to your phone.  
I set up static ip addresses for my phones with different ports forwarded. (ie 8091, 8092, …).
5. I also installed the paid version of dropsync.  
[https://play.google.com/store/apps/details?id=com.ttxapps.dropsync.pro](https://play.google.com/store/apps/details?id=com.ttxapps.dropsync.pro).  
This will allow you to upload the videos/photos to a custom dropbox folder.  
My setup is /IP Camera/{the camera name}.
6. Dont forget to setup the device in the smartthings mobile app. Use your external ip address.  
[http://www.ipchicken.com](http://www.ipchicken.com) will give this to you.
7. Also if you use this with the Action Dashboard:  
[ActiON Dashboard 4.6.3 is here! (Now SmartTiles.click)](http://community.smartthings.com/t/action-dashboard-4-6-3-is-here/8149).  
You will need to set the url to “[http://username](http://username):password@{hostname or ip}:port/video”

Hope you like it. Feel free to provide feedback.

> <https://github.com/roblandry/android-ip-camera.device/blob/master/android-ip-camera.device.groovy>

---

<div class="post-metadata">

**Author:** ![tgauchat](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/tgauchat/32/49516_2.png) [@tgauchat](https://community.smartthings.com/u/tgauchat)\
**Post date:** [March 1, 2015, 6:02pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/2 "2015-03-01T18:02:06Z")

</div>

> [@rob\_a\_landry](#):
>
> I am having issues with some of the buttons as when one is selected…

I speculate the problem may that you are using the same state variables or values (on/off) in multiple Tiles.

But the code looks sensible. Maybe experiment around my speculation…

---

<div class="post-metadata">

**Author:** ![Todd\_Whitehead](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/todd_whitehead/32/13810_2.png) [@Todd\_Whitehead](https://community.smartthings.com/u/Todd_Whitehead)\
**Post date:** [March 1, 2015, 7:19pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/3 "2015-03-01T19:19:15Z")

</div>

How do you use this? Does this allow an Android device with a camera to be a ST camera?

If so, how do I connect the Android device?

Thanks!  
-Todd

---

<div class="post-metadata">

**Author:** ![rob\_a\_landry](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/rob_a_landry/32/13726_2.png) [@rob\_a\_landry](https://community.smartthings.com/u/rob_a_landry)\
**Post date:** [March 1, 2015, 8:38pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/4 "2015-03-01T20:38:51Z")

</div>

Thanks @tgauchat , That fixed it, the code is updated and fully functional.

---

<div class="post-metadata">

**Author:** ![rob\_a\_landry](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/rob_a_landry/32/13726_2.png) [@rob\_a\_landry](https://community.smartthings.com/u/rob_a_landry)\
**Post date:** [March 1, 2015, 8:51pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/5 "2015-03-01T20:51:38Z")

</div>

@Todd_Whitehead I have updated the OP with the necessary info.

---

<div class="post-metadata">

**Author:** ![pstuart](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/pstuart/32/82936_2.png) [@pstuart](https://community.smartthings.com/u/pstuart)\
**Post date:** [March 1, 2015, 8:54pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/6 "2015-03-01T20:54:42Z")

</div>

Which android app is it?

This one:

> <https://play.google.com/store/apps/details?id=com.pas.webcam>
>
> IP Webcam turns your phone into a network camera with multiple viewing options. View your camera on any platform with VLC player or web browser. Stream video inside WiFi network without internet access.Optional Ivideon cloud broadcasting is supported for instant global access.Two-way audio supported in tinyCam Monitor on another android device.Use IP Webcam with third-party MJPG software, including video surveillance software, security monitors and most audio players.Features include:• Video upl...

---

<div class="post-metadata">

**Author:** ![rob\_a\_landry](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/rob_a_landry/32/13726_2.png) [@rob\_a\_landry](https://community.smartthings.com/u/rob_a_landry)\
**Post date:** [March 1, 2015, 8:58pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/7 "2015-03-01T20:58:40Z")

</div>

@pstuart yes, thats the free version. I again updated the OP with the playstore links. 😄

---

<div class="post-metadata">

**Author:** ![rob\_a\_landry](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/rob_a_landry/32/13726_2.png) [@rob\_a\_landry](https://community.smartthings.com/u/rob_a_landry)\
**Post date:** [March 5, 2015, 8:06pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/8 "2015-03-05T20:06:46Z")

</div>

I wrote an app to work with this device. Check it out.

> [@Camera Record App](http://community.smartthings.com/t/camera-record-app/12288):
>
> Continuing the discussion from [Android IP Camera Device](http://community.smartthings.com/t/android-ip-camera-device/12027): This app was designed to work with the Android IP Camera device [http://github.com/roblandry/android-ip-camera.device](http://github.com/roblandry/android-ip-camera.device). You can record video or take a burst of photos when a trigger is activated. Acceptable triggers are motion, contact, acceleration, switch, presence, smoke, water, button, modechange, and schedule. There is also a time delay to allow the camera to continue recording once the trigger has stopped (ie. motion ceased, continue recording for 5 minutes). Hope you like it. Feel free to provide feedback.

---

<div class="post-metadata">

**Author:** ![CodyWillner](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/codywillner/32/15157_2.png) [@CodyWillner](https://community.smartthings.com/u/CodyWillner)\
**Post date:** [March 22, 2015, 8:41pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/9 "2015-03-22T20:41:23Z")

</div>

Hey @rob_a_landry, thanks for putting something like this together! I’m trying to get it it work but it’s just not working correctly for me yet. I am using an old Samsung GS3 for the camera/device. I created the device type in IDE, then created the device, downloaded the free version of the IP Webcam onto the SG3, found the internal IP address, forwarded a HTTP port on my router from that IP address (made it 8081), checked the external IP of the SG3 and put that into the ST preferences for the ST app, and I still cannot get it to work. I started a stream from the SG3 IP camera app, and used the phone’s internal IP address and port to open up a browser window. I can get to the settings on that window, but nothing else seems to work. In the ST settings, I tried both the internal and external IP address, the port number I forwarded and the remote port that showed up on IPChicken, and still nothing. When testing, I would try to take a photo from ST app, and sometimes it would freeze up, but no photo ever showed up on ST.

Is it required that we use something like Dropsync? Is that my issue? From the OP, I thought it may be optional. I was hoping to just see a stream on my ST app dashboard and then, hopefully, set it up on SmartTiles. Am I doing something else wrong setting up the IP’s or with port forwarding? Any help would be much appreciated!

My goal is to have a tablet and a phone mounted in the house running SmartTiles/ActiON, and also have both of those run this IP Camera, as they will be mounted where I need cameras. Thanks!

---

<div class="post-metadata">

**Author:** ![Dan999](https://avatars.discourse-cdn.com/v4/letter/d/ed8c4c/32.png) [@Dan999](https://community.smartthings.com/u/Dan999)\
**Post date:** [March 23, 2015, 1:53pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/10 "2015-03-23T13:53:54Z")

</div>

I’ve got it working with an old Droid Razr. Did you verify that you can get to the browser interface through the external IP (not using SmartThings)?

Thanks to @rob_a_landry for sharing.

I am totally guessing here that httpGet in the code below will run in the cloud and not on the hub. Thus the need for the external IP address.

```
httpGet("http://${username}:${password}@${url}:${port}/photo_save_only.jpg"){
	httpGet("http://${username}:${password}@${url}:${port}/photo.jpg"){
		response -> log.info("${device.label} image captured")
		parseCameraResponse(response)
	}
}

```

I tried to rewrite the code using hubActions, but I could not get the two requests to ever produce a picture. I tried doing a GET followed by a delayed hub action followed by the final GET.

The reason I would like this to use hubAction / parse() is that the code will then run on the local network and I can close the hole on the firewall. I don’t need live streaming for this application, and I don’t like to open up unnecessary holes in the firewall.

---

<div class="post-metadata">

**Author:** ![sgnihttrams](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/sgnihttrams/32/32358_2.png) [@sgnihttrams](https://community.smartthings.com/u/sgnihttrams)\
**Post date:** [April 24, 2015, 2:53pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/11 "2015-04-24T14:53:49Z")

</div>

nevermind 🙂

* * *

---

<div class="post-metadata">

**Author:** ![NotSoSmart](https://avatars.discourse-cdn.com/v4/letter/n/f0a364/32.png) [@NotSoSmart](https://community.smartthings.com/u/NotSoSmart)\
**Post date:** [June 5, 2015, 2:17pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/12 "2015-06-05T14:17:08Z")

</div>

This is great thanks for taking the time and effort to do this.

I do have a question - when creating the device what do I out under “device network id”? I had the full address, what I can type into my browser to see the camera. Then in all I put the ip and the port separately. I’m not getting an image though, no connection it seems. I have it forwarded and working in a few different apps and devices so I know the forwarding is functining the way it should be.

Also, does it matter if my port forward is set to https rather than http?

---

<div class="post-metadata">

**Author:** ![Jason\_Fay](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jason_fay/32/15424_2.png) [@Jason\_Fay](https://community.smartthings.com/u/Jason_Fay)\
**Post date:** [June 26, 2015, 1:57pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/13 "2015-06-26T13:57:26Z")

</div>

If I understand this other post correctly, the network device id can be anything as long as its unique. The author says keep it short, sweet, and descriptive:

> [@FAQ: Creating a virtual Groovy Device \[OBSOLETE\]](http://community.smartthings.com/t/faq-creating-a-virtual-device/11282/2):
>
> Virtual / Simulated Device Types are functional “Things” but are not physical devices you have. Installing them allows you to control them via SmartApp’s just as you would a physical smart device. Creating Virtual Devices - On/Off Switches There are many reasons you’d have the need for a virtual switch. You want one switch to control multiple other switches and/or commands. You have a multi relay device and want to control the relays individually. (currently ST doesn’t support this) You could use virtual switches the same way you’d use Hello Home Actions, to take care of multiple actions or state changes with the change of your virtual switch state. To create a Virtual Switch Login to the IDE @ [https://graph.api.smartthings.com/](https://graph.api.smartthings.com/) Click “My Devices” Click the “New Device” Button Ente…

I’ve managed to get through step 3 successfully. I’ve never played with port forwarding, though, so I’m still muddling through this.

---

<div class="post-metadata">

**Author:** ![Jason\_Fay](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jason_fay/32/15424_2.png) [@Jason\_Fay](https://community.smartthings.com/u/Jason_Fay)\
**Post date:** [June 26, 2015, 2:01pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/14 "2015-06-26T14:01:37Z")

</div>

@Dan999 - I would love to see this option. Did you make any additional progress?

---

<div class="post-metadata">

**Author:** ![Dan999](https://avatars.discourse-cdn.com/v4/letter/d/ed8c4c/32.png) [@Dan999](https://community.smartthings.com/u/Dan999)\
**Post date:** [June 27, 2015, 12:31am UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/15 "2015-06-27T00:31:05Z")

</div>

> [@Jason\_Fay](#):
>
> @Dan999 - I would love to see this option. Did you make any additional progress?

I gave up on using a phone. I needed a camera in the garage, which is not air-conditioned, and I think the phone kept rebooting when it got too hot. I replaced the phone with a “real” IP camera that I got at Costco, using another IP camera device available from the community.

---

<div class="post-metadata">

**Author:** ![smartmat](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@smartmat](https://community.smartthings.com/u/smartmat)\
**Post date:** [September 22, 2015, 1:06pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/16 "2015-09-22T13:06:25Z")

</div>

hi  
I was triying to install this app but I am getting erros  
× Org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: script1442926809777964417830.groovy: 114: expecting ‘)’, found ‘backgroundColors’ @ line 114, column 8. 98 backgroundColors:[ ^ 1 error

please help me I am new to smartthings

---

<div class="post-metadata">

**Author:** ![pstuart](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/pstuart/32/82936_2.png) [@pstuart](https://community.smartthings.com/u/pstuart)\
**Post date:** [September 22, 2015, 3:05pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/17 "2015-09-22T15:05:59Z")

</div>

Try installing it as a device not a smartapp.

---

<div class="post-metadata">

**Author:** ![smartmat](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@smartmat](https://community.smartthings.com/u/smartmat)\
**Post date:** [September 23, 2015, 1:14pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/18 "2015-09-23T13:14:47Z")

</div>

success…thanks for the replay

---

<div class="post-metadata">

**Author:** ![sgnihttrams](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/sgnihttrams/32/32358_2.png) [@sgnihttrams](https://community.smartthings.com/u/sgnihttrams)\
**Post date:** [October 9, 2015, 2:20pm UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/19 "2015-10-09T14:20:49Z")

</div>

How much of a problem is it to have the password exposed in the URL like that?  
I mean…it’s a problem.

I know this is just experimental and all, and I really like the concept, but do you have a plan for making it more secure (or is there anything we can do on our end that I’m not thinking of) in the future?

---

<div class="post-metadata">

**Author:** ![rob\_a\_landry](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/rob_a_landry/32/13726_2.png) [@rob\_a\_landry](https://community.smartthings.com/u/rob_a_landry)\
**Post date:** [October 10, 2015, 11:39am UTC](https://community.smartthings.com/t/android-ip-camera-device/12027/20 "2015-10-10T11:39:21Z")

</div>

Due to the way httpget works i think this is the only way. Honestly i havent used this setup in months, but i could try setting the username and pwd in a header and see the results. Hang tight and ill tinker.

[Next page](https://community.smartthings.com/t/android-ip-camera-device/12027.md?page=2)
