Problem with HADashboard - 500 Internal Server Error

Hi,
I Reviewed the YAML code inside a .dash file several times, but I can not discover the next problem:

# 500 Internal Server Error
Server got itself in trouble

This is the log file from AppDaemon add-on:

2019-11-27 17:25:02.019251 INFO Compiling dashboard ‘Erika_dash’
2019-11-27 17:25:02.115934 WARNING ------------------------------------------------------------
2019-11-27 17:25:02.116090 WARNING Unexpected error during DASH creation
2019-11-27 17:25:02.116167 WARNING ------------------------------------------------------------
2019-11-27 17:25:02.116712 WARNING Traceback (most recent call last):

  • File “/usr/lib/python3.7/site-packages/appdaemon/dashboard.py”, line 818, in get_dashboard*
  • dash = self._conditional_compile(name, skin, recompile)*
  • File “/usr/lib/python3.7/site-packages/appdaemon/dashboard.py”, line 770, in _conditional_compile*
  • dash = self._get_dash(name, skin, skindir)*
  • File “/usr/lib/python3.7/site-packages/appdaemon/dashboard.py”, line 573, in _get_dash*
  • dash = self._create_dash(name, css_vars)*
  • File “/usr/lib/python3.7/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/lib/python3.7/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/lib/python3.7/site-packages/appdaemon/dashboard.py”, line 429, in _add_layout*
  • widget[“parameters”] = self._load_widget(dash, includes, name, css_vars, global_parameters)*
  • File “/usr/lib/python3.7/site-packages/appdaemon/dashboard.py”, line 312, in _load_widget*
  • yaml_file, templates = self._do_subs(yaml_path, instantiated_widget, ‘""’)*
  • File “/usr/lib/python3.7/site-packages/appdaemon/dashboard.py”, line 225, in _do_subs*
  • line = line.replace(match, _vars[ikey])*
    TypeError: replace() argument 2 must be str, not bool
    2019-11-27 17:25:02.116799 WARNING ------------------------------------------------------------
    2019-11-27 17:25:02.116924 INFO function [get_dashboard] finished in 100 ms
    Error handling request
    Traceback (most recent call last):
  • File “/usr/lib/python3.7/site-packages/aiohttp/web_protocol.py”, line 416, in start*
  • resp = yield from self._request_handler(request)*
  • File “/usr/lib/python3.7/site-packages/aiohttp/web.py”, line 325, in _handle*
  • resp = yield from handler(request)*
  • File “/usr/lib/python3.7/site-packages/aiohttp/web_middlewares.py”, line 93, in impl*
  • return (yield from handler(request))*
  • File “/usr/lib/python3.7/site-packages/appdaemon/rundash.py”, line 51, in wrapper*
  • return await myfunc(args)
  • File “/usr/lib/python3.7/site-packages/appdaemon/rundash.py”, line 269, in load_dash*
  • return web.Response(text=response, content_type=“text/html”)*
  • File “/usr/lib/python3.7/site-packages/aiohttp/web_response.py”, line 471, in init*
  • type(text))*
    TypeError: text argument must be str (<class ‘dict’>)

and this is the code of my .dash file (located in: config/appdaemon/dashboards)

title: Control del Hogar
widget_dimensions: [120, 120]
widget_margins: [5, 5]
columns: 12
global_parameters:
  use_comma: 1
  precision: 1
  use_hass_icon: 1

clock:
    widget_type: clock
    date_format_country: "es-CO"
    date_format_options:
      weekday: "long"
      day: "numeric"
      month: "short"
    show_seconds: 0
    time_style: "color: yellow; font-size: 40pt; font-weight: bold;"
    date_style: "font-size: 16pt; font-weight: bold;"

tira_led_salatv_label:
    widget_type: label
    title: Luz Indirecta 
    title2: Sala de TV

tira_led_salatv_on:
    widget_type: switch
    title: ON
    entity: switch.on_tira_led_sala_de_tv
    warn: 1
    icon_on: mdi-led-on
    icon_off: mdi-led-on
    
tira_led_salatv_off:
    widget_type: switch
    title: OFF
    entity: switch.off_tira_led_sala_de_tv
    warn: 1
    icon_on: mdi-led-variant-off
    icon_off: mdi-led-variant-off

tira_led_salatv_mas:
    widget_type: switch
    entity: switch.mas_tira_led_sala_de_tv
    warn: 1
    icon_on: mdi-plus
    icon_off: mdi-plus
    
tira_led_salatv_menos:
    widget_type: switch
    entity: switch.menos_tira_led_sala_de_tv
    warn: 1
    icon_on: mdi-minus
    icon_off: mdi-minus

tira_led_salacomedor_label:
    widget_type: label
    title: Luz Indirecta
    title2: Sala-comedor
    
tira_led_salacomedor_on:
    widget_type: switch
    title: ON
    entity: switch.salir_deco_sala
    warn: 1
    icon_on: mdi-led-on
    icon_off: mdi-led-on
    
tira_led_salacomedor_off:
    widget_type: switch
    title: OFF
    entity: switch.salir_tv_estudio
    warn: 1
    icon_on: mdi-led-variant-off
    icon_off: mdi-led-variant-off

tira_led_salacomedor_mas:
    widget_type: switch
    entity: switch.silenciar_deco_sala
    warn: 1
    icon_on: mdi-plus
    icon_off: mdi-plus
    
tira_led_salacomedor_menos:
    widget_type: switch
    entity: switch.siete_deco_sala
    warn: 1
    icon_on: mdi-minus
    icon_off: mdi-minus

lamp_erika:
    widget_type: switch
    title: Lámpara Erika
    entity: switch.toma_lampara_erika
    warn: 1
    icon_on: mdi-lamp
    icon_off: mdi-lamp

lamp_jj:
    widget_type: switch
    title: Lámpara Juan José
    entity: switch.toma_lampara_juan_jose
    warn: 1
    icon_on: mdi-lamp
    icon_off: mdi-lamp

toma_mini:
    widget_type: switch
    title: Toma Google Mini-Cocina
    entity: switch.toma_mini_cocina
    warn: 1
    icon_on: mdi-power-socket-us
    icon_off: mdi-power-socket-us

toma_kasa:
    widget_type: switch
    title: Toma Centro Multimedia-Sala de TV
    entity: switch.switch_kasa
    warn: 1
    icon_on: mdi-power-socket-us
    icon_off: mdi-power-socket-us

alarma:
    widget_type: alarm
    entity: alarm_control_panel.alarm
      
layout:
  - clock(3x3), tira_led_salacomedor_label(3x1), tira_led_salatv_label(3x1), alarma(3x3)
  - tira_led_salacomedor_on, tira_led_salacomedor_off, tira_led_salatv_on, tira_led_salatv_off
  - tira_led_salacomedor_mas, tira_led_salacomedor_menos, tira_led_salatv_mas, tira_led_salatv_menos
  - toma_mini(3x2), toma_kasa(3x2), lamp_erika(3x2), lamp_jj(3x2)

Can someone help me to discover the cause of this error? Thanks.

Note: I reviewed the permissions inside the appdaemon folder and everything looks ok.

I found the problem: I have to change the title of the widgets with “ON” and “OFF” for another thing like “ENCENDIDO” y “APAGADO” and voilá. It’s working now.

1 Like