Author Topic: FOSCAM presets  (Read 12484 times)

Offline richskiddle

  • Sr. Newbie
  • *
  • Posts: 29
  • Karma: +0/-0
FOSCAM presets
« on: January 17, 2012, 03:06:47 pm »
I have the cameras working and can control them in UI5. So all is happy there.

Now I'm trying to follow the above to move the camera to point towards the back door. I think i've done the LUA code correctly when the scene runs, it seems to pan left or whatever I tell it to do.

Im struggling with pre-sets though - I can't see how to save a preset, there is a link on the camera control but that doesn't seem to do anything and ive tried positing the camera and then going to

http://192.168.0.25/decoder_control.cgi?command=32 [nofollow]

for example, so does that save preset 1? Or is there a different approach?

When I try the scene with the command for a preset, the camera doesn't move anywhere, which makes me think the presets aren't saved.

Offline JOD

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1978
  • Karma: +4/-0
Re: FOSCAM presets
« Reply #1 on: January 17, 2012, 03:52:42 pm »
I'm sorry, my responses are limited. You must ask the right questions.

Offline richskiddle

  • Sr. Newbie
  • *
  • Posts: 29
  • Karma: +0/-0
Re: FOSCAM presets
« Reply #2 on: January 17, 2012, 04:19:20 pm »
hi Jod

Thanks for the reply, it's that thread I originally started on. I can't seem to set the presets on my camera, am i missing something on that thread that will help?

cheers
rich

Offline JOD

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1978
  • Karma: +4/-0
Re: FOSCAM presets
« Reply #3 on: January 17, 2012, 04:30:21 pm »
Quote
am i missing something on that thread that will help?
All the relevant info is in that thread.
 
You can set the presets by saving the camera's position via the camera's software.
or
a few posts down on the above link, @m0jon shows how to save the preset via code.
Quote
decoder_control.cgi?command=32 = Set preset 1
decoder_control.cgi?command=34 = Set preset 2
decoder_control.cgi?command=36 = Set preset 3

JOD.
I'm sorry, my responses are limited. You must ask the right questions.

Offline richskiddle

  • Sr. Newbie
  • *
  • Posts: 29
  • Karma: +0/-0
Re: FOSCAM presets
« Reply #4 on: January 19, 2012, 04:06:09 am »
Hi Jod

Perhaps we can extract my questions from the original post

there is a link on the camera control but that doesn't seem to do anything

and

ive tried positing the camera and then going to

http://192.168.0.25/decoder_control.cgi?command=32 [nofollow]

for example, so does that save preset 1? Or is there a different approach?


So I can see the link on the web interface (using IE) but i've positioned the camera, and clicjked save Preset and it doesn't seem to do anything. Or how would we use the code approach, through LUA?

Offline JOD

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1978
  • Karma: +4/-0
Re: FOSCAM presets
« Reply #5 on: January 19, 2012, 11:19:55 am »
Setting the preset from the camera's web browser:
1. Within the camera software (screen shot attached) position the camera, select the drop down arrow of the presets, click on preset 1 and click set.

To do the same as above (setting preset 1) within Vera the code would look like this:

local IP_address      = 'ip address here'
local username        = 'username here'
local password        = 'password here'
local timeout         = 5

luup.inet.wget( 'http://'..IP_address..'/decoder_control.cgi?command=32' , timeout, username, password )

JOD.
I'm sorry, my responses are limited. You must ask the right questions.

Offline richskiddle

  • Sr. Newbie
  • *
  • Posts: 29
  • Karma: +0/-0
Re: FOSCAM presets
« Reply #6 on: January 20, 2012, 01:22:22 am »
I figured option one was that simple, and indeed mine isn't working!


Offline richskiddle

  • Sr. Newbie
  • *
  • Posts: 29
  • Karma: +0/-0
Re: FOSCAM presets
« Reply #7 on: January 20, 2012, 08:16:36 am »
So the option in the settings to 'disable preset'

Untick that and it works  ;D

Offline erusso

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: FOSCAM presets
« Reply #8 on: January 22, 2012, 01:07:23 pm »
I've been working on getting the presets to work. I have them programmed, but I can't seem to figure out how to make them work based on a scene.

For example:
1) Lock button is pressed
2) Rotate camera to Preset X
3) Take an image
4) After 1  minute, return to preset Y

I am assuming this takes some programming, since I can't seem to find anything for the cameras when I create or edit a scene. I tried following the directions in http://forum.micasaverde.com/index.php/topic,3720.msg50825.html#msg50825 to get a feel for it, but couldn't seem to get it to work.

It looks so easy in the ad for Vera, where a text message pops up with an image when I door is opened :-)

Does anyone have any advice or good references for learning how to make this happen?

Thanks,
-Evan

Offline JOD

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1978
  • Karma: +4/-0
Re: FOSCAM presets
« Reply #9 on: January 22, 2012, 01:55:40 pm »
Quote
1) Lock button is pressed
Add this to the luup tab of that scene.
Code: [Select]
local IP_address      = 'ip address here'
local username        = 'username here'
local password        = 'password here'
local timeout         = 5

luup.inet.wget( 'http://'..IP_address..'/decoder_control.cgi?command=31' , timeout, username, password )
Quote
2) Rotate camera to Preset X
Change the command = number to the preset you want.
Preset #1 = command=31
Preset #2 = command=33
Preset #3 = command=35
Preset #4 = command=37
Preset #5 = command=39
Preset #6 = command=41
Preset #7 = command=43
Preset #8 = command=45
Quote
3) Take an image
I'm not sure that Vera can do this.
Quote
4) After 1  minute, return to preset Y
I have mine change to a different preset when the door is locked, but adding a delay is a good idea! A scene could then be used to patrol a camera through various presets over a set period of time and repeat....

How would one add a delay in Luup? & how could a luup loop be created to repeat it? Anyone?

JOD.

I'm sorry, my responses are limited. You must ask the right questions.

Offline erusso

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: FOSCAM presets
« Reply #10 on: January 22, 2012, 01:57:01 pm »
Thanks JOD! I appreciate the help!

Offline erusso

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: FOSCAM presets
« Reply #11 on: January 22, 2012, 06:03:20 pm »
So, rather than a delay - my temporary solution was to create a scene that runs every hour - just in case I forget to put cameras back where they belong, it will move them to the preset I want to keep them at most of the time. But, when I lock/unlock doors there will be an instant focus on the doors.

Thanks again for the code- worked like a charm!
-Evan

Offline wilme2

  • Hero Member
  • *****
  • Posts: 1020
  • Karma: +18/-13
Re: FOSCAM presets
« Reply #12 on: January 07, 2014, 05:43:58 pm »
Add this to the luup tab of that scene.
Code: [Select]
local IP_address      = 'ip address here'
local username        = 'username here'
local password        = 'password here'
local timeout         = 5

luup.inet.wget( 'http://'..IP_address..'/decoder_control.cgi?command=31' , timeout, username, password )

Change the command = number to the preset you want.
Preset #1 = command=31
Preset #2 = command=33
Preset #3 = command=35
Preset #4 = command=37
Preset #5 = command=39
Preset #6 = command=41
Preset #7 = command=43
Preset #8 = command=45

Perfect - was just looking for how to move to the presets.  Thanks!
Long Live UI5!

Offline Zorro

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: FOSCAM presets
« Reply #13 on: March 28, 2014, 03:18:40 pm »
Any change to add a delay after the initial trigger before the luup code activates and starts moving the camera. Just in case there is more movement before returning.

Offline wilme2

  • Hero Member
  • *****
  • Posts: 1020
  • Karma: +18/-13
Re: FOSCAM presets
« Reply #14 on: June 20, 2017, 11:34:13 pm »
Add this to the luup tab of that scene.
Code: [Select]
local IP_address      = 'ip address here'
local username        = 'username here'
local password        = 'password here'
local timeout         = 5

luup.inet.wget( 'http://'..IP_address..'/decoder_control.cgi?command=31' , timeout, username, password )

Just a note - I updated my FI8910W today to the latest firmware 11.37.2.65.  Now the above code I have been using for the past three years stopped working.  After a LOT of trial and error, I found this does work:
Code: [Select]
luup.inet.wget("http://YourIPAddress/decoder_control.cgi?command=33&user=YourUser&pwd=YourPassword")

Hoping to save someone else the trouble...
Long Live UI5!