Hassbian - get to work SOLVED

Please could anyone help with running hadashboard on hassbian? Appdaemon is installe via hass_config install appdaemon whihc uses this script (there you can see all paths created).

#!/bin/bash
function appdaemon-show-short-info {
echo “AppDaemon install script for Hassbian”
}

function appdaemon-show-long-info {
echo “Installs AppDaemon in a separate Venv onto this system.”
}

function appdaemon-show-copyright-info {
echo “Copyright(c) 2017 Fredrik Lindqvist https://github.com/Landrash
}

function appdaemon-install-package {
appdaemon-show-short-info
appdaemon-show-copyright-info

echo “Creating directory for AppDaemon Venv”
sudo mkdir /srv/appdaemon
sudo chown -R homeassistant:homeassistant /srv/appdaemon

echo “Changing to the homeassistant user”
sudo -u homeassistant -H /bin/bash << EOF

echo “Creating AppDaemon venv”
python3 -m venv /srv/appdaemon

echo “Changing to AppDaemon venv”
source /srv/appdaemon/bin/activate

echo “Creating directory for AppDaemon configuration file”
mkdir /home/homeassistant/appdaemon
mkdir /home/homeassistant/appdaemon/apps

echo “Installing latest version of AppDaemon”
pip3 install wheel
pip3 install appdaemon

echo “Copying AppDaemon config file”
cp /opt/hassbian/suites/files/appdaemon.conf /home/homeassistant/appdaemon/appdaemon.yaml
touch /home/homeassistant/appdaemon/apps.yaml

echo “Deactivating virtualenv”
deactivate
EOF

echo “Copying AppDaemon service file”
sudo cp /opt/hassbian/suites/files/appdaemon.service /etc/systemd/system/[email protected]

echo “Enabling AppDaemon service”
systemctl enable [email protected]
sync

echo “Starting AppDaemon service”
systemctl start [email protected]

echo
echo “Installation done.”
echo
echo “To continue have a look at Welcome to AppDaemon’s documentation! — AppDaemon 4.4.3 documentation
echo
echo “If you have issues with this script, please say something in the hassbian channel on Discord.”
echo
return 0
}

Make this script function as it always has if run standalone, rather than issue a warning and do nothing.

[[ $0 == “$BASH_SOURCE” ]] && homeassistant-install-package

In /home/homeassistant/appdaemon i have set appdaemon.yaml this way:

AppDaemon:
logfile: STDOUT
errorfile: STDERR
log_generations: 3
threads: 10
HASS:
ha_url: http://127.0.0.1:8123
HADashboard:
dash_url: http://192.168.1.10:5050

Apps

[hello_world]
module = hello
class = HelloWorld

and I also created directory /home/homeassistant/appdaemon/dashboards (created as sudo so I hope there will be no problems with rights) where i file Hello.dash containing:

title: Hello Panel
widget_dimensions: [120, 120]
widget_margins: [5, 5]
columns: 8

label:
widget_type: label
text: Hello World

layout:
- label(2x2)

But I can´t see nothing on 192.168.1.10:5050. Any advice? How could I check if appdaemon is running or how to call it to run regarding the path described above?

set the logfile and errorfile to a file where the appdaemon user has writing access.
then you can check, if anything and what is happening.

the ha url should be an url that you can use in your browser to access HA, and if you have set a password then you need to give that too.

and you use systemclt to run appdaemon, so you could check if the service is running or not.
(if you dont know how, then its probably wise to read about how to use and configure systemclt)

Something more exact about how to run appdaemon? If you check the script you can see it should be set to run on startup. URL of HA is set properly. Logfille path is to directory with chmod 777 - no logs.

to which files do those logs go?
logfilepath ist to directory with chmod … ?
which logfilepath if you dont give any logfile?

you ask how to check if appdaemon is running, i tell you how you could check, you say it is setup to run at startup.
so is it running without failures or not?

url is set properly, you say, so you can reach it like that in a browser?

This is in the appdaemon.yaml:

AppDaemon:
threads: 10
logfile: /home/homeassistant/appdaemon/logs/appdaemon.log
errorfile: /home/homeassistant/appdaemon/logs/appdaemonerr.log
HASS:
ha_url: http://192.168.1.10:8123
HADashboard:
dash_url: http://192.168.1.10:5151

This is in the appdaemon.log:

2017-11-12 07:34:18.909757 INFO AppDaemon Version 2.1.12 starting
2017-11-12 07:34:18.910462 INFO Configuration read from: /home/homeassistant/appdaemon/appdaemon.yaml
2017-11-12 07:34:18.930669 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-11-12 07:34:23.941644 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-11-12 07:34:28.951718 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-11-12 08:34:34.154566 INFO Starting Apps
2017-11-12 08:34:34.252256 INFO Got initial state
2017-11-12 08:34:34.253423 INFO App initialization complete
2017-11-12 08:34:34.254315 INFO Starting dashboard
2017-11-12 08:34:34.264244 WARNING ------------------------------------------------------------
2017-11-12 08:34:34.264844 WARNING Unexpected error in dashboard thread
2017-11-12 08:34:34.265224 WARNING ------------------------------------------------------------
2017-11-12 08:34:34.276349 WARNING Traceback (most recent call last):
File “/srv/appdaemon/lib/python3.5/site-packages/aiohttp/web_urldispatcher.py”, line 458, in init
directory = directory.resolve()
File “/usr/lib/python3.5/pathlib.py”, line 1109, in resolve
s = self._flavour.resolve(self)
File “/usr/lib/python3.5/pathlib.py”, line 330, in resolve
return _resolve(base, str(path)) or sep
File “/usr/lib/python3.5/pathlib.py”, line 315, in _resolve
target = accessor.readlink(newpath)
File “/usr/lib/python3.5/pathlib.py”, line 422, in readlink
return os.readlink(path)
FileNotFoundError: [Errno 2] No such file or directory: ‘/home/homeassistant/appdaemon/compiled’

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/srv/appdaemon/lib/python3.5/site-packages/appdaemon/rundash.py”, line 319, in run_dash
setup_routes(conf.dashboard_obj)
File “/srv/appdaemon/lib/python3.5/site-packages/appdaemon/rundash.py”, line 289, in setup_routes
app.router.add_static(‘/compiled_javascript’, dashboard.compiled_javascript_dir)
File “/srv/appdaemon/lib/python3.5/site-packages/aiohttp/web_urldispatcher.py”, line 904, in add_static
append_version=append_version)
File “/srv/appdaemon/lib/python3.5/site-packages/aiohttp/web_urldispatcher.py”, line 463, in init
“No directory exists at ‘{}’”.format(directory)) from error
ValueError: No directory exists at ‘/home/homeassistant/appdaemon/compiled/javascript’

2017-11-12 08:34:34.276958 WARNING ------------------------------------------------------------
2017-11-12 08:34:34.277385 INFO API is disabled
2017-11-12 08:34:34.287784 INFO Connected to Home Assistant 0.57.2
2017-11-12 08:34:46.905150 WARNING Scheduler clock skew detected - delta = 7.905016899108887 - resetting

It was write permission problem. Solved this way:

sudo su -s /bin/bash homeassistant (to change user to homeassistant)

mkdir /home/homeassistant/appdaemon/compiledmkdir
/home/homeassistant/appdaemon/compiled/javascript
mkdir /home/homeassistant/appdaemon/compiled/css

Now hadashboard starts.

I think you mean (?):

mkdir /home/homeassistant/appdaemon/compiled
mkdir /home/homeassistant/appdaemon/compiled/javascript
mkdir /home/homeassistant/appdaemon/compiled/css