pi@hassbian:~ $ sudo pip3 install appdaemon
Which ended with this warning:
Found existing installation: idna 2.2
Not uninstalling idna at /usr/lib/python3/dist-packages, outside environment /usr
Successfully installed appdaemon-3.0.1 idna-2.7
I did not think this should be an issue, so i continued.
Created the appdaemon.yaml file in /home/homeassistant/.homeassistant/conf dir with the following content:
Further, i log-in as user homeassistant when starting AppDaemon; this give the following error:
$ appdaemon -c /home/homeassistant/.homeassistant/conf
2018-07-23 15:30:28.497116 INFO AppDaemon Version 3.0.1 starting
2018-07-23 15:30:28.497805 INFO Configuration read from: /home/homeassistant/.homeassistant/conf/appdaemon.yaml
2018-07-23 15:30:28.503396 INFO AppDaemon: Starting Apps
2018-07-23 15:30:28.505224 WARNING config_dir: /home exists, but is not writeable, owner: root
2018-07-23 15:30:28.513373 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2018-07-23 15:30:28.559107 INFO AppDaemon: HASS: HASS Plugin Initializing
2018-07-23 15:30:28.560254 INFO AppDaemon: HASS: HASS Plugin initialization complete
2018-07-23 15:30:28.561201 INFO Dashboards are disabled
2018-07-23 15:30:28.561584 INFO API is disabled
2018-07-23 15:30:28.563608 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-07-23 15:30:33.568383 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-07-23 15:30:38.573231 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-07-23 15:30:43.578092 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
^C2018-07-23 15:30:48.256488 INFO Keyboard interrupt
2018-07-23 15:30:48.582645 INFO AppDaemon: HASS: Disconnecting from Home Assistant
2018-07-23 15:30:48.599316 ERROR AppDaemon: Required attribute not set or obtainable from any plugin: latitude
2018-07-23 15:30:48.600190 ERROR AppDaemon: AppDaemon is terminating
2018-07-23 15:30:48.601028 ERROR AppDaemon: Required attribute not set or obtainable from any plugin: longitude
2018-07-23 15:30:48.601690 ERROR AppDaemon: AppDaemon is terminating
2018-07-23 15:30:48.602406 ERROR AppDaemon: Required attribute not set or obtainable from any plugin: elevation
2018-07-23 15:30:48.603033 ERROR AppDaemon: AppDaemon is terminating
2018-07-23 15:30:48.603705 ERROR AppDaemon: Required attribute not set or obtainable from any plugin: time_zone
2018-07-23 15:30:48.604318 ERROR AppDaemon: AppDaemon is terminating
2018-07-23 15:30:48.606078 INFO AppDeamon Exited
Please, does anyone knows what i am doing wrong?
EDIT. I did try this also with the use of the secrets file for the http_password, without success.
Hi @gpbenton, thank you for looking into my issue. I followed your advice at Appdaemon ownership and permissions and the install went flawlessly.
My problem is that i am not so familiar with the use of a virtual environment.
So i am not sure about the section where you describe the start of appdaemon at boot time. I am familiar with the systemd scripts but i am not sure i understand your description about systemd and enabling the VE.
Do i understand it correctly that there are two ways of starting appdaemon, via systemd or via enabling the VE…?
I did not (yet) add the systemd config but started and stopped the VE as described:
homeassistant@hassbian:~/appdaemon_venv $ source bin/activate
(appdaemon_venv) homeassistant@hassbian:~/appdaemon_venv $ ls
bin include lib pyvenv.cfg share
(appdaemon_venv) homeassistant@hassbian:~/appdaemon_venv $ appdaemon -v
appdaemon 3.0.1
(appdaemon_venv) homeassistant@hassbian:~/appdaemon_venv $ which appdaemon
/home/homeassistant/appdaemon_venv/bin/appdaemon
(appdaemon_venv) homeassistant@hassbian:~/appdaemon_venv $ deactivate
homeassistant@hassbian:~/appdaemon_venv $ source appdaemon_venv/bin/activate
-su: appdaemon_venv/bin/activate: No such file or directory
But then i do not know how to start it again, because i left the (appdaemon_venv) homeassistant@hassbian: environment…
I used
homeassistant@hassbian:~/appdaemon_venv $ source appdaemon_venv/bin/activate
to get in the venv again and the commands cd appdaemon_venv
and bin/appdaemon -v gives the version again.
So that is looking OK.And i think i still need systemd to get it started after boottime?
Sorry if this looks like a silly question, but the use of this venv is new to me.
Hope you can help me further.
Yes and no. You can start it manually, but normally you would rely on starting it via systemd. The systemd scripts in the last post on that thread look correct - just check the location where you saved the venv directory.
The trick about the systemd files is that there is some python magic when you start a python program from with a directory that contains a venv, that venv is automatically invoked, so there is no need for a source command.
pi@hassbian:~ $ hassbian-config show appdaemon
AppDaemon install script for Hassbian.
Installs AppDaemon in a separate Venv onto this system.
Copyright(c) 2017 Fredrik Lindqvist <https://github.com/Landrash>.
For the sake of completeness there are a lot of packages it can install:
pi@hassbian:~ $ hassbian-config show
This is a list over all suites in hassbian-config
If a suite has green color in the name, you have already installed it.
Install scripts: (Usage ‘sudo hassbian-config install suite’)
appdaemon AppDaemon install script for Hassbian.
duckdns Setup for Duck DNS auto renewal, and generates SSL certificate.
homeassistant-dev Home Assistant development branch install script for Hassbian.
homeassistant Home Assistant install script for Hassbian.
homebridge Installs and configure Homebridge for Home Assistant.
hue Echo/Home/Mycroft Emulated Hue install script for Hassbian.
libcec libcec install script for Hassbian.
mariadb MariaDB install script for Hassbian.
mosquitto Mosquitto Installer for Hassbian.
mssql MS SQL install script for Hassbian.
mysql MySQL install script for Hassbian.
postgresql PostgreSQL install script for Hassbian.
razberry Disables Bluetooth for the use of a RaZberry with Hassbian.
samba Samba install script for Hassbian.
tradfri Tradfri install script for Hassbian
webterminal Installs an webservice terminal.
Upgrade scripts: (Usage ‘sudo hassbian-config upgrade suite’)
appdaemon AppDaemon install script for Hassbian.
hassbian-script-dev Updates scripts from the dev branch.
hassbian-script Hassbian-Script upgrade script for Hassbian
hassbian Upgrade the base OS installation on this system.
homeassistant Home Assistant install script for Hassbian.
python Upgrades python3 and virtual environment to the newest stable version.
To view more info about a suite type: 'hassbian-config show suite