HA and HAdashboard in different docker containers

Hi there,

I have home assistant install inside a docker container within a volume, and i have appdaemon with HADashboard installed installed inside another docker container within another volume, now when i run HADashboard it doesn’t recognize the entities, here is my dashboard:

title: Main Panel
widget_dimensions: [120, 120]
widget_size: [1, 1]
widget_margins: [5, 5]
columns: 1
rows: 1
global_parameters:
use_comma: 0
precision: 1
use_hass_icon: 1
namespace: default
devices:
media_player:
step: 5

entrance_bulb:
widget_type: switch
title: Entrance
entity: switch.entrance
icon_on: fas-car
icon_off: fas-car
warn: 1

layout:

  • entrance_bulb (1X1)

and here is the dashboard when loaded

can anyone tell me if this is a permission issue caused by the two being in two different containers??

Thanks

you can install appdaemon anywhere you like.
but first of all, please show YAML always as codeblock, because this is unreadable.

secondly, please always show what is in your logfiles
in this case even more important:
what is in appdaemon.yaml?
what version from appdaemon do you run?
what version from HA do you run?

Hi Rene,
Here is my appdaemon.yaml:

 title: Main Panel
        widget_dimensions: [120, 120] 
        widget_size: [1, 1]
        widget_margins: [5, 5]
        columns: 1
        rows: 1
        global_parameters:
         use_comma: 0
         precision: 1
         use_hass_icon: 1
         namespace: default
         devices:
         media_player:
          step: 5

        entrance_bulb:
         widget_type: switch
         title: Entrance
         entity: switch.entrance
         icon_on: fas-car
         icon_off: fas-car
         warn: 1

        layout:
         - entrance_bulb (1X1)
  • I am running HA 0.83.1
  • and i am not sure which appdaemon version but its the latest version from their docker repository.

here is my logs when i run the dashboard with this layout:

2018-12-02 22:08:41.258553 INFO Compiling dashboard 'main'
2018-12-02 22:08:41.336977 WARNING Unable to find widget definition for 'entrance_bulb(1X1)'
2018-12-02 22:08:41.396261 INFO function [get_dashboard] finished in 137 ms
2018-12-02 22:08:41.600018 INFO HADashboard: New dashboard connected: Main Panel
2018-12-02 22:09:23.333225 INFO HADashboard: Dashboard disconnected
2018-12-02 22:09:23.348644 INFO Compiling dashboard 'main'

and here is the output when the layout is connected directly to the entity:
appdaemon.yaml

 title: Main Panel
        widget_dimensions: [120, 120] 
        widget_size: [1, 1]
        widget_margins: [5, 5]
        columns: 1
        rows: 1
        global_parameters:
         use_comma: 0
         precision: 1
         use_hass_icon: 1
         namespace: default
         devices:
         media_player:
          step: 5

        layout:
         - switch.entrance (1X1)

and the log with this case is :

 2018-12-02 22:09:23.432171 WARNING ------------------------------------------------------------
2018-12-02 22:09:23.432277 WARNING Unexpected error during DASH creation
2018-12-02 22:09:23.432374 WARNING ------------------------------------------------------------
2018-12-02 22:09:23.432806 WARNING Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/appdaemon/dashboard.py", line 818, in get_dashboard
    dash = self._conditional_compile(name, skin, recompile)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/dashboard.py", line 770, in _conditional_compile
    dash = self._get_dash(name, skin, skindir)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/dashboard.py", line 573, in _get_dash
    dash = self._create_dash(name, css_vars)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/dashboard.py", line 455, in _create_dash
    dash, layout, occupied, includes = self._create_sub_dash(name, "dash", 0, {}, [], 1, css_vars, None)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/dashboard.py", line 545, in _create_sub_dash
    self._add_layout(lay, layout, occupied, dash, page, includes, css_vars, global_parameters)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/dashboard.py", line 429, in _add_layout
    widget["parameters"] = self._load_widget(dash, includes, name, css_vars, global_parameters)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/dashboard.py", line 338, in _load_widget
    if widget_type in global_parameters["devices"]:
TypeError: argument of type 'NoneType' is not iterable

2018-12-02 22:09:23.432893 WARNING ------------------------------------------------------------
2018-12-02 22:09:23.432990 INFO function [get_dashboard] finished in 84 ms

and the web page in this case shows “500 Internal Server Error”

you didnt show your appdaemon.yaml but a dashboard.
and the version from appdaemon is at the start from your logs.
please clear your logs and restart appdaemon and show your log from the beginning.
and what you actually got in appdaemon.yaml

Have you actually got appdaemon connected to HA ?

Have you setup the access token correctly ? and the URL’s ?

Did you get the hello world dashboard to work ?

@ReneTode is the man to help you out, but as he said, we need your config / appdaemon.yaml it should look something like,

log:
  logfile: log.log
  errorfile: error.log
appdaemon:
  threads: 10
  plugins:
    HASS:
      type: hass
      ha_url: http://192.168.1.2:8123
      token: xxxxxxxxxxxxxxx
hadashboard:
  dash_url: http://192.168.1.2:5050
  dash_compile_on_start: 1
  dash_force_compile: 1

Hi Rene, sorry for the inconvenient, i thought i attached it, it turned out i copied the same text twice.

Here is my appdaemon.yaml:

log:
  logfile: /usr/src/app/log.log
  errorfile: STDERR
appdaemon:
  disable_apps: 1
  threads: 10
  plugins:
    HASS:
      type: hass
      ha_url: http://192.168.2.5:8123
      token: ******************************************************************************************************************
hadashboard:
  dash_url: http://192.168.2.5:5050
  dash_force_compile: 1

here is my initial log after restarting appdaemon, i am running version 3.0.2

2018-12-03 10:49:27.519418 INFO AppDaemon Version 3.0.2 starting
2018-12-03 10:49:27.519675 INFO Configuration read from: /conf/appdaemon.yaml
2018-12-03 10:49:27.520763 INFO AppDaemon: Starting Apps
2018-12-03 10:49:27.523371 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2018-12-03 10:49:27.567668 INFO AppDaemon: HASS: HASS Plugin Initializing
2018-12-03 10:49:27.567986 INFO AppDaemon: HASS: HASS Plugin initialization complete
2018-12-03 10:49:27.568155 INFO Starting Dashboards
2018-12-03 10:49:27.571917 INFO API is disabled
2018-12-03 10:49:27.576331 INFO AppDaemon: HASS: Connected to Home Assistant 0.83.1
2018-12-03 10:49:27.585223 INFO AppDaemon: Got initial state from namespace default
2018-12-03 10:49:29.631239 INFO AppDaemon: Reading config
2018-12-03 10:49:29.632753 INFO AppDaemon: /conf/apps/apps.yaml added or modified
2018-12-03 10:49:29.632885 INFO AppDaemon: /conf/apps/apps.yaml added or modified
2018-12-03 10:49:29.633003 INFO AppDaemon: App 'hello_world' added
2018-12-03 10:49:29.633168 INFO AppDaemon: Adding /conf/apps to module import path
2018-12-03 10:49:29.633434 INFO AppDaemon: Loading App Module: /conf/apps/hello.py
2018-12-03 10:49:29.640721 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2018-12-03 10:49:29.709013 INFO hello_world: Hello from AppDaemon
2018-12-03 10:49:29.709839 INFO hello_world: You are now ready to run Apps!
2018-12-03 10:49:29.710309 INFO AppDaemon: App initialization complete

yes yes, the authentication and token is running correctly i think, i just attached the logs and my appdaemon.yaml, counting on @ReneTode to help me out :slight_smile:

your yaml and logs look ok to me, but I am no expert, sure Rene will advise more.

But looking back, I think the spacing in your layout might be the problem. Its the only thing I can see different to my setup,

layout:
    - weather(3x2),clock(4x1)

Try removing the space’s, or remove the brackets all together to just test if it works,

    layout:
     - switch.entrance

Hi Cee,

the spacing was he issue, here is my dashboard now :

title: Main Panel
widget_dimensions: [120, 120] 
widget_size: [1, 1]
widget_margins: [5, 5]
columns: 1
rows: 1
global_parameters:
 use_comma: 0
 precision: 1
 use_hass_icon: 1
 namespace: default
 devices:
 media_player:
  step: 5

entrance_bulb:
 widget_type: switch
 title: Entrance
 entity: switch.entrance
 icon_on: fas-car
 icon_off: fas-car
 warn: 1

layout:
  -switch.entrance(1x1)

the dashboard loads now (i no longer get the 500 Internal server error) but still i got no widget as you can see below, and for some reason got 7 of them now.

You didn’t copy my code correctly, you are still missing a space on the layout.

layout:
  - switch.entrance(1x1)

That will fix it.

hi Cee, i did try it with the space like this :

title: Main Panel
widget_dimensions: [120, 120] 
widget_size: [1, 1]
widget_margins: [5, 5]
columns: 1
rows: 1
global_parameters:
 use_comma: 0
 precision: 1
 use_hass_icon: 1
 namespace: default
 devices:
 media_player:
  step: 5

entrance_bulb:
 widget_type: switch
 title: Entrance
 entity: switch.entrance
 icon_on: fas-car
 icon_off: fas-car
 warn: 1

layout:
  - switch.entrance(1x1)

and i ended up with the server error

image

server in trouble means your yaml isnt correct is almost all cases.

did you copy paste?
if so, lots of editors pick up stuff that shouldnt be in yaml, but you cant see it.
delete all white space (enter, spaces, tabs) and type spaces on the place where needed yourself.
delete also all whitespace at the end from the file. (and show if you dont have whitespace behind your texts)

and this part is wrong:

 devices:
 media_player:
  step: 5

devices is empty, because media_player isnt indented

title: Main Panel
widget_dimensions: [120, 120] 
widget_margins: [5, 5]
columns: 10


layout:
  - switch.entrance

Copy that and try it in a dash.yaml or something, it worked for me.

Thanks so much @Cee and @ReneTode, it was a spacing issue, and it was because of the devices category, once i deleted it, it worked for me :slight_smile:

Thanks alot guys.

I will be updating this dashboard very soon.

2 Likes

thanks for helping out @Cee

2 Likes

Only fair to pass on the knowledge you installed on me :wink:

2 Likes