AppDeamon2 is up and running but not doing something

Hi,

i realized since the last update of my Cassio, my appdeamon2 does not recht anymore.

I boots up, I can still switch between the Dashboards, also if I reload the dashboard it shows the new conditions light light is know on or off.
But If I press the button, to turn on the light, nothing happens, appdeamon things it is on, but it is not.
If I then reload, the light is off again.

Here is an error message i can see, maybe someone can help here.

2018-03-09 14:28:58.694512 INFO AppDaemon Version 2.1.12 starting
2018-03-09 14:28:58.695149 INFO Configuration read from: /config/appdaemon/appdaemon.yaml
2018-03-09 14:28:58.932448 INFO Starting Apps
2018-03-09 14:28:59.162526 INFO Got initial state
2018-03-09 14:28:59.165324 INFO Loading Module: /config/appdaemon/apps/hello.py
2018-03-09 14:28:59.168328 INFO Loading Object hello_world using class HelloWorld from module hello
2018-03-09 14:28:59.490447 INFO hello_world: Hello from AppDaemon
2018-03-09 14:28:59.496796 INFO hello_world: You are now ready to run Apps!
2018-03-09 14:28:59.497468 INFO Loading Module: /config/appdaemon/apps/._hello.py
2018-03-09 14:28:59.498729 WARNING ------------------------------------------------------------
2018-03-09 14:28:59.499915 WARNING Unexpected error during loading of ._hello.py:
2018-03-09 14:28:59.501065 WARNING ------------------------------------------------------------
2018-03-09 14:28:59.504422 WARNING Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/appdaemon/appdaemon.py”, line 901, in read_app
conf.modules[module_name] = importlib.import_module(module_name)
File “/usr/lib/python3.6/importlib/init.py”, line 121, in import_module
raise TypeError(msg.format(name))
TypeError: the ‘package’ argument is required to perform a relative import for ‘._hello’
2018-03-09 14:28:59.505002 WARNING ------------------------------------------------------------
2018-03-09 14:28:59.508421 INFO App initialization complete
2018-03-09 14:28:59.510697 INFO Starting dashboard
2018-03-09 14:28:59.525973 INFO API is disabled
2018-03-09 14:28:59.542351 INFO Connected to Home Assistant 0.64.3
2018-03-09 14:29:23.597920 INFO function [get_dashboard] finished in 272 ms
2018-03-09 14:29:23.993959 INFO New dashboard connected: Buero
/usr/lib/python3.6/site-packages/appdaemon/rundash.py:181: RuntimeWarning: coroutine ‘BaseRequest.post’ was never awaited
data = yield from request.post()
Error handling request
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py”, line 381, in start
resp = await self._request_handler(request)
File “/usr/lib/python3.6/site-packages/aiohttp/web_app.py”, line 310, in _handle
resp = await handler(request)
File “/usr/lib/python3.6/asyncio/coroutines.py”, line 213, in coro
res = yield from res
File “/usr/lib/python3.6/site-packages/appdaemon/rundash.py”, line 181, in call_service
data = yield from request.post()
TypeError: cannot ‘yield from’ a coroutine object in a non-coroutine generator
Error handling request
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py”, line 381, in start
resp = await self._request_handler(request)
File “/usr/lib/python3.6/site-packages/aiohttp/web_app.py”, line 310, in _handle
resp = await handler(request)
File “/usr/lib/python3.6/asyncio/coroutines.py”, line 213, in coro
res = yield from res
File “/usr/lib/python3.6/site-packages/appdaemon/rundash.py”, line 181, in call_service
data = yield from request.post()
TypeError: cannot ‘yield from’ a coroutine object in a non-coroutine generator

are you trying to import a file with the name ‘._hello.py’? That’s the root cause of the problem. Remove the ‘.’ and it should be good to go. Unless appdeamon is doing that, then it would need a code change.

there is an outstanding problem with AD2 and the latest HA version (and maybe python 3.6)
andrew is looking at a shortterm solution for it (but he was away)
there are 3 options

  1. wait untill andrew has created an upgrade for AD 2
  2. downgrade HA
  3. upgrade to AD 3 (which is the best option, because it wont be long untill AD 2 will be deprecated)

HI,

there is not file called ‘_hello.py’ I thought that too,

I would like to update to AppDeamon 3 but all I get is the following error message, and I am just not able to find out the reason for it…

ERROR no 'appdaemon' section in /config/appdaemon/appdaemon.yaml 

My appdeaomn.yaml looks like this:

AppDaemon:
  logfile: STDOUT
  errorfile: STDERR
  threads: 10
  app_dir: /config/appdaemon/apps
HASS:
  ha_url: http://url:8123
HADashboard:
  dash_url: http://url:5050
  dash_dir: /config/appdaemon/dashboards

#Apps
hello_world:
  module: hello
  class: HelloWorld 
HADashboard:
  dash_url: http://url:5050

Maybe someone can help.

The error tells you that the above should be appdaemon, the same goes for HADashboard and HASS is now

  plugins:
    HASS:
      type: hass

your configuration is for appdaemon 2
you need to change your configuration to appdaemon 3 if you have appdaemon 3 installed.
here you can read how to configure your appdaemon.yaml:

http://appdaemon.readthedocs.io/en/latest/INSTALL.html

and dont forget that you have to take care off capitals and indention.

Its been a while…

but i just dont get it, from what i understand, as i do have a very simple installation, if i use the default settings, it should at least start

appdaemon:
  threads: 10
  plugins:
    HASS:
      type: hass
      ha_url: <some_url>
      ha_key: <some_key>

I think i really missing something here.

Regards

how do you try to start?
and what errors do you get?

when you dont know where you can find your logging, then set the logs like this:

log:
  accessfile: /the/path/to/your/conf_dir/access.log
  errorfile:  /the/path/to/your/conf_dir/error.log
  logfile:  /the/path/to/your/conf_dir/appdaemon.log

in your conf dir appdaemon sholud have full access anyway, so there shouldnt be conflicts.
you then can start appdaemon in a terminal like:

appdaemon -c /the/path/to/your/conf_dir

10 days later, I am terrible sorry.

Anyway… I try to describe my issue:

I try to start via the hassio add-on menu.
As of today is just updated AppDaemon3 to versionn 1.0.0

I am using the hassio docker installation, so starting by command will not work I guess.

Here ist the error log:

2018-04-01 15:37:10.096326 INFO AppDaemon Version 3.0.0 starting
2018-04-01 15:37:10.096932 INFO Configuration read from: /config/appdaemon/appdaemon.yaml
2018-04-01 15:37:10.099800 INFO AppDaemon: Starting Apps
2018-04-01 15:37:10.106577 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2018-04-01 15:37:10.150349 INFO AppDaemon: HASS: HASS Plugin Initializing
2018-04-01 15:37:10.151685 INFO AppDaemon: HASS: HASS Plugin initialization complete
2018-04-01 15:37:10.152971 INFO Dashboards are disabled
2018-04-01 15:37:10.153463 INFO API is disabled
2018-04-01 15:37:10.171613 INFO AppDaemon: HASS: Connected to Home Assistant 0.65.6
2018-04-01 15:37:10.184777 WARNING AppDaemon: ------------------------------------------------------------
2018-04-01 15:37:10.185318 WARNING AppDaemon: Unexpected error during notify_plugin_started()
2018-04-01 15:37:10.186123 WARNING AppDaemon: ------------------------------------------------------------
2018-04-01 15:37:10.198597 WARNING AppDaemon: Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/appdaemon/appdaemon.py”, line 1245, in notify_plugin_started
meta = await self.plugin_objs[namespace].get_metadata()
File “/usr/lib/python3.6/site-packages/appdaemon/plugins/hass/hassplugin.py”, line 109, in get_metadata
return await self.get_hass_config()
File “/usr/lib/python3.6/site-packages/appdaemon/plugins/hass/hassplugin.py”, line 321, in get_hass_config
r = await self.session.get(apiurl, headers=headers, verify_ssl=self.cert_verify)
File “/usr/lib/python3.6/site-packages/aiohttp/helpers.py”, line 109, in await
ret = yield from self._coro
File “/usr/lib/python3.6/site-packages/aiohttp/client.py”, line 275, in _request
resp = req.send(conn)
File “/usr/lib/python3.6/site-packages/aiohttp/client_reqrep.py”, line 463, in send
writer.write_headers(status_line, self.headers)
File “/usr/lib/python3.6/site-packages/aiohttp/http_writer.py”, line 247, in write_headers
[k + SEP + v + END for k, v in headers.items()])
File “/usr/lib/python3.6/site-packages/aiohttp/http_writer.py”, line 247, in
[k + SEP + v + END for k, v in headers.items()])
TypeError: must be str, not NoneType
2018-04-01 15:37:10.199237 WARNING AppDaemon: ------------------------------------------------------------
Unclosed connection
client_connection: Connection<ConnectionKey(host=‘xxxxx’, port=8123, ssl=False)>
2018-04-01 15:37:12.175035 ERROR AppDaemon: Required attribute not set or obtainable from any plugin: latitude
2018-04-01 15:37:12.175974 ERROR AppDaemon: AppDaemon is terminating
2018-04-01 15:37:12.184157 ERROR AppDaemon: Required attribute not set or obtainable from any plugin: longitude
2018-04-01 15:37:12.185085 ERROR AppDaemon: AppDaemon is terminating
2018-04-01 15:37:12.186127 ERROR AppDaemon: Required attribute not set or obtainable from any plugin: elevation
2018-04-01 15:37:12.187060 ERROR AppDaemon: AppDaemon is terminating
2018-04-01 15:37:12.188223 ERROR AppDaemon: Required attribute not set or obtainable from any plugin: time_zone
2018-04-01 15:37:12.189120 ERROR AppDaemon: AppDaemon is terminating
2018-04-01 15:37:12.192845 INFO AppDaemon: HASS: Disconnecting from Home Assistant
2018-04-01 15:37:12.194581 INFO AppDeamon Exited
2018-04-01 15:37:16.194441 INFO AppDaemon Version 3.0.0 starting
2018-04-01 15:37:16.195191 INFO Configuration read from: /config/appdaemon/appdaemon.yaml

there is a known problem that hass isnt completely started when appdaemon is starting up.
that can be helped by restarting appdaemon at a time you are sure hass is up and running or by setting the
latitude, longtitude, elevation and timezone in the appdaemon.yaml

i also have seen several times that the ha_url must be the one that hassio uses.
something like http://hassio

So,

after checking the url it looks like its starting, but still i can not acces any webui etc.

[services.d] starting services
[services.d] done.
starting version 3.2.4

Thats the last entrys, nothing more, no error etc.
Even after 5 minutes of wait.

The Dashboards are still in the dashboard folder.

I would like to generate the logs, but i am not sure how the path in docker is, i tried some combinations, but always get the error message, that the file is not found.

i think you can use /config/appdaemon as path in your appdaemon.yaml

its obvious that you cannot acces anything. the service didnt start at all.
i hope you didnt use the url i gave you because it was just the start from the needed url.
i dont have hassio so i cant tell you the real url, but if you read in other topic from people that have problems starting AD with hassio you can find the right url.