Webcams
NOTE: Update available! (0.3) This makes it a LOT easier!
This script allows you to capture Webcam images. You have multiple options to define the directory, filename, auto-numbering, etc.
After grabbing an image it updates the HomeSeer device so it shows a small version of the image. When you click this device-image a new window will open with the full image.
An important command for this script is hs.GetURLImageEx
Script parameters: (with example)
(“Main”,”W1|https://user:pwd@10.1.1.1/snapshot.cgi|FrontDoorbell|html\Camera\FrontDoorbell|yes“)
- HomeSeer device code – “W4“
- Webcam URL for image – “https://<username>:<password>@10.1.1.1/snapshot.cgi“
- Filename – “FrontDoorbell” (.jpg added automatically)
- Directory – “html\Camera\FrontDoorbell” (\Homeseer 2\html\ added automatically)
- Date/Time? – “yes”
Do you want to overwrite an existing image or add the date+time to the filename
example: “Frontdoor_2011-12-27_13-46-05.jpg”
Download
UPDATE: version 0.3e (5 May 2012) – test script with some updates (see script for changes)
One change: You have to add the file extension (.jpg .png) to the filename you want to save!
NEW: version 0.3 (27 December 2011) – Moved from 2 scripts to 1 script that runs on the HS server.
OLD: version 0.2 (24 March 2009) – beta
Installation
Instructions included in the ZIP file (readme.txt). Carefully read the readme.txt and the examples. It’s not the most user-friendly but it is very reliable.
Challenge
One challenge that I ran into: all of my existing webcam captures are numbered. “doorbell00923.jpg”.
The problem: if you FTP these files to a server and FTP them back the file date is gone. So I realized that I want the date + time to be in the file-name. In other words: if something happens date and time information for these files are gone. How are you going to put the file-created date into the filename for 1000s of images?
Fix: Use an application called stamp.
Before: doorbell00923.jpg (file-created date 27 December 2011, 14:33)
After: doorbell_2011-12-27_14-33-05.jpg
Bonus: Renaming will preserve the date-created/date-modified of the file.
Below you will find screenshots of the settings I used in Stamp to accomplish this. It took quite some testing to get it right.
“Main” tab
“Main” tab custom format
“Filter” tab
“Options” tab
Note: for unknown reasons the time in some renamed files is 1 hour earlier?
My Setup
In my setup I use the following folders
- \Homeseer 2\html\Camera
Contains webcam images that are updated every 10 minutes.
These images are overwritten!
Frontdoor.jpg
Garden.jpg
Attic.jpg
Office.jpg - \Homeseer 2\html\Camera\XXXXX\
Contains subfolders for specific camera actions
These images are saved (each with a different filename containing the date & time)
\Homeseer 2\html\Camera\FrontdoorOpen\ FrontdoorOpen_<date-time>.jpg
\Homeseer 2\html\Camera\FrontdoorDoorbell\ FrontdoorDoorbell_<date-time>.jpg
\Homeseer 2\html\Camera\FrontdoorMotion\ FrontdoorMotion_<date-time>.jpg
\Homeseer 2\html\Camera\BackdoorOpen\ BackdoorOpen_<date-time>.jpg
\Homeseer 2\html\Camera\GardendoorOpen\ GardendoorOpen_<date-time>.jpg
\Homeseer 2\html\Camera\GardenShedOpen\ GardenShedOpen_<date-time>.jpg
In my setup I use the following folders
Scripts
– Doors opening – capture image
– Motion – capture image
Roadmap
- Script that displays multiple captured images based on time, weeknr, monthnr, camera name, capture type.
- I already have a beta version of this script that runs on your iPhone. It hasn’t reached the maturity level to which I feel comfortable posting it yet.
Here’s how it can look in Homeseer.
Camera URLs
Linksys WVC-210
More information
- Post announcing the version 0.3 script
- My Gardencam project
- Axis camera server developer info
- Axis camera HTTP API ( PDF )
- Linksys webcam URLs and Settings PDF
- Linksys Cisco WVC210 HTTP API
- Linksys Cisco 2300 Series HTTP API
- NEW Fantastic overview of nearly ALL camera URL‘s
I would like your assistance in adding a panning parameter to the script. I think I have most of the work done except the actual send…
‘— Move the camera first if a control parameter is included
if strControl = ” ← ” then strCommand = 4
if strControl = ” → ” then strCommand = 6
if strControl = ” ↑ ” then strCommand = 0
if strControl = ” ↓ ” then strCommand = 2
strURLcontrol = Replace(hs.stringitem(strURL,3,”snapshot”),”:”,”decoder_control”)
strURLcontrol = strURLcontrol & “command=” & strCommand & “&onestep=1”
If strControl “no” then *****strURLcontrol*******
Question: What would you like the Webcam image grabbing script to do with this addition?
If it’s only PTZ control you might have an easier option:
To control your webcam you could actually use a 1 line script in an event.
The script in the event would look like this:
hs.GetURL(“http://user:pwd@10.1.1.1″,”/axis-cgi/com/ptz.cgi?gotoserverpresetname=Garden”,FALSE,80)
Looks like you already know which URL you need to control the camera.
4 Events would give you up/down/left/right control. You could even add custom buttons to a device that give you this control.
Thank you for the reply. You are correct, I was going about it all wrong and in fact ended up doing a Homeseer webpage for complete control of the netcam.
https://forums.homeseer.com/forum/homeseer-products-services/general-discussion-area/67881-homeseer-webpage-for-foscam-and-clones-netcam-control?t=153390
Your script is perfect as-is for grabbing the thumbnail images.
Ben zo vrij om even een threat te openen op domoticaforum (dan kan ik plaatjes meesturen)
https://www.domoticaforum.eu/viewtopic.php?f=47&t=7433&p=55616#p55616
Thanks. Verkenner
Hi DJ, the Webcamscript is the best HomeSeer-script ever! Very usefull!
Do you have plans to convert it to HomeSeer3? Thanks, Verkenner
Thank you! No plans to convert it to HS3.. Besides the fact that I’m **NOT** impressed by HS3 I’ve tried multiple times to convert scripts to VB.NET. This basically takes to much time so I can’t migrate… for now.