TeslaMate: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
No edit summary
Line 55: Line 55:
= Commands =
= Commands =
<pre>
<pre>
Start docoker-compose up
Start docker-compose up
Stop docoker-compose down
Stop docker-compose down
Update docoker-compose pull
Update docker-compose pull


Logs docker-compose logs teslamate
Logs docker-compose logs teslamate
</pre>
</pre>
= References =
= References =
[https://dev.to/rohansawant/installing-docker-and-docker-compose-on-the-raspberry-pi-in-5-simple-steps-3mgl Docker Install]<br>
[https://dev.to/rohansawant/installing-docker-and-docker-compose-on-the-raspberry-pi-in-5-simple-steps-3mgl Docker Install]<br>

Revision as of 10:37, 15 July 2022

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		docker-compose up
Stop		docker-compose down
Update		docker-compose pull

Logs		docker-compose logs teslamate

References

Docker Install
TeslaMate Install