Dash app used as web UI for read/analyze electric power consumption stats collected thanks to ⚡ mcce ⚡
- Simple to use with a pretty css style
- Ready for production using nginx + gunicorn
- Refresh data at page reload, querying them from local sqlite3 database
Steps to run repo/project:
-
Clone the repo
git clone https://github.com/andros21/pwrApp.git /opt/MCCE/pwrApp -
Create a python environment with packages needed
python -m venv --system-site-packages .venv source .venv/bin/activate python -m pip install --upgrade requirements/requirements.txt -
Copy systemd service template file inside
/etc/systemd/system/ -
Change file permissions, that must be
-rw-r----- root root -
Configure it, edit them as you need/want
-
Fire up
nginx, install it with your package manager, setup as you likenginx.conf -
Check and edit my base
pwrapp.conf.j2as you need, thensudo cp -v nginx/pwrapp.conf.j2 /etc/nginx/sites-available/pwrapp.conf sudo ln -s /etc/nginx/sites-available/pwrapp.conf /etc/nginx/sites-enable/pwrapp.conf[!WARNING]
Check fornginx.confmistakes usingnginx -c /etc/nginx/nginx.conf -t -
Reload systemd file
sudo systemctl daemon-reload -
Enable and start nginx
sudo systemctl enable --now nginx.service -
Enable and start
pwrApp.servicethat will trigger gunicornsudo systemctl enable --now pwrApp.service -
Check with some
systemctl statusor usingjournalctlif everything went well -
Enjoy your web UI interface 😄 pointing your browser to
http://yourdevicelocalnetipaddress