Foscam camera with lots of controls

I cant seem to find the log file in the appdaemon dir

in your appdaemon.cfg should be this:

logfile = STDOUT
errorfile = /mnt/usbdrive/pi/HAlogs/appdasherror.log

app_dir = /home/pi/.homeassistant/apps/
dash_dir = /home/pi/appdaemon2/appdaemon/conf/dashboards

i got the log set to the screen, you should have it set to a file.
the foscam.py should be in the appdir
and i need to see the ouput from logfile and errorfile

logfile = STDOUT
errorfile = STDERR
threads = 10
dash_dir = /home/debian/appdaemon_dashboard/appdaemon/conf/dashboards

dash_url = http://192.168.1.21:5050

I have no app_dir

set both logfile and errorfile to a file.

you could use:

/home/debian/appdaemon_dashboard/appdaemon/conf/app.log
/home/debian/appdaemon_dashboard/appdaemon/conf/apperror.log

for instance.

you need to create the line app_dir = … then
or else appdaemon will never find any apps :wink:

so create the dir

/home/debian/appdaemon_dashboard/appdaemon/conf/apps

set the line to

app_dir = /home/debian/appdaemon_dashboard/appdaemon/conf/apps

and save the foscam.py in that dir

dont forget that you need to restart appdaemon after all this

2017-04-28 20:58:53.463447 WARNING ------------------------------------------------------------
2017-04-28 20:58:53.464445 WARNING Unexpected error during loading of foscam.py:
2017-04-28 20:58:53.465191 WARNING ------------------------------------------------------------
2017-04-28 20:58:53.471132 WARNING Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py", line 884, in read_app
    conf.modules[module_name] = importlib.import_module(module_name)
  File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/debian/appdaemon_dashboard/appdaemon/conf/apps/foscam.py", line 49, in <module>
    import untangle
ImportError: No module named 'untangle'

2017-04-28 20:58:53.471885 WARNING ------------------------------------------------------------

you need to install untangle (says so at the info from the app :wink: )

pip install untangle

Ah yes. I had installed it but I’m running HA and appdaemon in Virtualenv

so you had it installed at the wrong place?

does it work now?

No still the same error

Its getting late here. i need sleep. I will see whats wrong in the morning Thanks for now

you did install untangle while you were in the virtualenv?
because thats what you need.

oke i need to sleep also :wink:
good night.

Well it looks like I have untangle installed. But appdaemon is still not finding it.

(homeassistant) homeassistant@pine64:/home/debian$ pip install untangle
Requirement already satisfied: untangle in /srv/homeassistant/lib/python3.4/site-packages
(homeassistant) homeassistant@pine64:/home/debian$

do you have appdaemon in the same virtual enviroment?
untangled should be in the same environment as appdaemon

I think so. How can I check?

Sorry I’m still learning

i have no clue.
i dont work with virtual environments :wink:
i guess you should try to find out where you installed appdaemon.

i checked a few posts back and i see that your dir for appdaemon is:

/home/debian/appdaemon_dashboard

i got a feeling that is not inside your environment.
so you need to get out the environment and install untangle.

‘pip3 install untangle’ will work wonders … (pip3 iso just pip)

Would I need to be in virtualenv to run the pip3?

So I’m really confused on why appdaemon can not find untangle. Did a bit of searching and tried installing again. Look at this:

debian@pine64:~$ python --version
Python 2.7.9
debian@pine64:~$ sudo su -s /bin/bash homeassistant

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for debian:
homeassistant@pine64:/home/debian$ source /srv/homeassistant/bin/activate
(homeassistant) homeassistant@pine64:/home/debian$ python --version
Python 3.4.2
(homeassistant) homeassistant@pine64:/home/debian$ pip3 install untangle
Requirement already satisfied: untangle in /srv/homeassistant/lib/python3.4/site-packages
(homeassistant) homeassistant@pine64:/home/debian$

like i said, i get the feeling you didnt install appdaemon inside your virtual environment.
so try installing untangle outside the virtualenv.