TeslaMate
From KlavoWiki
Docker Install
Assuming running Docker and TeslaMate as user pi.
sudo curl -sSL https://get.docker.com | sh sudo usermod -aG docker pi sudo reboot sudo apt install -y libffi-dev libssl-dev python3 python3-pip sudo pip3 -v install docker-compose
TeslaMate Install
docker-compose -f /home/pi/docker-compose.yml pull
crontab
MAILFROM=no-reply@myemail.com MAILTO=me@myemail.com @reboot sleep 15 && /usr/local/bin/docker-compose up &
Restore
While docker is running.
Erase Existing Database
docker-compose exec -T database psql -U teslamate << . drop schema public cascade; create schema public; create extension cube; create extension earthdistance; CREATE OR REPLACE FUNCTION public.ll_to_earth(float8, float8) RETURNS public.earth LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE AS 'SELECT public.cube(public.cube(public.cube(public.earth()*cos(radians(\$1))*cos(radians(\$2))),public.earth()*cos(radians(\$1))*sin(radians(\$2))),public.earth()*sin(radians(\$1)))::public.earth'; .
Restore Database
docker-compose exec -T database psql -U teslamate -d teslamate < 20220523-1645-teslamate.bck
WEB User Interface
Change setting to IP address and grafa to port 88.
Default username and password for Grafana is admin:admin
Commands
Start docoker-compose up Stop docoker-compose down Update docoker-compose pull Logs docker-compose logs teslamate