IP Cam Viewer     My Amazon IP Cameras    

Smartthings integration to turn motion notifications on/off

Support for my free Android Applications.

Smartthings integration to turn motion notifications on/off

Postby admin » Fri Aug 22, 2014 2:02 am

This article is for people that use IP Cam Viewer to record their cameras 24x7 and also have a smartthings hub.

Image

I use IP Cam Viewer on a spare android device to record 2 groups of cameras ("record away" and "record home").
When I'm at home, I record the "home" group and have motion notifications turned off globally (see Record Settings).
When I leave, I change to the "away" group (which records more rooms) and turn on motion notifications globally (although each camera can override this, see each camera's More Options screen).

You probably know that IP Cam Viewer has an embedded web server that allow you to turn MD on/off and recall groups away from home with just a browser.
However, the web interface is bare metal right now (I'm building it up still). Great for integration though.

If you have a smartthings hub, this article will help you automate the above steps into the Smartthings app. You get GUI buttons to turn motion notifications on/off and buttons to switch camera groups.

In addition, you can configure smartthings to automatically turn MD on and switch to an "away" camera group when you leave and then reverse when you get home.

Finally, you can add any camera supported by IP Cam Viewer into SmartThings via the app's embedded web server.

Image Image

---
OK. Let's Start...

1. You have IP Cam Viewer running in record mode and you can already bring up the embedded browser interface.
- goto App Settings to see the IP and Port used by the embedded web browser.
- App Settings is also where you set the viewer and admin name/password for the embedded web server.

Image
Image

2. You have smartthings hub already setup with their mobile app.
- get familiar with their app, try to setup so a light goes on when away and off when home.
- now, log into smartthings browser IDE (https://graph.api.smartthings.com) and check out your hub, devices, etc...

Image

3. Create 'IP Cam Viewer Record Mode Motion Notifications' device type
- in the smartthings IDE, click the "My Device Types" tab
- click the "+ New SmartDevice" button in the upper right corner
- in the "New SmartDevice" screen, enter the following:
- Name: IP Cam Viewer Record Mode Motion Notifications
- Namespace: com.rcreations.ipcamviewer.RecordModeMotionNotifications
- Capabilities: select "Switch"
- leave all other fields default
- click "Create" button at bottom of screen
- now, select the newly created device type
- copy and paste the code from here http://hit-mob.com/smartthings/ipc_record_mode_motion_notifications.txt and press save
- click Publish and select "For Me"
- we won't test it just yet. we need to setup a device (see below)

4. Create device that uses 'IP Cam Viewer Record Mode Motion Notifications' device type
- in the smartthings IDE, click the "My Devices" tab
- click the "+ New Device" button in the upper right corner
- in the "Create Device" screen, enter the following:
- Name: IP Cam Viewer Record Mode Motion Notifications
- Label: Record Mode Motion Notifications
- Type: scroll to the bottom of the list and select "IP Cam Viewer Record Mode Motion Notifications"
- Version: Published
- Location: select your home location
- Hub: select your hub
- leave all other fields default
- click "Create" button at bottom of screen
- now, select the newly created device
- find the row that says "Preferences (edit)" and click on the "(edit)" link
- enter the connectivity information for IP Cam Viewer's embedded web server (test parameters with browser first)
- Admin username/password: turning MD on/off requires admin account (see App Settings in app)
- IP/Port: see App Settings inside app
- click Save to save the preferences for the device

5. test the motion notifications device type
- click on "My Device Types" tab
- click the 'IP Cam Viewer Record Mode Motion Notifications' device type
- click the "Set Location" button in the upper right corner
- expand the "device" list by clicking the down arrow
- under the "Physical Devices", select the "Record Mode Motion Notifications" device
- click the "Install" or "Update" button
- a Tools section will now be visible, which will allow you to test the device
- click the "poll" button and it should retrieve the current global motion notifications value
- click the "on"/"off" button to change the global motion notifications value
- launch the smartthings mobile app
- under "Things", you should see the new "Record Mode Motion Notifications" thing
- you can turn md on/off just like the ide.

6. Configure smartthings to turn motion notifications on when in away mode
- run the smartthings mobile app
- in the "Dashboard" screen, click the menu button in the upper right corner
- the screen now says "Hello, Home". click the settings button in lower right corner
- the screen now says "Your Actions", click the "Goodbye!" action
- click the "Turn on these lights or switches" option
- Select the "Record Mode Motion Notifications" item
- now, when you say Goodbye (or automatically via presense devices), the global motion notifications switch will be turned ON
- click Done button in upper right corner (twice)
- the screen now says "Your Actions", click the "I'm Back!" action
- click the "Turn off these lights or switches" option
- Select the "Record Mode Motion Notifications" item
- now, when you say I'm Back! (or automatically via presense devices), the global motion notifications switch will be turned OFF
- click Done button in upper right corner (twice)

Image

Great. If you only have one group of cameras to record, then you're done!

---
If you want to record a larger set of cameras when away, then continue below.

1. Create 'IP Cam Viewer Recall Camera Group' device type
- in the smartthings IDE, click the "My Device Types" tab
- click the "+ New SmartDevice" button in the upper right corner
- in the "New SmartDevice" screen, enter the following:
- Name: IP Cam Viewer Recall Camera Group
- Namespace: com.rcreations.ipcamviewer.RecallCameraGroup
- Capabilities: select "Switch"
- leave all other fields default
- click "Create" button at bottom of screen
- now, select the newly created device type
- copy and paste the code from here http://hit-mob.com/smartthings/ipc_recall_camera_group.txt and press save
- click Publish and select "For Me"
- we won't test it just yet. we need to setup a device (see below)

2. Create device that uses 'IP Cam Viewer Recall Camera Group' device type
- in the smartthings IDE, click the "My Devices" tab
- click the "+ New Device" button in the upper right corner
- in the "Create Device" screen, enter the following:
- Name: Record Camera Group
- Label: Record Camera Group
- Type: scroll to the bottom of the list and select "IP Cam Viewer Recall Camera Group"
- Version: Published
- Location: select your home location
- Hub: select your hub
- leave all other fields default
- click "Create" button at bottom of screen
- now, select the newly created device
- find the row that says "Preferences (edit)" and click on the "(edit)" link
- enter the connectivity information for IP Cam Viewer's embedded web server (test parameters with browser first)
- Admin username/password: turning MD on/off requires admin account (see App Settings in app)
- IP/Port: see App Settings inside app
- Camera Group When On: name of camera group to record when motion notifications is ON
- Camera Group When Off: name of camera group to record when motion notifications is OFF
- click Save to save the preferences for the device

3. test the recall camera group device type
- click on "My Device Types" tab
- click the 'IP Cam Viewer Recall Camera Group' device type
- click the "Set Location" button in the upper right corner
- expand the "device" list by clicking the down arrow
- under the "Physical Devices", select the "Record Camera Group" device
- click the "Install" or "Update" button
- a Tools section will now be visible, which will allow you to test the device
- click the "on"/"off" button to recall the camera groups
- launch the smartthings mobile app
- under "Things", you should see the new "Record Camera Group" thing
- you can turn it on/off to recall the camera groups just like the ide.

4. Configure smartthings to "on" camera group when in away mode
- run the smartthings mobile app
- in the "Dashboard" screen, click the menu button in the upper right corner
- the screen now says "Hello, Home". click the settings button in lower right corner
- the screen now says "Your Actions", click the "Goodbye!" action
- click the "Turn on these lights or switches" option
- Select the "Record Camera Group" item
- now, when you say Goodbye (or automatically via presense devices), the "on" camera group will be recalled
- click Done button in upper right corner (twice)
- the screen now says "Your Actions", click the "I'm Back!" action
- click the "Turn off these lights or switches" option
- Select the "Record Camera Group" item
- now, when you say I'm Back! (or automatically via presense devices), the "off" camera group will be recalled
- click Done button in upper right corner (twice)

Image

You are done. Switching between "away" and "home" modes in smartthings will automatically turn IP Cam Viewer's global motion notification setting on/off and recall the proper camera group for recording.

---
Finally, add a camera into SmartThings:

1. Create 'WAN IPC Server Cam' device type
- in the smartthings IDE, click the "My Device Types" tab
- click the "+ New SmartDevice" button in the upper right corner
- in the "New SmartDevice" screen, enter the following:
- Name: IP Cam Viewer Recall Camera Group
- Namespace: com.rcreations.ipcamviewer.wanserver
- Capabilities: select "Image Capture", "Switch", "Actuator"
- leave all other fields default
- click "Create" button at bottom of screen
- now, select the newly created device type
- copy and paste the code from here http://hit-mob.com/smartthings/ipc_wanserver.txt and press save
- click Publish and select "For Me"
- we won't test it just yet. we need to setup a device (see below)

2. Create device that uses 'WAN IPC Server Cam' device type
- in the smartthings IDE, click the "My Devices" tab
- click the "+ New Device" button in the upper right corner
- in the "Create Device" screen, enter the following:
- Name: WAN IPC Server Cam
- Label: WAN IPC Server Cam
- Type: scroll to the bottom of the list and select "WAN IPC Server Cam"
- Version: Published
- Location: select your home location
- Hub: select your hub
- leave all other fields default
- click "Create" button at bottom of screen
- now, select the newly created device
- find the row that says "Preferences (edit)" and click on the "(edit)" link
- enter the connectivity information for IP Cam Viewer's embedded web server (test parameters with browser first)
- Admin username/password: turning MD on/off requires admin account (see App Settings in app)
- IP/Port: see App Settings inside app
- Camera Name: name of camera inside app
- click Save to save the preferences for the device

3. test the recall camera group device type
- click on "My Device Types" tab
- click the 'WAN IPC Server Cam' device type
- click the "Set Location" button in the upper right corner
- expand the "device" list by clicking the down arrow
- under the "Physical Devices", select the "WAN IPC Server Cam" device
- click the "Install" or "Update" button
- a Tools section will now be visible, which will allow you to test the device
- click the "take" button to capture frame
- launch the smartthings mobile app
- under "Things", you should see the new "WAN IPC Server Cam" thing
- in the tile, click the settings and then click Take Photo to show current frame (just like in IDE).

Image

---
Enjoy,
Rob

ps. Future article will show you know to integrate ANY camera supported by IP Cam Viewer into smartthings. You could then automate smartthings to take a snapshot when some event takes place.
User avatar
admin
Site Admin
 
Posts: 175
Joined: Sun Feb 08, 2009 11:19 am

Re: Smartthings integration to turn motion notifications on/off

Postby cecep74 » Fri Mar 13, 2015 6:22 am

I have been trying to get this working for a while and I am not sure where it goes wrong. I set up the record mode correctly and I can see the IP CAM VIEWER url in the browser. I also set up the info in the WAN IPC Server Cam and test it in the simulator of SmartThings. It gives me the following errors:

with HTTPS selected: java.net.SocketTimeoutException: connect timed out @ line 109
Without HTTPS selected: org.apache.http.conn.ConnectTimeoutException: Connect to 192.168.0.19:54238 timed out @ line 109

Anyone knows what could be possibly wrong.

Thanks Cece
cecep74
 
Posts: 1
Joined: Sun Mar 08, 2015 5:18 am


Return to Support

Who is online

Users browsing this forum: No registered users and 6 guests