Announcement: HADashboard v2 Beta3!

Need help my Hadashboard stopped working with error -

sudo systemctl status appdaemon.service -l
● appdaemon.service - HA Dashboard
   Loaded: loaded (/etc/systemd/system/appdaemon.service; enabled)
   Active: failed (Result: exit-code) since Sat 2017-06-03 22:03:57 PDT; 4s ago
  Process: 31696 ExecStart=/usr/bin/python3 -m appdaemon.appdaemon -c /home/pi/appdaemon_dashboard/appdaemon/conf -p /home/pi/appd$ (code=exited, status=1/FAILURE)
 Main PID: 31696 (code=exited, status=1/FAILURE)

Jun 03 22:03:57 HaHome python3[31696]: File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
Jun 03 22:03:57 HaHome python3[31696]: File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
Jun 03 22:03:57 HaHome python3[31696]: File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
Jun 03 22:03:57 HaHome python3[31696]: File "<frozen importlib._bootstrap>", line 1129, in _exec
Jun 03 22:03:57 HaHome python3[31696]: File "<frozen importlib._bootstrap>", line 1467, in exec_module
Jun 03 22:03:57 HaHome python3[31696]: File "<frozen importlib._bootstrap>", line 1570, in get_code
Jun 03 22:03:57 HaHome python3[31696]: File "<frozen importlib._bootstrap>", line 656, in _compile_bytecode
Jun 03 22:03:57 HaHome python3[31696]: ValueError: bad marshal data (invalid reference)
Jun 03 22:03:57 HaHome systemd[1]: appdaemon.service: main process exited, code=exited, status=1/FAILURE
Jun 03 22:03:57 HaHome systemd[1]: Unit appdaemon.service entered failed state.

after deleating .pyc file using sudo find . -name *.pyc -delete now i am getting error -

● appdaemon.service - HA Dashboard
   Loaded: loaded (/etc/systemd/system/appdaemon.service; enabled)
   Active: failed (Result: exit-code) since Sat 2017-06-03 22:28:15 PDT; 3min 8s ago
  Process: 550 ExecStart=/usr/bin/python3 -m appdaemon.appdaemon -c /home/pi/appdaemon_dashboard/appdaemon/conf -p /home/pi/appd$ (code=exited, status=1/FAILURE)
 Main PID: 550 (code=exited, status=1/FAILURE)

Jun 03 22:28:15 HaHome python3[550]: exec(code, run_globals)
Jun 03 22:28:15 HaHome python3[550]: File "/home/pi/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 27, in <module>
Jun 03 22:28:15 HaHome python3[550]: import appdaemon.appdash as appdash
Jun 03 22:28:15 HaHome python3[550]: File "/home/pi/appdaemon_dashboard/appdaemon/appdaemon/appdash.py", line 2, in <module>
Jun 03 22:28:15 HaHome python3[550]: from aiohttp import web
Jun 03 22:28:15 HaHome python3[550]: File "/usr/local/lib/python3.4/dist-packages/aiohttp/__init__.py", line 6, in <module>
Jun 03 22:28:15 HaHome python3[550]: from .client import *  # noqa
Jun 03 22:28:15 HaHome python3[550]: TypeError: source code string cannot contain null bytes
Jun 03 22:28:15 HaHome systemd[1]: appdaemon.service: main process exited, code=exited, status=1/FAILURE
Jun 03 22:28:15 HaHome systemd[1]: Unit appdaemon.service entered failed state.

Can someone help me resolve this error, please? It seems to not want to load the ‘hello’ dashboard. I wanted to fix this before attempting to make a dashboard for my HA setup.

The only change I made to appdash.py was this change for rpi by @quadportnick.

Also ‘$ ls -a /usr/src/app’ is empty and none of: /conf/compiled/html/default, /conf/compiled/html, /conf/compiled, and /conf exist.

2017-06-04 01:04:14.064150 INFO AppDaemon Version 2.0.0beta3.5 starting
2017-06-04 01:04:14.064692 DEBUG get_ha_config()
2017-06-04 01:04:19.232728 DEBUG Entering run()
2017-06-04 01:04:19.300221 DEBUG Creating worker threads ...
2017-06-04 01:04:19.301515 DEBUG Done
2017-06-04 01:04:19.302572 DEBUG Done
2017-06-04 01:04:19.303907 DEBUG Done
2017-06-04 01:04:19.304947 DEBUG Done
2017-06-04 01:04:19.305954 DEBUG Done
2017-06-04 01:04:19.306924 DEBUG Done
2017-06-04 01:04:19.307878 DEBUG Done
2017-06-04 01:04:19.308958 DEBUG Done
2017-06-04 01:04:19.309981 DEBUG Done
2017-06-04 01:04:19.311101 DEBUG Done
2017-06-04 01:04:19.311771 DEBUG Calling HA for initial state
2017-06-04 01:04:19.312120 DEBUG Refreshing HA state
2017-06-04 01:04:19.312426 DEBUG get_ha_state: entity is None
2017-06-04 01:04:19.338773 INFO Got initial state
2017-06-04 01:04:19.339282 DEBUG Reading Apps
2017-06-04 01:04:19.339698 INFO App initialization complete
2017-06-04 01:04:19.340001 DEBUG Starting timer thread
2017-06-04 01:04:19.340896 INFO Starting dashboard
2017-06-04 01:04:19.356916 INFO HADashboard Started
2017-06-04 01:04:19.357415 INFO Listening on ('0.0.0.0', 5050)
2017-06-04 01:04:19.369559 INFO Connected to Home Assistant 0.45.1
2017-06-04 01:07:10.841895 INFO Compiling dashboard 'hello'
2017-06-04 01:07:11.283821 WARNING Dashboard 'hello' not found
2017-06-04 01:07:11.284447 INFO function [compile_dash] finished in 460 ms
2017-06-04 01:07:11.285165 WARNING ------------------------------------------------------------
2017-06-04 01:07:11.286302 WARNING Unexpected error in CSS file
2017-06-04 01:07:11.286912 WARNING ------------------------------------------------------------
2017-06-04 01:07:11.289623 WARNING Traceback (most recent call last):
  File "/usr/src/app/appdaemon/appdash.py", line 105, in _load_dash
    with open(include_path, "r") as include_file:
FileNotFoundError: [Errno 2] No such file or directory: '/conf/compiled/html/default/hello_head.html'

Here’s my appdaemon.cfg if it helps

[AppDaemon]
ha_url = http://192.168.1.110:8123
ha_key = xxxxxxxxx
logfile = STDOUT
errorfile = STDERR
app_dir = /home/pi/appdaemon_dashboard/appdaemon/conf/apps
threads = 10
dash_url = http://192.168.1.110:5050
# Apps
[hello_world]
module = hello
class = HelloWorld

Any help is appreciated :slight_smile:

Is there a Hello.dash file in your /appdaemon_dashboard/appdaemon/conf/dashboards/ directory? If so, what are the contents?

Yes sir. Here it is:

#
# Main arguments, all optional
#
title: Hello Panel
widget_dimensions: [120, 120]
widget_margins: [5, 5]
columns: 8

label:
    widget_type: label
    text: Hello World

layout:
    - label(2x2)

I ask because I ran into this same issue during the testing of the newest release with @aimc and my Hello.dash was kinda screwy, but yours is correct.

I’m going to assume at this point that you are trying to load Hello.dash with the default style, so it rules out any custom CSS being at fault.

Can you take a look in the /appdaemon_dashboard/appdaemon/conf/compiled/html/default directory and tell me if you see the files hello_body.html and hello_head.html? Can you load any of the other dashboards that come as example files?

I’m going to assume at this point that you are trying to load Hello.dash with the default style

Correct.

Can you take a look in the /appdaemon_dashboard/appdaemon/conf/compiled/html/default directory and tell me if you see the files hello_body.html and hello_head.html?

I don’t have a ‘compiled’ directory. This is what’s in my conf dir. Searching for those files turns up nothing, also – I tried that even before my first post about this problem.

pi@hassbian:~/appdaemon_dashboard/appdaemon/conf $ ls -al
total 44
drwxr-xr-x 6 pi pi 4096 Jun  2 17:31 .
drwxr-xr-x 7 pi pi 4096 Jun  1 18:05 ..
-rwxr-xr-x 1 pi pi  339 Jun  3 08:57 appdaemon.cfg
-rwxr-xr-x 1 pi pi  188 Jun  1 18:05 appdaemon.cfg.example
drwxr-xr-x 2 pi pi 4096 Jun  1 18:05 apps
drwxr-xr-x 2 pi pi 4096 Jun  1 18:05 dashboards
drwxr-xr-x 3 pi pi 4096 Jun  1 18:05 example_apps
drwxr-xr-x 4 pi pi 4096 Jun  1 18:05 example_dashboards
-rwxr-xr-x 1 pi pi 6563 Jun  1 18:05 examples.cfg
-rw-r--r-- 1 pi pi    5 Jun  1 18:05 .gitignore

I followed all the steps to build that @quadportnick posted here. I see some people use ‘docker run …’ but I can’t because (I suppose) I did ‘docker start …’ – if that’s even relevant.

I don’t know if this has anything to do with it, but when I first started with this a couple days ago it kept failing on this line in Dockerfile:

RUN mkdir -p /usr/src/app

I had to sudo mkdir the src and app dirs for it to continue, but even now that directory (/usr/src/app) seems to always be empty when I check.

Unfortunately, I have no experience with Docker but there are others who follow this thread that do. I am concerned that you don’t have a compiled directory though; I can’t imagine that Docker would be so different that it would put it in another place.

1 Like

I updated to the new HASS and updated the zwave fan component. How will this effect HADashboard?

Tried reinstalling hadashboard but still same error -

Traceback (most recent call last):
  File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/pi/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 27, in <module>
    import appdaemon.appdash as appdash
  File "/home/pi/appdaemon_dashboard/appdaemon/appdaemon/appdash.py", line 2, in <module>
    from aiohttp import web
  File "/usr/local/lib/python3.4/dist-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import *  # noqa
TypeError: source code string cannot contain null bytes

Any ideas

Should have no effect

Not sure - I’m currently on vacation, I’ll have a look when I get back. There may be a version mismatch with AIOHTTP or you may have some corrupted files.

First work, now vacation. We see where we rank in your priorities. LOL Have fun

3 Likes

First wife, then work, then vacation. We are at #4, as it should be. Happy dev, tight code.

4 Likes

When I replace the light prefix with the fan prefix in HASS I get the dashboard error.

I got it working . Uninstalled aiohttp and jinja and installed again. Everything working now :slight_smile:

1 Like

I can try and guess, but a look at the actual error might be quicker :wink:

Also, I’d like to see how you are defining the dashboard.

Were is the default error log located?

Here is the layout that I have for my main dashboard.

layout:
- clock(2x1), weather(2x2), gameroom_temperature(1x1), gameroom_humidity(1x1), joel_presence(1x1), aimee_presence(1x1)
- scene.manual_morning_time, scene.manual_night_time, master_temperature(1x1), master_humidity(1x1), garage(2x1)
- light.livingroom,light.mantle2, light.mantle3, light.kitchen,light.gameroom, light.ge_12730_fan_control_switch_level_23_0,light.linear_wd500z1_wall_dimmer_switch_level_20_0, decorative_lights(1x1)
- climate.hallway_whats_up_fishes, light.ge_12730_fan_control_switch_level_11_0(1x1),garage_light(1x1)
- camera_dash, aimee_workout, joel_workout, reload

This is the error message I get when i change the light to fan.

look in your appdaemon.cfg file. That should specify it.

The only thing i am seeing is

logfile = STDOUT
errorfile = STDERR