Appdaemon Install Issue

When I installed appdaemon I installed it under a user other than “hass”. When I run “appdaemon -c /home/hass/.homeassistant/conf” I get these warnings and errors:

2018-04-29 22:22:15.103309 INFO AppDaemon Version 3.0.1 starting
2018-04-29 22:22:15.103444 INFO Configuration read from: /home/hass/.homeassistant/conf/appdaemon.yaml
2018-04-29 22:22:15.104558 INFO AppDaemon: Starting Apps
2018-04-29 22:22:15.104858 WARNING config_dir: /home exists, but is not writeable, owner: root
2018-04-29 22:22:15.104972 WARNING config_dir: /home/hass exists, but is not writeable, owner: hass
2018-04-29 22:22:15.105070 WARNING config_dir: /home/hass/.homeassistant exists, but is not writeable, owner: hass
2018-04-29 22:22:15.105547 WARNING appdir: /home/hass/.homeassistant/conf/apps does not exist exist
2018-04-29 22:22:15.106972 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2018-04-29 22:22:15.112446 INFO AppDaemon: HASS: HASS Plugin Initializing
2018-04-29 22:22:15.112623 INFO AppDaemon: HASS: HASS Plugin initialization complete
2018-04-29 22:22:15.112746 INFO Starting Dashboards
2018-04-29 22:22:15.113445 WARNING css: /home exists, but is not writeable, owner: root
2018-04-29 22:22:15.113556 WARNING css: /home/hass exists, but is not writeable, owner: hass
2018-04-29 22:22:15.113654 WARNING css: /home/hass/.homeassistant exists, but is not writeable, owner: hass
2018-04-29 22:22:15.114187 WARNING javascript: /home exists, but is not writeable, owner: root
2018-04-29 22:22:15.114283 WARNING javascript: /home/hass exists, but is not writeable, owner: hass
2018-04-29 22:22:15.114377 WARNING javascript: /home/hass/.homeassistant exists, but is not writeable, owner: hass
2018-04-29 22:22:15.117275 INFO API is disabled
2018-04-29 22:22:15.208861 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-04-29 22:22:20.304666 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-04-29 22:22:25.391453 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
^C2018-04-29 22:22:26.848800 INFO Keyboard interrupt
2018-04-29 22:22:27.393930 ERROR AppDaemon: Required attribute not set or obtainable from any plugin: latitude
2018-04-29 22:22:27.394070 ERROR AppDaemon: AppDaemon is terminating
2018-04-29 22:22:27.394192 ERROR AppDaemon: Required attribute not set or obtainable from any plugin: longitude
2018-04-29 22:22:27.394317 ERROR AppDaemon: AppDaemon is terminating
2018-04-29 22:22:27.394472 ERROR AppDaemon: Required attribute not set or obtainable from any plugin: elevation
2018-04-29 22:22:27.394580 ERROR AppDaemon: AppDaemon is terminating
2018-04-29 22:22:27.394743 ERROR AppDaemon: Required attribute not set or obtainable from any plugin: time_zone
2018-04-29 22:22:27.394854 ERROR AppDaemon: AppDaemon is terminating
^C2018-04-29 22:22:29.537037 INFO Keyboard interrupt
2018-04-29 22:22:30.393447 INFO AppDaemon: HASS: Disconnecting from Home Assistant
2018-04-29 22:22:30.393779 INFO AppDeamon Exited

This is my appdaemon.yaml file:
log:
  logfile: STDOUT
  errorfile: STDERR
appdaemon:
  threads: 10
  api_key: <redacted>
  api_ssl_certificate: /etc/letsencrypt/live/<redacted>.duckdns.org/fullchain.pem
  api_ssl_key: /etc/letsencrypt/live/<redacted>.duckdns.org/privkey.pem
  plugins:
    HASS:
      type: hass
      ha_url: https://<redacted>.duckdns.org:8123
      ha_key: <redacted>
      cert_path: /etc/letsencrypt/live/<redacted>.duckdns.org/fullchain.pem
      cert_verify: True
      namespace: default
hadashboard:
  dash_url: https://<redacted>.duckdns.org:5050
  dash_password: <redacted>
  dash_ssl_certificate: /etc/letsencrypt/live/<redacted>.duckdns.org/fullchain.pem
  dash_ssl_key: /etc/letsencrypt/live/<redacted>.duckdns.org/privkey.pem
  dash_dir: /conf/dashboards

Do I need to uninstall appdaemon from the current user and re-install under the “hass” user? I am not absolutely sure I need to as they appear to be “Warning” messages. Not sure why I am getting the Error messages above though. I should also mention I run HA in a venv.

Hello @photo64,

What I understand is that this happens when you create the conf folder using root, but you trying to use a different user to start Appdaemon. That is why it’s complaining it cant write to it (I had that issue recently).

Since it looks like you created the files using the hass user, then just run it as hass. What stops you from doing that?

Regards

this gets you in trouble.

  1. it needs to be http and not https
  2. it needs to be an ip adress

in your conf dir you need an subdir called apps. it isnt there now.

do you connect to hass with https://.duckdns.org:8123 or with https://.duckdns.org?
the url needs to work in a browser.

https://.duckdns.org:8123 combined with https://.duckdns.org:5050
is almost impossible if you dont install a proxy server (for example nginx)
then you can point to the local ip from hass (which is better anyway, because you wont be dependant on the internet for apps and dashboards)

Does the url need to change in the plugins: section too or is the ip address only needed in the hadashboard: section?

I normally connect as https://.duckdns.org:8123

I assume the permissions is not an issue and I do not need to re-install under “hass” as the owner?

Thanks!

**edit
I added the apps and dashboard folder to /conf and changed to the ip address in the dashboard section but ran into this error below. I tied setting the dash_dir: to /conf/dashboards and I also tried using the full path of /home/hass/.homeassistant/conf/dashboards.

appdaemon -c /home/hass/.homeassistant/conf/
2018-04-30 07:49:55.009968 INFO AppDaemon Version 3.0.1 starting
2018-04-30 07:49:55.010106 INFO Configuration read from: /home/hass/.homeassistant/conf/appdaemon.yaml
2018-04-30 07:49:55.011182 INFO AppDaemon: Starting Apps
2018-04-30 07:49:55.011484 WARNING config_dir: /home exists, but is not writeable, owner: root
2018-04-30 07:49:55.011586 WARNING config_dir: /home/hass exists, but is not writeable, owner: hass
2018-04-30 07:49:55.011684 WARNING config_dir: /home/hass/.homeassistant exists, but is not writeable, owner: hass
2018-04-30 07:49:55.013763 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2018-04-30 07:49:55.019177 INFO AppDaemon: HASS: HASS Plugin Initializing
2018-04-30 07:49:55.019365 INFO AppDaemon: HASS: HASS Plugin initialization complete
2018-04-30 07:49:55.019489 INFO Starting Dashboards
Traceback (most recent call last):
File “/usr/local/bin/appdaemon”, line 11, in
sys.exit(main())
File “/usr/local/lib/python3.6/site-packages/appdaemon/admain.py”, line 375, in main
admain.main()
File “/usr/local/lib/python3.6/site-packages/appdaemon/admain.py”, line 371, in main
self.run(appdaemon, hadashboard)
File “/usr/local/lib/python3.6/site-packages/appdaemon/admain.py”, line 78, in run
self.rundash = rundash.RunDash(self.AD, loop, self.logger, self.access, **hadashboard)
File “/usr/local/lib/python3.6/site-packages/appdaemon/rundash.py”, line 127, in init
raise ValueError(“Invalid host for ‘dash_url’”)
ValueError: Invalid host for ‘dash_url’

if you can connect to HA with your local IP(try out in browser) then that is a better approach.
if not then you can use that url in the plugins section (not adviced though)
if your internet is slow, or the connection to duckdns is slow, then you wont be able to get appdaemon up and running.

your latest warning tells that you have an error in the line with dash_url

it needs to be like:

dash_url: http://192.168.1.20:5050

edit: if the dashboard dir is on default place you dont need to set it at all.
and conf/dashboards is default.

I noticed I was missing an ‘/’ in the statement. When updated I now get this. One other thing, it seems I am unable to connect to HA just entering the ip address in a browser. Is there something I need to fix there?

appdaemon -c /home/hass/.homeassistant/conf/
2018-04-30 08:03:03.490044 INFO AppDaemon Version 3.0.1 starting
2018-04-30 08:03:03.490182 INFO Configuration read from: /home/hass/.homeassistant/conf/appdaemon.yaml
2018-04-30 08:03:03.491265 INFO AppDaemon: Starting Apps
2018-04-30 08:03:03.491569 WARNING config_dir: /home exists, but is not writeable, owner: root
2018-04-30 08:03:03.491670 WARNING config_dir: /home/hass exists, but is not writeable, owner: hass
2018-04-30 08:03:03.491766 WARNING config_dir: /home/hass/.homeassistant exists, but is not writeable, owner: hass
2018-04-30 08:03:03.493646 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2018-04-30 08:03:03.499103 INFO AppDaemon: HASS: HASS Plugin Initializing
2018-04-30 08:03:03.499282 INFO AppDaemon: HASS: HASS Plugin initialization complete
2018-04-30 08:03:03.499414 INFO Starting Dashboards
2018-04-30 08:03:03.500052 WARNING css: /home exists, but is not writeable, owner: root
2018-04-30 08:03:03.500164 WARNING css: /home/hass exists, but is not writeable, owner: hass
2018-04-30 08:03:03.500264 WARNING css: /home/hass/.homeassistant exists, but is not writeable, owner: hass
2018-04-30 08:03:03.500750 WARNING javascript: /home exists, but is not writeable, owner: root
2018-04-30 08:03:03.500846 WARNING javascript: /home/hass exists, but is not writeable, owner: hass
2018-04-30 08:03:03.500940 WARNING javascript: /home/hass/.homeassistant exists, but is not writeable, owner: hass
2018-04-30 08:03:03.503774 INFO API is disabled
2018-04-30 08:03:03.589452 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-04-30 08:03:08.683151 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-04-30 08:03:13.797897 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds

dashboard is now correctly configured.
but you still have no connection to HA.
do you have strange characters in your password?
or is it made from figures only?
a password like 1234 must be given like “1234”

you have SSL inside your HASS installed. thats why you cant connect to it with the local url.
the best way to go is use a proxyserver like:

you are now trying to setup the mostly used solution.

My password is a combination of text and numbers, nothing unusual. Sounds like I need to figure out how to connect with a local url to make this work or is there a way using my current setup? Sorry, a bit of a novice to this type of setup.

it should be possible with your actual setup, if your connection to HA is not very slow.

i would start with a yaml like this:

log:
  logfile: STDOUT # i would advice setting a logfile here like /home/hass/.homeassistant/conf/AD.log
  errorfile: STDERR # i would advice setting an errorfile here like /home/hass/.homeassistant/conf/ADerrors.log
appdaemon:
  threads: 10
  # api_key: <redacted> # i dont think you want to start connecting to AD apps from outside right now
  # api_ssl_certificate: /etc/letsencrypt/live/<redacted>.duckdns.org/fullchain.pem
  # api_ssl_key: /etc/letsencrypt/live/<redacted>.duckdns.org/privkey.pem
  plugins:
    HASS:
      type: hass
      ha_url: https://<redacted>.duckdns.org:8123
      ha_key: <redacted>
      # cert_path: /etc/letsencrypt/live/<redacted>.duckdns.org/fullchain.pem # i am not sure if that is needed so lets try without
      # cert_verify: True
      # namespace: default # shouldnt be needed.
hadashboard:
  dash_url: http://your_local_ip:5050
  dash_password: <redacted>
  # dash_ssl_certificate: /etc/letsencrypt/live/<redacted>.duckdns.org/fullchain.pem # not needed
  # dash_ssl_key: /etc/letsencrypt/live/<redacted>.duckdns.org/privkey.pem # not needed
  # dash_dir: /conf/dashboards # only needed if its another dir

Possibly getting closer? I skinny down the yaml file but now get a message about the apps.yaml file,

appdaemon -c /home/hass/.homeassistant/conf/
2018-04-30 08:40:22.290817 INFO AppDaemon Version 3.0.1 starting
2018-04-30 08:40:22.290956 INFO Configuration read from: /home/hass/.homeassistant/conf/appdaemon.yaml
2018-04-30 08:40:22.292182 INFO AppDaemon: Starting Apps
2018-04-30 08:40:22.292527 WARNING config_dir: /home exists, but is not writeable, owner: root
2018-04-30 08:40:22.292670 WARNING config_dir: /home/hass exists, but is not writeable, owner: hass
2018-04-30 08:40:22.292803 WARNING config_dir: /home/hass/.homeassistant exists, but is not writeable, owner: hass
2018-04-30 08:40:22.295890 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2018-04-30 08:40:22.306519 INFO AppDaemon: HASS: HASS Plugin Initializing
2018-04-30 08:40:22.306765 INFO AppDaemon: HASS: HASS Plugin initialization complete
2018-04-30 08:40:22.306954 INFO Starting Dashboards
2018-04-30 08:40:22.307815 WARNING css: /home exists, but is not writeable, owner: root
2018-04-30 08:40:22.307955 WARNING css: /home/hass exists, but is not writeable, owner: hass
2018-04-30 08:40:22.308092 WARNING css: /home/hass/.homeassistant exists, but is not writeable, owner: hass
2018-04-30 08:40:22.308659 WARNING javascript: /home exists, but is not writeable, owner: root
2018-04-30 08:40:22.308786 WARNING javascript: /home/hass exists, but is not writeable, owner: hass
2018-04-30 08:40:22.308906 WARNING javascript: /home/hass/.homeassistant exists, but is not writeable, owner: hass
2018-04-30 08:40:22.311545 INFO API is disabled
2018-04-30 08:40:22.446829 INFO AppDaemon: HASS: Connected to Home Assistant 0.67.1
2018-04-30 08:40:22.514516 INFO AppDaemon: Got initial state from namespace default
2018-04-30 08:40:24.515215 INFO AppDaemon: Reading config
2018-04-30 08:40:24.515415 WARNING AppDaemon: apps.yaml in the Config directory is deprecated. Please move apps.yaml to the apps directory.
2018-04-30 08:40:24.515814 WARNING AppDaemon: New config not applied
2018-04-30 08:40:24.516190 INFO AppDaemon: Adding /home/hass/.homeassistant/conf/apps to module import path
2018-04-30 08:40:24.516767 INFO AppDaemon: App initialization complete
2018-04-30 08:40:24.517230 INFO AppDaemon: Reading config
2018-04-30 08:40:24.517564 WARNING AppDaemon: apps.yaml in the Config directory is deprecated. Please move apps.yaml to the apps directory.

that seems to go allright.
all you need to do is move the apps.yaml from the conf directory to your apps directory and you are good to go.

edit: and if you dont want to use apps at all you can also disable it like:

appdaemon:
  disable_apps: 1

ah, yes I should have caught that. So this all looks good now and I don’t need to worry about the permissions at all. Thanks so much for your help. Now on to getting HADashboard up and running.

appdaemon -c /home/hass/.homeassistant/conf/
2018-04-30 08:49:35.879347 INFO AppDaemon Version 3.0.1 starting
2018-04-30 08:49:35.879486 INFO Configuration read from: /home/hass/.homeassistant/conf/appdaemon.yaml
2018-04-30 08:49:35.880547 INFO AppDaemon: Starting Apps
2018-04-30 08:49:35.880839 WARNING config_dir: /home exists, but is not writeable, owner: root
2018-04-30 08:49:35.880938 WARNING config_dir: /home/hass exists, but is not writeable, owner: hass
2018-04-30 08:49:35.881033 WARNING config_dir: /home/hass/.homeassistant exists, but is not writeable, owner: hass
2018-04-30 08:49:35.881550 WARNING appdir: /home/hass/.homeassistant/conf/apps is owned by hass but appdaemon is running as ronp
2018-04-30 08:49:35.883285 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2018-04-30 08:49:35.888703 INFO AppDaemon: HASS: HASS Plugin Initializing
2018-04-30 08:49:35.888877 INFO AppDaemon: HASS: HASS Plugin initialization complete
2018-04-30 08:49:35.889001 INFO Starting Dashboards
2018-04-30 08:49:35.889648 WARNING css: /home exists, but is not writeable, owner: root
2018-04-30 08:49:35.889756 WARNING css: /home/hass exists, but is not writeable, owner: hass
2018-04-30 08:49:35.889853 WARNING css: /home/hass/.homeassistant exists, but is not writeable, owner: hass
2018-04-30 08:49:35.890342 WARNING javascript: /home exists, but is not writeable, owner: root
2018-04-30 08:49:35.890437 WARNING javascript: /home/hass exists, but is not writeable, owner: hass
2018-04-30 08:49:35.890529 WARNING javascript: /home/hass/.homeassistant exists, but is not writeable, owner: hass
2018-04-30 08:49:35.892845 INFO API is disabled
2018-04-30 08:49:36.026196 INFO AppDaemon: HASS: Connected to Home Assistant 0.67.1
2018-04-30 08:49:36.090041 INFO AppDaemon: Got initial state from namespace default
2018-04-30 08:49:38.083996 INFO AppDaemon: Reading config
2018-04-30 08:49:38.084516 WARNING AppDaemon: File ‘/home/hass/.homeassistant/conf/apps/apps.yaml’ invalid structure - ignoring
2018-04-30 08:49:38.084657 INFO AppDaemon: /home/hass/.homeassistant/conf/apps/apps.yaml added or modified
2018-04-30 08:49:38.084747 INFO AppDaemon: /home/hass/.homeassistant/conf/apps/apps.yaml added or modified
2018-04-30 08:49:38.084889 INFO AppDaemon: Adding /home/hass/.homeassistant/conf/apps to module import path
2018-04-30 08:49:38.085451 INFO AppDaemon: App initialization complete

you created your apps dir as user hass. and run appdaemon as user ronp.
i would advice to set all filerights for the whole confdir to user hass and start appdaemon as user hass.

or make sure that all files and dirs in the conf dir are configured for user ronp.
appdaemon needs full access (execute,read write) to the whole conf dir.

Yeah I kinda messed up when I initially installed appdaemon. I just changed all permissions to hass for that folder and files. I assume when I setup the service to start at reboot I can set the user as ‘hass’ in this section of the file?

[Unit]
Description=AppDaemon
[email protected]
[Service]
Type=simple
User=%1 <- put hass here??
ExecStart=/usr/local/bin/appdaemon -c
[Install]
WantedBy=multi-user.target

if everything is owned by hass and you start as hass there shouldnt be any problems.
you also would get less warnings in your log.

I am experiencing the same issue:
2019-01-15 12:25:25.226509 INFO AppDaemon Version 3.0.2 starting
2019-01-15 12:25:25.226682 INFO Configuration read from: /home/homeassistant/.homeassistant/conf/appdaemon.yaml
2019-01-15 12:25:25.227494 INFO AppDaemon: Starting Apps
2019-01-15 12:25:25.227647 WARNING config_dir: /home exists, but is not writeable, owner: root
2019-01-15 12:25:25.229243 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2019-01-15 12:25:25.328835 INFO AppDaemon: HASS: HASS Plugin Initializing
2019-01-15 12:25:25.329038 INFO AppDaemon: HASS: HASS Plugin initialization complete
2019-01-15 12:25:25.329173 INFO Starting Dashboards
2019-01-15 12:25:25.329530 WARNING css: /home exists, but is not writeable, owner: root
2019-01-15 12:25:25.329803 WARNING javascript: /home exists, but is not writeable, owner: root
2019-01-15 12:25:25.331354 INFO API is disabled
2019-01-15 12:25:25.333780 INFO AppDaemon: HASS: Connected to Home Assistant 0.85.1
2019-01-15 12:25:25.359543 INFO AppDaemon: Got initial state from namespace default
2019-01-15 12:25:27.386117 INFO AppDaemon: Reading config
2019-01-15 12:25:27.387293 INFO AppDaemon: /home/homeassistant/.homeassistant/conf/apps/apps.yaml added or modified
2019-01-15 12:25:27.387377 INFO AppDaemon: /home/homeassistant/.homeassistant/conf/apps/apps.yaml added or modified
2019-01-15 12:25:27.387441 INFO AppDaemon: App ‘hello_world’ added
2019-01-15 12:25:27.387529 INFO AppDaemon: Adding /home/homeassistant/.homeassistant/conf/apps to module import path
2019-01-15 12:25:27.387680 INFO AppDaemon: Loading App Module: /home/homeassistant/.homeassistant/conf/apps/hello.py
2019-01-15 12:25:27.391283 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2019-01-15 12:25:27.420900 INFO hello_world: Hello from AppDaemon
2019-01-15 12:25:27.421218 INFO hello_world: You are now ready to run Apps!
2019-01-15 12:25:27.421486 INFO AppDaemon: App initialization complete

homeassistant@ReinasServer:~/.homeassistant$ whoami
homeassistant

homeassistant@ReinasServer:~/.homeassistant$ ls -la /home/homeassistant**/.homeassistant/conf/**
total 24
drwxr-xr-x 5 homeassistant homeassistant 4096 Jan 13 14:42 .
drwxr-xr-x 20 homeassistant homeassistant 4096 Jan 13 16:46 …
-rw-r–r-- 1 homeassistant homeassistant 584 Jan 13 14:42 appdaemon.yaml
drwxr-xr-x 3 homeassistant homeassistant 4096 Jun 3 2018 apps
drwxr-xr-x 5 homeassistant homeassistant 4096 Jun 3 2018 compiled
drwxr-xr-x 2 homeassistant homeassistant 4096 Jun 3 2018 dashboards

what “home” directory is appdaemon referring too as owned by root?

the base user dir. but its always owned by root.
so no problem there.
appdaemon just checks all parent directories from the needed directories to make sure we get the right info in the log to help people.

Appdaemon did start correctly, so you are good to go.

1 Like

Plus:
setting up the service points in the same direction:
● appdaemon.service - appdaemon
Loaded: loaded (/lib/systemd/system/appdaemon.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2019-01-15 12:31:35 CET; 6s ago
Process: 30151 ExecStart=/usr/local/bin/appdaemon -c /home/homeassistant/.homeassistant/conf (code=exited, status=210/CHROOT)
Main PID: 30151 (code=exited, status=210/CHROOT)
CPU: 3ms

user permissions

we have been typing simultaneously, thanks for the reply above
this should be then a different problem i guess

i think you maybe forgot or have the wrong user in the service.

but indeed thats a different problem.

How exactly did you install appdaemon? How does your service file look like?