junior466
(Junior466)
1
I’ve read the notes here about new requirements and AppDaemon starts with no errors but I can’t get my dashboard to load any longer.
Here’s my new configuration with which I believe the part in bold to be wrong or needs adjustments:
logs:
main_log:
filename: /home/user/haappdaemon/logs/appdaemon.log
access_log:
filename: /home/user/haappdaemon/logs/access.log
error_log:
filename: /home/user/haappdaemon/logs/error.log
diag_log:
filename: /home/user/haappdaemon/logs/diag.log
log_generations: 5
log_size: 1024
format: "{asctime} {levelname:<8} {appname:<10}: {message}"
test_log:
name: TestLog
filename: /home/user/haappdaemon/logs/test.log
appdaemon:
threads: 10
latitude: REDACTED
longitude: REDACTED
elevation: REDACTED
time_zone: REDACTED
plugins:
HASS:
type: hass
ha_url: http://192.168.143.11:8123
token: REDACTED
namespace: default
hadashboard:
dashboard_dir: /home/user/haappdaemon/conf/dashboards
dash_url: http://192.168.143.52:8124
hadashboard:
dashboard_dir: /home/user/haappdaemon/conf/dashboards
dash_url: http://192.168.143.52:8124
This is my old configuration prior to the update:
log:
logfile: STDOUT
errorfile: STDERR
logsize: 100000
log_generations: 3
appdaemon:
threads: 10
plugins:
HASS:
type: hass
ha_url: http://192.168.143.11:8123
token: REDACTED
hadashboard:
dash_url: http://192.168.143.52:8124
What am I missing to get the dashboard to load? Again, no errors displayed:
● [email protected] - AppDaemon
Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: active (running) since Fri 2020-02-07 11:32:12 EST; 10min ago
Main PID: 4432 (appdaemon)
Tasks: 12 (limit: 2318)
CGroup: /system.slice/system-appdaemon.slice/[email protected]
└─4432 /usr/bin/python3 /usr/local/bin/appdaemon -c /home/user/haappdaemon/conf
Feb 07 11:32:12 ubuntuhass systemd[1]: Started AppDaemon.
tjntomas
(Tomas Jansson)
2
You need the api:
key and you can also add the admin:
key. See at the bottom of the config.
logs:
main_log:
filename: /home/user/haappdaemon/logs/appdaemon.log
access_log:
filename: /home/user/haappdaemon/logs/access.log
error_log:
filename: /home/user/haappdaemon/logs/error.log
diag_log:
filename: /home/user/haappdaemon/logs/diag.log
log_generations: 5
log_size: 1024
format: "{asctime} {levelname:<8} {appname:<10}: {message}"
test_log:
name: TestLog
filename: /home/user/haappdaemon/logs/test.log
appdaemon:
threads: 10
latitude: REDACTED
longitude: REDACTED
elevation: REDACTED
time_zone: REDACTED
plugins:
HASS:
type: hass
ha_url: http://192.168.143.11:8123
token: REDACTED
namespace: default # This is not needed
hadashboard:
dashboard_dir: /home/user/haappdaemon/conf/dashboards
dash_url: http://192.168.143.52:8124
api: #this is needed
admin: # This will also help
title: AppDaemon
stats_update: realtime
junior466
(Junior466)
3
Where do I find/create this api? Is this from home assistant?
tjntomas
(Tomas Jansson)
4
No, nothing more to add more than just api:
. It does not need any value. Same with the admin:
junior466
(Junior466)
5
I added it and reloaded/restarted everything but still nothing.
junior466
(Junior466)
7
Yes actually.
2020-02-07 11:32:14.923783 WARNING hello_world: ------------------------------------------------------------
2020-02-07 12:29:01.402206 WARNING hello_world: ------------------------------------------------------------
2020-02-07 12:29:01.402317 WARNING hello_world: Unexpected error initializing app: hello_world:
2020-02-07 12:29:01.402403 WARNING hello_world: ------------------------------------------------------------
2020-02-07 12:29:01.402969 WARNING hello_world: Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/appdaemon/app_management.py", line 820, in check_app_updates
await self.init_object(app)
File "/usr/local/lib/python3.6/dist-packages/appdaemon/app_management.py", line 280, in init_object
self.AD, name, self.AD.logging, app_args, self.AD.config, self.app_config, self.AD.global_vars
File "/usr/local/lib/python3.6/dist-packages/appdaemon/plugins/hass/hassapi.py", line 46, in __init__
adbase.ADBase.__init__(self, ad, name, logging, args, config, app_config, global_vars)
File "/usr/local/lib/python3.6/dist-packages/appdaemon/adbase.py", line 75, in __init__
self.dashboard_dir = self.AD.http.dashboard_dir
AttributeError: 'NoneType' object has no attribute 'dashboard_dir'
2020-02-07 12:29:01.403069 WARNING hello_world: ------------------------------------------------------------
tjntomas
(Tomas Jansson)
8
Ok, remove the dashboard_dir from the config. How does the Start entry in the appdaemon.service file look?
junior466
(Junior466)
9
Removed and still nothing.
[Unit]
Description=AppDaemon
[email protected]
[Service]
Type=simple
User=user
ExecStart=/usr/local/bin/appdaemon -c /home/user/haappdaemon/conf
[Install]
WantedBy=multi-user.target
tjntomas
(Tomas Jansson)
11
Anything new in the Logs?
junior466
(Junior466)
12
I was missing a few things but I got the dashboard to at least come up but now I have a ton of broken widgets. Here’s what works:
logs:
main_log:
filename: /home/user/haappdaemon/logs/appdaemon.log
access_log:
filename: /home/user/haappdaemon/logs/access.log
error_log:
filename: /home/user/haappdaemon/logs/error.log
appdaemon:
latitude: REDACTED
longitude: REDACTED
elevation: REDACTED
time_zone: REDACTED
app_dir: /conf/apps
plugins:
HASS:
type: hass
ha_url: http://192.168.143.11:8123
token: REDACTED
namespace: HASS
api:
http:
url: http://192.168.143.52:8124
hadashboard:
Here’s what the log says now:
2020-02-07 12:59:20.188573 INFO AppDaemon: App initialization complete
2020-02-07 12:59:26.257281 WARNING AppDaemon: Error in widget definition '%s':
2020-02-07 12:59:26.257550 WARNING AppDaemon: parser says
2020-02-07 12:59:26.257710 WARNING AppDaemon: in "<unicode string>", line 2, column 10:
entity: {{entity}}
^
2020-02-07 12:59:26.257854 WARNING AppDaemon: found unhashable key while constructing a mapping
2020-02-07 12:59:49.164876 WARNING AppDaemon: Error in widget definition '%s':
2020-02-07 12:59:49.165043 WARNING AppDaemon: parser says
2020-02-07 12:59:49.165136 WARNING AppDaemon: in "<unicode string>", line 2, column 10:
entity: {{entity}}
^
2020-02-07 12:59:49.165248 WARNING AppDaemon: found unhashable key while constructing a mapping
2020-02-07 13:02:15.582507 WARNING AppDaemon: Error in widget definition '%s':
2020-02-07 13:02:15.582739 WARNING AppDaemon: parser says
2020-02-07 13:02:15.582906 WARNING AppDaemon: in "<unicode string>", line 2, column 10:
entity: {{entity}}
^
2020-02-07 13:02:15.583070 WARNING AppDaemon: found unhashable key while constructing a mapping
2020-02-07 13:02:33.523111 WARNING AppDaemon: Error in widget definition '%s':
2020-02-07 13:02:33.523274 WARNING AppDaemon: parser says
2020-02-07 13:02:33.523367 WARNING AppDaemon: in "<unicode string>", line 2, column 10:
entity: {{entity}}
^
2020-02-07 13:02:33.523454 WARNING AppDaemon: found unhashable key while constructing a mapping
Complaining about ‘%s’:?
tjntomas
(Tomas Jansson)
13
Check the custom widgets folder in the .yaml files. Any occurrence of {{something}} need to be on quotes, so change to “{{something}}”.
junior466
(Junior466)
14
That helps! Now all my entities are unknown. Here’s the log:
2020-02-07 14:20:07.080135 INFO AppDaemon: AppDaemon Version 4.0.1 starting
2020-02-07 14:20:07.080297 INFO AppDaemon: Python version is 3.6.9
2020-02-07 14:20:07.080422 INFO AppDaemon: Configuration read from: /home/user/haappdaemon/conf/appdaemon.yaml
2020-02-07 14:20:07.080544 INFO AppDaemon: Added log: AppDaemon
2020-02-07 14:20:07.080687 INFO AppDaemon: Added log: Error
2020-02-07 14:20:07.080814 INFO AppDaemon: Added log: Access
2020-02-07 14:20:07.080931 INFO AppDaemon: Added log: Diag
2020-02-07 14:20:07.091238 WARNING AppDaemon: config_dir: /home exists, but is not writeable, owner: root
2020-02-07 14:20:07.091590 WARNING AppDaemon: appdir: /conf does not exist exist
2020-02-07 14:20:07.091723 WARNING AppDaemon: appdir: /conf/apps does not exist exist
2020-02-07 14:20:07.092176 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2020-02-07 14:20:07.099975 INFO HASS: HASS Plugin Initializing
2020-02-07 14:20:07.100139 INFO HASS: HASS Plugin initialization complete
2020-02-07 14:20:07.100374 INFO AppDaemon: Initializing HTTP
2020-02-07 14:20:07.100585 INFO AppDaemon: Using 'ws' for event stream
2020-02-07 14:20:07.106034 INFO AppDaemon: Starting API
2020-02-07 14:20:07.107558 INFO AppDaemon: Admin Interface is disabled
2020-02-07 14:20:07.107656 INFO AppDaemon: Starting Dashboards
2020-02-07 14:20:07.108473 WARNING AppDaemon: css: /home exists, but is not writeable, owner: root
2020-02-07 14:20:07.108883 WARNING AppDaemon: javascript: /home exists, but is not writeable, owner: root
2020-02-07 14:20:07.113537 INFO HASS: Connected to Home Assistant 0.105.2
2020-02-07 14:20:07.114514 INFO AppDaemon: Starting Apps with 0 workers and 0 pins
2020-02-07 14:20:07.114726 INFO AppDaemon: Running on port 8124
2020-02-07 14:20:07.129089 INFO HASS: Evaluating startup conditions
2020-02-07 14:20:07.152867 INFO AppDaemon: Got initial state from namespace HASS
2020-02-07 14:20:09.119220 INFO AppDaemon: Scheduler running in realtime
2020-02-07 14:20:18.284283 WARNING AppDaemon: Unknown entity: script.user_bedtime requested by None
2020-02-07 14:20:18.287669 WARNING AppDaemon: Unknown entity: sensor.hallway_thermostat_hvac_state requested by None
2020-02-07 14:20:18.290483 WARNING AppDaemon: Unknown entity: sensor.heat_run_time_today requested by None
2020-02-07 14:20:18.292444 WARNING AppDaemon: Unknown entity: input_boolean.lasko requested by None
2020-02-07 14:20:18.294612 WARNING AppDaemon: Unknown entity: switch.pihole_switch requested by None
2020-02-07 14:20:18.296884 WARNING AppDaemon: Unknown entity: lock.kitchen_door requested by None
2020-02-07 14:20:18.299128 WARNING AppDaemon: Unknown entity: lock.back_door requested by None
2020-02-07 14:20:18.302656 WARNING AppDaemon: Unknown entity: climate.hallway requested by None
2020-02-07 14:20:18.304672 WARNING AppDaemon: Unknown entity: sensor.pleasant_sky_temperature requested by None
junior466
(Junior466)
15
By the way, here’s the config that works and I think it may not be fully correct:
secrets: /home/user/haappdaemon/conf/secrets.yaml
logs:
main_log:
filename: /home/user/haappdaemon/conf/logs/appdaemon.log
access_log:
filename: /home/user/haappdaemon/conf/logs/access.log
error_log:
filename: /home/user/haappdaemon/conf/logs/error.log
appdaemon:
latitude: !secret latitude
longitude: !secret longitude
elevation: !secret elevation
time_zone: !secret time_zone
app_dir: /conf/apps
plugins:
HASS:
type: hass
ha_url: http://192.168.143.11:8123
token: !secret token
namespace: HASS
api:
http:
url: http://192.168.143.52:8124
hadashboard:
junior466
(Junior466)
16
Got it working. In case it helps someone, here’s my full working configuration. Thanks for your help and prompt replies @tjntomas.
logs:
main_log:
filename: /home/user/haappdaemon/conf/logs/appdaemon.log
access_log:
filename: /home/user/haappdaemon/conf/logs/access.log
error_log:
filename: /home/user/haappdaemon/conf/logs/error.log
appdaemon:
disable_apps: 1
latitude: REDACTED
longitude: REDACTED
elevation: REDACTED
time_zone: REDACTED
# threads: 10
plugins:
HASS:
type: hass
ha_url: http://192.168.143.11:8123
token: REDACTED
http:
url: http://192.168.143.11:8124
admin:
api:
hadashboard:
1 Like
tjntomas
(Tomas Jansson)
17
Glad we solved the problem!