It should “give up” after the page has gone through all errors so keep pressing ok for a while.
Yes you are right,
I pressed a number of times is this is what I got:
Failed to load resource: the server responded with a status of 404 (Not Found)
api/appdaemon/state/…ow_temperature_1d:1 Failed to load resource: the server
So would it be safe to say that I am not getting a connection to my Home Assistant instance (on the same server)?
If so, should my references in my configuration to the HA URL be within quotes or not?
I see it both ways in the documentation.
Currently this is what I have in my appdaemon.yaml
logs:
main_log:
filename: /conf/logs/appdaemon.log
error_log:
filename: /conf/logs/error.log
appdaemon:
latitude: !secret latitude
longitude: !secret longitude
elevation: 70
time_zone: America/New_York
threads: '10'
disable_apps: 1
plugins:
HASS:
type: hass
ha_url: "http://192.168.xx.xx:8123"
token: !secret token
http:
url: "http://192.168.xx.xx:5050"
hadashboard:
Yes, it appears that you can’t connect to Home Assistant. Some things to check: is your secrets file named secrets.yaml
and placed in the config folder?
Are you using a valid long-lived access token? I am not using any quotes whatsoever in my appdamon.yaml file, but qoutes or not shouldn’t make any difference.
Do you get any login errors in your Home Assistant log?
Also, what browser are you using? If Chrome, you can click on network
in the console and then click XHR
and hover over the list of requests. You should then be able to see what url the page is trying to call, and also see the server response if you click on one of the requests.
Not really any progress, but do have some answers for you.
Yes, secrets.yaml file is in the config folder (same folder as appdaemon.yaml)
Yes, I still have a long-lived token that I have been using for a while now and haven’t changed it in my config file.
Errors in my HA log are currently related to either Dark Sky or Zigate, so I have removed any reference to weather in my dashboard.
Restarted Appdaemon a few times and was still seeing the error above, so I decided to comment out the following lines in my docker-compose file:
# - HA_URL="http://192.168.xx.xx:8123"
# - HA_KEY="LongStringTokenInsertedHere"
# - DASH_URL="http://192.168.xx.xx:5050"
I don’t see any errors in the docker logs
I have checked the Network XHR and do see that it’s stopping on all entities in my dashboard. (Keep in mind that some of my dashboard is a copy of examples on github and I don’t have any corresponding in HA, but still the entities that I have in HA is causing errors)
The issues that I see in XHR is the following
404: Not Found
http://192.168.xx.xx:5050/api/appdaemon/state/default/light.kitchen_right
This entity is currently in my HA
Just for reference, this is my docker-compose part for appdaemon. Maybe this will help you:
appdaemon_4:
container_name: appdaemon_4
image: acockburn/appdaemon:4.0.0
depends_on:
- hass
ports:
- 5050:5050
restart: unless-stopped
volumes:
- /etc/localtime:/etc/localtime:ro
- ./volumes/appdaemon_4:/conf
And my appdaemon.yaml file:
secrets: /conf/secrets.yaml
logs:
main_log:
filename: /conf/logs/appdaemon.log
error_log:
filename: /conf/logs/error.log
access_log:
filename: /conf/logs/access.log
appdaemon:
time_zone: 'Europe/Zurich'
latitude: !secret latitude
longitude: !secret longitude
elevation: !secret elevation
missing_app_warnings: 1
production_mode: False
app_dir: /conf/apps
plugins:
HASS:
type: hass
namespace: hass
token: !secret appdaemon_token
ha_url: http://192.168.0.5:8123
MQTT:
type: mqtt
namespace: mqtt
client_id: AD_4
client_host: 192.168.0.5
client_user: !secret mqtt_user
client_password: !secret mqtt_password
http:
url: http://192.168.0.5:5050
api:
hadashboard:
admin:
title: AppDaemon
stats_update: realtime
What happens if you navigatè to http://192.168.xx.xx:5050/api/appdaemon/state/default/light.kitchen_right in your browser?
Thanks @Burningstone, I’ll try to craft mine around yours and see if I get any better luck. Will keep you posted.
I did and the only thing that I have on the page was that : “404: Not Found”
Ok, so the Appdaemon rest api is not working for some reason.
Try adding the api
: and admin:
entries to your appdaemon.yaml. Restart Appdaemon and then goto http://192.168.xx.xx:5050 and click on entities
and see if all your HA entities are listed there.
Updated:
I was looking in the wrong place …
So under “hass” . I see all my entities
BTW, thanks to all for your assistance !!
OK … further more I was just able to load one of my dashboards without seeing any Java errors, so I am on the right path … now I just need to read the docs on skins (css) as what I have does not seem to work at this time, but this is minimal.
Thanks again to everyone for your help
I figured out the issue. I commented it out following then AD worked.
logsize: 100000
log_generations: 3
great to hear you figured it out.
How do I use admin interface?
I added following to appdaemon.yaml file.
admin:
title: AppDaemon
stats_update: realtime
http:
url: http://192.168.86.226:5050
When I browse to 192.168.86.226:5050 I get the following error message. All the content in the admin GUI is empty.
Error getting state, check Java Console for details
From Chrome Dev Console:
Failed to load resource: the server responded with a status of 404 (Not Found)
:5050/api/appdaemon/state:1
Do you have the api:
entry in your appdaemon.yaml?
Had the same problem. Api fixes it, thanks
thx. for that correct answer @tjntomas
it wasnt intended, deshalb it isnt in the docs, but in AD 4 admin depends on api.
actually are admin: api: and hadashboard: all connected together, they all depend on http:
Bingo! That solved the issue.
I’m still seeing issues on my config:
2020-02-05 17:06:42.733849 INFO AppDaemon: AppDaemon Version 4.0.1 starting
2020-02-05 17:06:42.734017 INFO AppDaemon: Python version is 3.8.1
2020-02-05 17:06:42.734176 INFO AppDaemon: Configuration read from: /conf/appdaemon.yaml
2020-02-05 17:06:42.734319 INFO AppDaemon: Added log: AppDaemon
2020-02-05 17:06:42.734477 INFO AppDaemon: Added log: Error
2020-02-05 17:06:42.734620 INFO AppDaemon: Added log: Access
2020-02-05 17:06:42.734756 INFO AppDaemon: Added log: Diag
2020-02-05 17:06:42.734906 ERROR AppDaemon: time_zone not specified in appdaemon.cfg
2020-02-05 17:06:42.735042 ERROR AppDaemon: latitude not specified in appdaemon.cfg
2020-02-05 17:06:42.735174 ERROR AppDaemon: longitude not specified in appdaemon.cfg
2020-02-05 17:06:42.735309 ERROR AppDaemon: elevation not specified in appdaemon.cfg
Here is my appdaeomon.yaml:
secrets: /conf/secrets.yaml
logs:
main_log:
filename: /conf/logs/appdaemon.log
error_log:
filename: /conf/logs/error.log
access_log:
filename: /conf/logs/access.log
appdaemon:
time_zone: 'America/Los_Angeles'
latitude: !secret lat
longitude: !secret long
elevation: 239
app_dir: /conf/apps
plugins:
HASS:
type: hass
namespace: hass
ha_url: !ha_url
token: !secret token
api:
http:
url: http://192.168.11.225:5050
hadashboard:
admin:
title: AppDaemon
stats_update: realtime
And my test docker script:
docker run --rm -it -p 5050:5050 acockburn/appdaemon:latest