Foscam camera with lots of controls

do you get errors when you change a setting?

all 5 seconds? did you set the sensor_update_time to 5?
it was default at 10 and then you could only get an error every 10 seconds :wink:
and you would have 2 different errors.
but thats only for the update in HA.

could you try this in a browser:

http://your_ip:88/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=your_username&pwd=your_pwd
/appdaemon/logs/appdaemon_error.log
2017-05-09 21:43:50.086977 WARNING Logged an error to /home/pi/appdaemon_dashboard/appdaemon/logs/appdaemon_error.log
2017-05-09 21:44:00.089553 WARNING Logged an error to /home/pi/appdaemon_dashboard/appdaemon/logs/appdaemon_error.log
2017-05-09 21:44:10.088618 WARNING Logged an error to /home/pi/appdaemon_dashboard/appdaemon/logs/appdaemon_error.log
2017-05-09 21:44:20.081112 WARNING Logged an error to /home/pi/appdaemon_dashboard/appdaemon/logs/appdaemon_error.log
2017-05-09 21:44:26.007986 INFO /home/pi/appdaemon_dashboard/appdaemon/conf/appdaemon.cfg modified
2017-05-09 21:44:26.040808 INFO App 'foscam' changed - reloading
2017-05-09 21:44:26.043862 INFO Loading Object foscam using class foscam from module foscam
2017-05-09 21:44:31.175809 WARNING foscam: Entity sensor.foscam_motion not found in Home Assistant
2017-05-09 21:44:42.778033 INFO AppDaemon Version 2.0.0beta3.5 starting
2017-05-09 21:44:49.399634 INFO Got initial state
2017-05-09 21:44:49.405508 INFO Loading Module: /home/pi/appdaemon_dashboard/appdaemon/conf/apps/foscam.py
2017-05-09 21:44:49.463730 INFO Loading Object foscam using class foscam from module foscam
2017-05-09 21:44:49.481353 INFO Loading Module: /home/pi/appdaemon_dashboard/appdaemon/conf/apps/hello.py
2017-05-09 21:44:49.487418 INFO Loading Object hello_world using class HelloWorld from module hello
2017-05-09 21:44:49.974326 INFO hello_world: Hello from AppDaemon
2017-05-09 21:44:49.983961 INFO hello_world: You are now ready to run Apps!
2017-05-09 21:44:49.986762 INFO App initialization complete
2017-05-09 21:44:49.992881 INFO Starting dashboard
2017-05-09 21:44:50.059111 INFO HADashboard Started
2017-05-09 21:44:50.060822 INFO Listening on ('192.168.1.22', 5050)
2017-05-09 21:44:51.326139 INFO Connected to Home Assistant 0.44.1
2017-05-09 21:44:54.779211 WARNING foscam: Entity sensor.foscam_sound_alarm not found in Home Assistant
2017-05-09 21:44:54.920873 WARNING foscam: Entity sensor.foscam_recording not found in Home Assistant
2017-05-09 21:44:58.534739 INFO foscam: devstate gaf foute data
2017-05-09 21:45:05.815313 INFO foscam: devstate gaf foute data

o waua, didnt know you used it in the password.
yeah that could be a problem.
i thought you meant in the returned data. :wink:

2017-05-09 21:47:50.012527 INFO foscam: devstate gaf foute data
2017-05-09 21:47:59.033088 WARNING Scheduler clock skew detected - delta = 24.03290104866028 - resetting
2017-05-09 21:47:59.171633 WARNING Scheduler clock skew detected - delta = 1.828861951828003 - resetting
2017-05-09 21:47:59.216178 WARNING Scheduler clock skew detected - delta = 1.7840240001678467 - resetting
2017-05-09 21:47:59.285039 WARNING Scheduler clock skew detected - delta = 1.715135097503662 - resetting
2017-05-09 21:47:59.299461 WARNING Scheduler clock skew detected - delta = 1.7007100582122803 - resetting
2017-05-09 21:47:59.312317 WARNING Scheduler clock skew detected - delta = 1.6878869533538818 - resetting
2017-05-09 21:47:59.326927 WARNING Scheduler clock skew detected - delta = 1.673341989517212 - resetting
2017-05-09 21:47:59.341901 WARNING Scheduler clock skew detected - delta = 1.6584429740905762 - resetting
2017-05-09 21:47:59.355810 WARNING Scheduler clock skew detected - delta = 1.644378900527954 - resetting
2017-05-09 21:47:59.369389 WARNING Scheduler clock skew detected - delta = 1.6308600902557373 - resetting
2017-05-09 21:47:59.383440 WARNING Scheduler clock skew detected - delta = 1.6167690753936768 - resetting
2017-05-09 21:47:59.399394 WARNING Scheduler clock skew detected - delta = 1.6008410453796387 - resetting
2017-05-09 21:47:59.420085 WARNING Scheduler clock skew detected - delta = 1.5800879001617432 - resetting

cruising works ā€¦ jihaaaaaa
i try other functions now

sensor motion, etc are made also.
so it seems like you got it working now.

i havent explained that by the way but
the move vertical, move horizontal and move zoom, are made like this:

setting it to -1 or 1 starts it and it goes on for 1 second speed slow
-2 or 2 same but at higher speed,
etc.
but i only use -1 or 1, because the cam gets a bit buggy reactions if its set to higher speed.

yeah everything works perfectly now ā€¦ 1000 thanks maan! greatā€¦ i can now build automations on it i guess? would u mind sharing an example?

1 Like

i created an app that take a picture every minute. to give me a fast moving day video.

its about the easiest thing to do.

import appdaemon.appapi as appapi
import datetime

class speedup(appapi.AppDaemon):

  def initialize(self):
    runtime = datetime.time(12, 0, 0)
    self.run_minutely(self.savepic,runtime)        

  def savepic(self, kwargs):
    self.turn_on("input_boolean.foscam_snap_picture_now")

you could start the cruise at a specific point of the day, or enable and disable the infrared at other times then the cam default.
for instance when you have outside lights in the evening and dont want the infrared at that moment.
you could set the brightness a little lower if you have a sensor detecting outside light is very Sunny.

so yeah you could automate a lot.

is that a python script? and where is it saved? where do i put this? ā€¦ soorryy for noob questions :stuck_out_tongue:

thts a app called ā€œspeedupā€ ? in aps folder?

Works like a charm now! Thanks a lot!

1 Like

yeah thats an app.

if you would like to use that you need to save it in your apps dir with the name speedup.py
and then in your appdaemon.cfg you add:

[speedup]
module = speedup
class = speedup

I guess it is supposed to save the single pics in pre configured folder but do u also create like a movie with it? Would be awesome then to also send this to email or even xmpp

yeah you need to set the folders in the cam.
the cam makes a movie and saves it when motion detect, but only through the settings.
in the cam settings you can say that he must send pics to an email address.
you can make preset cruise routes and presets for the direction the cam is watching.
those presets needs to be given a name and then you can use the same names in your HA input_selects to use those settings from HA.

@ReneTode - Iā€™ve got this mostly working, but some of the controls donā€™t seem to work. For example, I canā€™t seem to enable/disable motion detection. I donā€™t see a listener registered for that switch. Is that something that is a work in progress or am I missing something?

Thanks for this great work!

1 Like

you are not missing something, i missed something.

the motion switch is updated from the cam, so it gives the correct situation, but i forgot to implement to possibility to set it.
the app is getting a complete workaround, giving it decent warnings and info, and also making it partly work for older models.

i will put it in there.

i thing i noticed since i did write the app, is that when the cam is somewhat busy it doesnt give the asked data back but Always the same return.
at this moment my app gives me a decent warning : ā€œCamera is to busy, sensor value not retrievedā€
i will also implement checkups and warnings like that for all other commands
as it is right now if you send a command, the app doesnt check with the cam if the command has actually succeeded.

so if you have a little patience i will release a new version shortly.

Awesome, thanks. Let me know if you are working on this today, otherwise I will likely implement the motion detect setting myself and give you a pull request in git.

1 Like

Dang, this looks awesome! I thought Iā€™d gone pretty advanced by putting some buttons that move my camera to 3 predefined locations:

Investigating this now.

1 Like

ā€œPoint camera at bedā€?? TMI @Greg, TMI. :wink:

2 Likes

i am working on some other things now, that took priority.
so if you implement it an give a pull request i will take that, for now. (so that others in the meantime have that option also.

i noticed another thing also, that i already took care of in the new version.

the speed isnt set higher or lower when zooming or moving left or right, like it is supposed to do.