HAdashboard in a Python Virtual Environment!!

Pubblicato il: 18 maggio 2018
sul canale di: BurnsHA
2,534
41

This video is a tutorial on how to setup HAdashboard in a Python Virtual environment!

Here is a link to get you started...

http://appdaemon.readthedocs.io/en/la...

For starters, make sure your system is up to date....

sudo apt update
sudo apt upgrade

Next we are ready to setup the python virtual environment....

python -m venv appdaemon
cd appdaemon
source bin/activate
python -m pip install wheel

Now we are ready to install appdaemon...

python3 -m install appdaemon
mkdir conf
cd conf
vi appdaemon.yaml

log:
logfile: /home/adrian/appdaemon/conf/appdaemon.log
errorfile: /home/adrian/appdaemon/conf/aderror.log
appdaemon:
threads: 10
app_dir: /home/adrian/appdaemon/conf/apps
plugins:
HASS:
type: hass
ha_url: http://10.10.10.235:8123
hadashboard:
dash_url: http://10.10.10.235:5050
dash_dir: /home/adrian/appdaemon/conf/dashboards

Once thats done, create a couple of folders referenced in the config file...

mkdir apps
mkdir dashboards

Now we are ready to setup a service file for autoboot.....

sudo vi /etc/systemd/system/appdaemon.service

[Unit]
Description=Appdaemon for HASS
After=network-online.target

[Service]
Type=simple
User=adrian
ExecStart=/home/adrian/appdaemon/bin/appdaemon -D DEBUG -c "/home/adrian/appdaemon/conf"

[Install]
WantedBy=multi-user.target

Save that and enabled the service....

sudo systemctl daemon-reload
sudo systemctl enable appdaemon.service
sudo systemctl start appdaemon.service
sudo systemctl status appdaemon.service

Now we are ready to create a test dashboard.....

cd dashboards
vi main.dash

title: Main
widget_dimensions: [170,180]
widget_margins: [15,15]
columns: 11

clock:
widget_type: clock

switch:
widget_type: switch
entity: switch.hasspower
state_text: 1

reload:
widget_type: reload

layout:
clock(4x2), switch(2x2)
-
-
reload(1x1)

sudo systemctl restart appdaemon.service

You should be good to go now, you can view the new dashboard by going to...

http://IP.OF.APPDAEMON:5050

If you like the video, please subscribe to my channel. If you have any questions or comments, hit me up in the comments below. If there are any videos out there you would like to see that I don't already have out there, let me know in the comments as well and Ill see if I can't get something put together.


In questa pagina del sito puoi guardare il video online HAdashboard in a Python Virtual Environment!! della durata di ore minuti seconda in buona qualità , che l'utente ha caricato BurnsHA 18 maggio 2018, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 2,534 volte e gli è piaciuto 41 spettatori. Buona visione!