IP Cam Viewer     My Amazon IP Cameras    

Remote Control of IP Cam Viewer and ChromeCast/FireTV

Support for my free Android Applications.

Remote Control of IP Cam Viewer and ChromeCast/FireTV

Postby admin » Thu Apr 10, 2014 8:25 am

In the coming releases, IP Cam Viewer will get an embedded HTTP server! This server will be used for remote control of record mode, tasker integration, chromecast, and more.

See: http://hit-mob.com/2014/04/10/remote-co ... astfiretv/
User avatar
admin
Site Admin
 
Posts: 172
Joined: Sun Feb 08, 2009 11:19 am

Re: Remote Control of IP Cam Viewer and ChromeCast/FireTV

Postby admin » Wed Apr 23, 2014 9:49 pm

v5.3.7 now has an embedded web server. Goto App Settings to change port and access information.
v5.3.7 has Amazon Fire TV support.
v5.4.3 has Chromecast support.

The web server only runs while the app is running in either Gallery View, Matrix View, Background Audio Mode, Record Mode, Manage Cameras and App Settings.
Just point a browser at the port shown in App Settings.

This server can be used for remote control of record mode, tasker integration, chromecast, cam hosting (proxy to get camera feed for all supported cameras) and more. Lots of APIs are already available (see below) and more will be added. Also, a web UI will be built for humans to use.

For example, 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.
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).

Using this web server api, I can turn MD on/off and switch groups when away from home (also see this post for automating this Smartthings hub).

---
API URLs for integration with automation tools like tasker (or just do it in the browser):

Most APIs require the web server's viewer and admin username/password (see App Settings).
Pass in the username/password using HTTP basic authentication or pass it in the URL with params "user" and "pass".

Record Mode settings API(s) requiring admin access:

- Enable/Disable Motion Detection Notifications (available in v5.3.7)
- Get current setting: "/v1/cgi/getset.cgi?action=get&key=record_settings.enable_md_notif"
- Set curent setting: "/v1/cgi/getset.cgi?action=set&key=record_settings.enable_md_notif&value=[1:0]"


Record Playback API(s) requiring viewer access:

- List recent motion events using HTML (available in v5.5.3): "/v1/cgi/getset.cgi?action=get&key=record_playback.list_recent_motion&outputType=html"
- List recent motion events using JSON (available in v5.5.3): "/v1/cgi/getset.cgi?action=get&key=record_playback.list_recent_motion"
- Get recorded frame by id (available in v5.5.3): "/v1/stream/playback_frame.jpg?frameId=[frameId]"
- Get prev/next frame by passing in original motion frame id (keep calling to rewind/forward, available in v5.7.3): "/v1/cgi/getset.cgi?action=get&key=record_playback.get_motion_frame&motionFrameId=[original_motion_id]&direction=[-1,1]"


Groups API(s) requiring admin access:

- recall group by name (available in v5.3.8): "/v1/cgi/getset.cgi?action=set&key=camera_db.recall_group&value=[name]"
- list group names (available in v5.3.9): "/v1/cgi/getset.cgi?action=get&key=camera_db.list_groups"


Camera DB API(s) requiring viewer/admin access:

- list enabled cameras (requires viewer user, available in v5.3.9): "/v1/cgi/getset.cgi?action=get&key=camera_db.list_enabled_cameras"
- list all cameras (requires admin user, available in v5.3.9): "/v1/cgi/getset.cgi?action=get&key=camera_db.list_all_cameras"
- get camera info (requires viewer user for some info about enabled cameras, admin user for all cameras/info, available in v5.3.9): "/v1/cgi/getset.cgi?action=get&key=camera_db.camera_info&value=[name]"


Camera DB API(s) requiring admin access:

- import camera xml, pass export XML using base64 encoding or pass URL of export file using base64 encoding (available in v5.4.0): "/v1/cgi/getset.cgi?action=set&key=camera_db.import_camera_xml&value=aXBjYW14bWw6Ly9oaXQtbW9iLmNvbS9kb3dubG9hZHMvd2ViY2Ftcy9za2kvY2FtZXJhcyUyMGhlYXZlbmx5LnhtbA=="
    - for example, start with "ipcamxml://hit-mob.com/downloads/webcams/ski/cameras%20heavenly.xml"
    - use online base64 encode tool to encode above url to: "aXBjYW14bWw6Ly9oaXQtbW9iLmNvbS9kb3dubG9hZHMvd2ViY2Ftcy9za2kvY2FtZXJhcyUyMGhlYXZlbmx5LnhtbA=="
    - by default, import will not overwrite existing cameras. add "overwrite=1" parameter to update existing cameras (available in v5.4.1)

- add camera from email link (available in v5.4.0): "/v1/cgi/getset.cgi?action=set&key=camera_db.add_camera&value=params&0=I-65+%40+234&1=Traffic+Cams+US%2CKY&3=KY%2C+Bowling+Green&5=I-65+%40+234&9=4194304"
    - for example, in Manage Cameras, click on camera and select Email Camera (send to yourself)
    - copy the parameters 0 through 9 and paste parameters into "add_camera_params" api call.
    - as of v5.4.1, "add" will fail if existing camera with same name already exists. Add "overwrite=1" parameter to force update if camera name already exists.

- delete camera (available in v5.4.1): "/v1/cgi/getset.cgi?action=set&key=camera_db.delete_camera&value=[name]"
- enable_disable_camera (available in v5.4.1): "/v1/cgi/getset.cgi?action=set&key=camera_db.enable_disable_camera&value=[name]&enable=[1:0]"
- rename camera (available in v5.4.1): "/v1/cgi/getset.cgi?action=set&key=camera_db.rename_camera&value=[old name]&new_name=[new_name]"


Viewer API(s) (more to come in future) requiring viewer/admin access:

- Last Frame JPG by Camera Name (requires viewer user, available in v5.4.1): "/v1/stream/last_frame.jpg?name=[name]"
    - fetch frames to display on a web page or upload to a server.
    - relies on frame buffer from current Gallery/Matrix/Record Mode activity.
- Last Frame MJPG by Camera Name (requires viewer user, available in v5.4.2): "/v1/stream/last_frame.mjpg?name=[name]"
    - continuous stream of frames.
    - relies on frame buffer from current Gallery/Matrix/Record Mode activity.
- Matrix view of enabled cameras (requires viewer user, available in v5.9.7): "/v1/cgi/getset.cgi?action=get&key=matrix_view.matrix_view"
    - relies on frame buffer from current Matrix/Record Mode activity.
- Single camera of Matrix view (requires viewer user, available in v5.9.8): "/v1/cgi/getset.cgi?action=get&key=matrix_view.detail_view?camId=[n]"
    - relies on frame buffer from current Matrix/Record Mode activity.
- with the above apis, you can now use IP Cam Viewer as a transcoder / proxy for cameras/nvrs/dvrs that have odd custom protocols. Run IPC in Gallery/Matrix/Record Mode and use this api to fetch frames to display on a web page or upload to a server.
- another IP Cam Viewer instance can view the server using the "IP Cam Viewer Server" camera type.


App Info API(s):

- Get application version code (integer, available in v5.4.2): "/v1/cgi/getset.cgi?action=get&key=app_info.version_code"
- Get application version name (string, available in v5.4.2): "/v1/cgi/getset.cgi?action=get&key=app_info.version_name"
- Get application name (string, available in v5.4.5): "/v1/cgi/getset.cgi?action=get&key=app_info.app_name"


App State API(s) requiring admin access:

- Get current visible screen (string, available in v5.4.5): "/v1/cgi/getset.cgi?action=get&key=app_state.current_screen"
- Goto screen (string, available in v5.4.5): "/v1/cgi/getset.cgi?action=set&key=app_state.goto_screen&extra=camera_name"
    - values are MATRIX_VIEW and GALLERY_VIEW. Only transitions valid inside app are accepted. For GALLERY_VIEW, optional "extra" parameter specifies camera name.


Matrix View API(s) requiring admin access:

- Mass action (string, available in v5.4.5): "/v1/cgi/getset.cgi?action=set&key=matrix_view.mass_action&value=action"
    - values are LIGHT_ON, LIGHT_OFF, MOTION_ON, MOTION_OFF, RELAY_ON, RELAY_OFF, PRESET_1, PRESET_2, PRESET_3, PRESET_4, PRESET_5.


Gallery View API(s) requiring admin access:

- Select camera by name (string, available in v5.4.5): "/v1/cgi/getset.cgi?action=set&key=gallery_view.select_camera&value=name"


Record View API(s) requiring admin access:

- View Record Log (available in v5.7.9): "/v1/cgi/getset.cgi?action=get&key=record_view.record_log"


Camera Control API(s) (available when app is visible in gallery/matrix/record views) requiring admin access:

- Turn camera relay on/off (available in v5.5.8): "/v1/cgi/getset.cgi?action=set&key=camera_control.relay&name=[camera_name]&value=[1:0]"
- Goto camera preset (available in v5.5.9): "/v1/cgi/getset.cgi?action=set&key=camera_control.recall_preset&name=[camera_name]&value=[1..n]"


Note: Whenever you see brackets and colons like "[1:0]", that means you have to choose a value. For example, "value=[1:0]" means your choices are "value=1" or "value=0".
Note: If you see text between brackets like "[name]", that means replace that with a name of your choice.

More automation options: the older Android Intents to automate launching of app still work:
- http://hit-mob.com/2011/07/26/ios-launch-urls/
- viewtopic.php?f=8&t=697&p=2190&hilit=launch#p2190

Also, see this post on how to import cameras by clicking on links/files from a server:
viewtopic.php?f=7&t=1067&p=3181#p3181
User avatar
admin
Site Admin
 
Posts: 172
Joined: Sun Feb 08, 2009 11:19 am

Re: Remote Control of IP Cam Viewer and ChromeCast/FireTV

Postby dirkmaat » Mon Jul 28, 2014 1:10 pm

.
Last edited by dirkmaat on Tue Sep 09, 2014 9:10 pm, edited 1 time in total.
dirkmaat
 
Posts: 2
Joined: Mon Jul 28, 2014 4:14 am

Re: Remote Control of IP Cam Viewer and ChromeCast/FireTV

Postby dirkmaat » Wed Jul 30, 2014 4:10 am

Hi,

I would like to use some of the API URLs to control IP Cam Viewer from Tasker.

With the 'old' commands and an 'Send Intend' task in Tasker it's no problem, but i have no idee what Tasker control command i have to use for this new commands.
I have tried some, but with no luck.

I hope someone can point me in the right direction.
Thanks in advance.
dirkmaat
 
Posts: 2
Joined: Mon Jul 28, 2014 4:14 am

Re: Remote Control of IP Cam Viewer and ChromeCast/FireTV

Postby trevor » Wed Sep 03, 2014 9:37 pm

Like the idea of remote control from a browser. Is there any chance you can add a turn On/Off Record Mode command as well please?

I see you have a setting for motion detection notifications but it would also be handy to be able to turn recording on/off remotely in admin mode in some circumstances to avoid filling storage media unnecessarily.
trevor
 
Posts: 10
Joined: Sun Oct 13, 2013 3:35 am

Re: Remote Control of IP Cam Viewer and ChromeCast/FireTV

Postby admin » Tue Sep 09, 2014 5:21 pm

I actually do that with 2 groups. 1 group is when I'm home (different cameras and recording settings) and another group for when I'm away (note that each camera's Edit Camera->More Options screen lets you turn md on/off per camera, rather than the global md on/off in record settings).

there's an api to switch groups. I use these apis so that smartthings turns notifications on/off and switches groups when I leave and return...

see http://hit-mob.com/2014/08/22/more-inte ... hings-hub/

trevor wrote:Like the idea of remote control from a browser. Is there any chance you can add a turn On/Off Record Mode command as well please?

I see you have a setting for motion detection notifications but it would also be handy to be able to turn recording on/off remotely in admin mode in some circumstances to avoid filling storage media unnecessarily.
User avatar
admin
Site Admin
 
Posts: 172
Joined: Sun Feb 08, 2009 11:19 am

Re: Remote Control of IP Cam Viewer and ChromeCast/FireTV

Postby admin » Tue Sep 09, 2014 5:22 pm

Someone actually wrote a Tasker Plugin using my v1 apis and published it on the play store... you can try that is you don't want to mess with the web calls directly...

dirkmaat wrote:Hi,

I would like to use some of the API URLs to control IP Cam Viewer from Tasker.

With the 'old' commands and an 'Send Intend' task in Tasker it's no problem, but i have no idee what Tasker control command i have to use for this new commands.
I have tried some, but with no luck.

I hope someone can point me in the right direction.
Thanks in advance.
User avatar
admin
Site Admin
 
Posts: 172
Joined: Sun Feb 08, 2009 11:19 am

Re: Remote Control of IP Cam Viewer and ChromeCast/FireTV

Postby trevor » Wed Sep 10, 2014 10:01 pm

Thanks for the suggestions. I thought when you turned 'Record Mode' on that it would be for all cameras ticked in the selection window ?
Anyway, I was rather hoping you might build in a Record Mode on/off switch facility into your PC browser app when you get around to writing it (hopefully soon).

The scenario I was thinking about was when you are away from home but know a relative will be making an adhoc check of the house at a specific time you can connect remotely and turn off record mode for the duration of their visit to save false alarms and media storage.
trevor
 
Posts: 10
Joined: Sun Oct 13, 2013 3:35 am

Re: Remote Control of IP Cam Viewer and ChromeCast/FireTV

Postby N4Spd » Thu Sep 18, 2014 12:26 am

yes, you can do that via a browser away from home.

http://hit-mob.com/2014/08/22/more-inte ... hings-hub/


trevor wrote:Thanks for the suggestions. I thought when you turned 'Record Mode' on that it would be for all cameras ticked in the selection window ?
Anyway, I was rather hoping you might build in a Record Mode on/off switch facility into your PC browser app when you get around to writing it (hopefully soon).

The scenario I was thinking about was when you are away from home but know a relative will be making an adhoc check of the house at a specific time you can connect remotely and turn off record mode for the duration of their visit to save false alarms and media storage.
N4Spd
 
Posts: 1369
Joined: Sun Feb 08, 2009 3:25 pm

Re: Remote Control of IP Cam Viewer and ChromeCast/FireTV

Postby admanb » Wed Nov 05, 2014 6:56 pm

I'm getting a message when trying to use Chromecast that there are no Chromecast devices, but you can see in the attached image that I'm actively connected to one. Any ideas?
admanb
 
Posts: 1
Joined: Wed Jun 23, 2010 6:23 am

Next

Return to Support

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Google Adsense [Bot] and 7 guests