Skip to content

Commit

Permalink
Various small docs improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
gundalow authored and adriankumpf committed Dec 2, 2019
1 parent 940eeb6 commit d8982a3
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 95 deletions.
72 changes: 4 additions & 68 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,80 +48,16 @@ A powerful, self-hosted data logger for your Tesla.

## Quick Start

The recommended way to install and run TeslaMate is to use [Docker](https://dev.to/rohansawant/installing-docker-and-docker-compose-on-the-raspberry-pi-in-5-simple-steps-3mgl). Create a file called `docker-compose.yml` with the following content:

**docker-compose.yml**

```YAML
version: '3'

services:
teslamate:
image: teslamate/teslamate:latest
restart: always
environment:
- DATABASE_USER=teslamate
- DATABASE_PASS=secret
- DATABASE_NAME=teslamate
- DATABASE_HOST=db
- MQTT_HOST=mosquitto
ports:
- 4000:4000
cap_drop:
- all

db:
image: postgres:11
restart: always
environment:
- POSTGRES_USER=teslamate
- POSTGRES_PASSWORD=secret
volumes:
- teslamate-db:/var/lib/postgresql/data

grafana:
image: teslamate/grafana:latest
restart: always
environment:
- DATABASE_USER=teslamate
- DATABASE_PASS=secret
- DATABASE_NAME=teslamate
- DATABASE_HOST=db
ports:
- 3000:3000
volumes:
- teslamate-grafana-data:/var/lib/grafana

mosquitto:
image: eclipse-mosquitto:1.6
restart: always
ports:
- 1883:1883
volumes:
- mosquitto-conf:/mosquitto/config
- mosquitto-data:/mosquitto/data

volumes:
teslamate-db:
teslamate-grafana-data:
mosquitto-conf:
mosquitto-data:
```
Afterwards start the stack with `docker-compose up`.

To sign in with your Tesla Account open the web interface at [http://your-ip-address:4000](http://localhost:4000).

The Grafana dashboards are available at [http://your-ip-address:3000](http://localhost:3000).
See [Docker (local install)](docs/installation/docker.md)

## Documentation

The TeslaMate documentation is available [here](docs/README.md).

- [Installation](docs/README.md#installation)
- [Docker (recommended)](docs/installation/docker.md)
- [Docker (advanced)](docs/installation/docker_advanced.md)
- [Manual Installation on Debian/Ubuntu](docs/installation/debian.md)
- [Docker](installation/docker.md) (simplified, recommended)
- [Docker (advanced)](installation/docker_advanced.md) (Reverse Proxy, Let's Encrypt Certificate, HTTP Basic Auth)
- [Debian/Ubuntu](installation/debian.md) (without Docker)
- [Upgrading to a new version](docs/upgrading.md)
- [Configuration](docs/README.md#configuration)
- [Environment Variables](docs/configuration/environment_variables.md)
Expand Down
6 changes: 3 additions & 3 deletions docs/configuration/guides/tasker.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Please note that in the following examples, we will be specifying a URL to call
There are two key ways that this can be achieved:

- Use a VPN solution such as Wireguard or [OpenVPN](https://github.com/adriankumpf/teslamate/issues/102#issuecomment-531497214)
- Make your TeslaMate instance publicly available (see [Advanved Docker Setup](../../installation/docker_advanced.md) for an example).
- Make your TeslaMate instance publicly available (see [Advanced Docker Setup](../../installation/docker_advanced.md) for an example).

<img align="right" src="../../images/tasker-http.png" />

Expand Down Expand Up @@ -93,7 +93,7 @@ Provide the following details:

### Creating a Profile

Now that the action to trigger the connection to TeslaMate has been created, we create a profile which will trigger the action in the event that a bluetooth connection is established to a Tesla vehicle.
Now that the action to trigger the connection to TeslaMate has been created, we create a profile which will trigger the action in the event that a Bluetooth connection is established to a Tesla vehicle.

- Select the **Profiles** tab in Tasker.
- Click on the Plus (+) sign in the bottom-right corner of the screen.
Expand Down Expand Up @@ -121,7 +121,7 @@ This step is optional, however it may improve the battery efficiency of your veh
- Name the task **TeslaMateSuspend**.
- Select the checkmark to confirm adding the new task.

- Select the same action that you selected for the intial resume task, and change the suspend in the URL to resume.
- Select the same action that you selected for the initial resume task, and change the suspend in the URL to resume.

### Create an exit task for the Bluetooth profile

Expand Down
4 changes: 2 additions & 2 deletions docs/configuration/sleep.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ If you are specifying the local (LAN) IP address/port of your TeslaMate instance
For these reasons, it is necessary to use a method that allows external communication between your smartphone and your TeslaMate instance. There are two key ways that this can be achieved:

- Use a VPN solution such as Wireguard or OpenVPN.
- Make your TeslaMate instance publicly available (see [Advanved Docker Setup](../installation/docker_advanced.md) for an example).
- Make your TeslaMate instance publicly available (see [Advanced Docker Setup](../installation/docker_advanced.md) for an example).

#### Android

Expand Down Expand Up @@ -83,7 +83,7 @@ In addition to Bluetooth hints, which would address most use cases, it is also p
- _automations.yaml_

```YAML
- alias: Wake Teslamate on Garage Open
- alias: Wake TeslaMate on Garage Open
initial_state: on
trigger:
- platform: state
Expand Down
2 changes: 1 addition & 1 deletion docs/installation/debian.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ $TESLAMATEPATH/_build/prod/rel/teslamate/bin/teslamate start
Add the following to /etc/rc.local, to start a screen session at boot time and run the TeslaMate server within a screen session. This lets you interactively connect to the session if needed.

```bash
# Start Teslamate
# Start TeslaMate
cd /usr/src/teslamate
screen -S teslamate -L -dm bash -c "cd /usr/src/teslamate; ./start.sh; exec sh"
```
Expand Down
21 changes: 19 additions & 2 deletions docs/installation/docker.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Installation with Docker

This setup doesn't use SSL (HTTPS) it's recommended only if you are running TeslaMate on your home network, as otherwise your Tesla credentials might be at risk.

## Requirements

* Docker
* A Machine that's always on, so TeslaMate can continually fetch data
* External internet access, to talk to tesla.com

If you are new to Docker, see [Docker on Raspberry Pi](https://dev.to/rohansawant/installing-docker-and-docker-compose-on-the-raspberry-pi-in-5-simple-steps-3mgl)

## Setup

The recommended way to install and run TeslaMate is to use Docker. Create a file called `docker-compose.yml` with the following content:

**docker-compose.yml**
Expand Down Expand Up @@ -60,8 +72,13 @@ volumes:
mosquitto-data:
```
## Start Docker
Afterwards start the stack with `docker-compose up`.

To sign in with your Tesla Account open the web interface at [http://your-ip-address:4000](http://localhost:4000).

The Grafana dashboards are available at [http://your-ip-address:3000](http://localhost:3000).
## Usage

1) Open the web interface [http://your-ip-address:4000](http://localhost:4000)
2) Sign in with your Tesla Account open the web interface
3) The Grafana dashboards are available at [http://your-ip-address:3000](http://localhost:3000).
39 changes: 28 additions & 11 deletions docs/installation/docker_advanced.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Advanved Docker Setup
# Advanced Docker Setup

_Credit goes to @Helmi for creating this setup_

**What is different from the basic setup:**
## What is different from the basic setup

- everything sits behind a reverse proxy (Traefik) that terminates HTTPS traffic
- custom configuration was moved into a separate _.env_ file
- all publicly accessible services use fully qualified domain name and automatically acquire a Let's Encrypt certificate
- Web services (`teslamate` and `grafana`) sits behind a reverse proxy (Traefik) which terminates HTTPS traffic
- Custom configuration was moved into a separate `.env` file
- All publicly accessible services use fully qualified domain name and automatically acquire a Let's Encrypt certificate

## Requirements

* Docker running on a machine that's always on
* Two FQDN (`teslamate.example.com` & `grafana.example.com`)
* External internet access, to talk to tesla.com

## Quick Start

Expand Down Expand Up @@ -125,27 +131,38 @@ TM_DB_NAME=teslamate
GRAFANA_USER=admin
GRAFANA_PW=admin

FQDN_GRAFANA=your.host.for.grafana.com
FQDN_TM=your.host.for.teslamate.com
FQDN_GRAFANA=grafana.example.com
FQDN_TM=teslamate.example.com

TM_TZ=Europe/Berlin

LETSENCRYPT_EMAIL=yourperson@lemail.com
LETSENCRYPT_EMAIL=yourperson@example.com
```

### .htpasswd

This file contains a user and password for accessing TeslaMate. You can generate it on the web if you don't have the apache tools installed (e.g. http://www.htaccesstools.com/htpasswd-generator/).
This file contains a user and password for accessing TeslaMate (Basic-auth), note this is NOT your tesla.com password. You can generate it on the web if you don't have the Apache tools installed (e.g. http://www.htaccesstools.com/htpasswd-generator/).

**Example:**

```
teslamate:$apr1$0hau3aWq$yzNEh.ABwZBAIEYZ6WfbH/
```

## Start Docker

Afterwards start the stack with `docker-compose up`.

## Usage

1) Open the web interface [https://tesla.example.com](https://tesla.example.com)
2) Sign in with your Tesla Account open the web interface
3) The Grafana dashboards are available at [https://grafana.example.com](https://grafana.example.com).


## Tips for upgrading from the recommended docker setup

If you are upgrading and want to keep your EXISTING DATA:

- Make sure to setup your _.env_ file so the login/password are exactly what you used in your recommended setup (e.g. `teslamate/secret`)
- If you have difficulty logging into your Grafana i.e. you cannot login with the credentials from either the original recommended setup or the values stored in the _.env_ file reset the admin password with the following command: `docker-compose exec grafana grafana-cli admin reset-admin-password`
- Make sure to setup your `.env` file so the login/password are exactly what you used in your recommended setup (e.g. `teslamate/secret`)
- If you have difficulty logging into your Grafana i.e. you cannot login with the credentials from either the original recommended setup or the values stored in the `.env` file reset the admin password with the following command: `docker-compose exec grafana grafana-cli admin reset-admin-password`
4 changes: 2 additions & 2 deletions docs/integrations/home_assistant.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# HomeAssistant Integration

## Introducton
## Introduction

Whilst HomeAssistant provides an official component for Tesla vehicles, the component has not been updated recently, and does not have the sophistication of TeslaMate's polling mechanism, resulting in the component's default values keeping the vehicle awake and draining the battery.

The ultimate goal of this guide is to consume as much of the TeslaMate polling data as possible to replace the majority of the official Tesla component's polling functionality.

If your intention is to only use read-only sensor values, those provided by TeslaMate via MQTT are sufficient, and you do not need to utilise the official Tesla component. If however you would like to be able to write values to the Tesla API (Lock/Unlock Doors or automate Climate), there is a solution which involves configuring an extremely high polling interval for the Tesla component and using automation to populate the values from the TeslaMate MQTT parameters.

## Screenshot
## Screenshots

![HASS Screenshot](../images/hass-dashboard.png)

Expand Down
18 changes: 12 additions & 6 deletions docs/upgrading.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
# Upgrading to a new version

> Check out the [Changelog](/CHANGELOG.md) before upgrading!
## Docker Containers

Pull the new images and restart the stack:
1. Check out the [Changelog](/CHANGELOG.md) before upgrading!

2. Ensure your credentials are correct in `docker-compose.yml` (or `.env` if you are using [Docker (advanced)](docs/installation/docker_advanced.md))

3. Pull the new images and restart the stack:

```bash
docker-compose pull

docker-compose up
```

3. Log in and check

## Manual Installation

1. Pull the new changes from the git repository, checkout the new version and then build the new release:
1. Check out the [Changelog](/CHANGELOG.md) before upgrading!

2. Pull the new changes from the git repository, checkout the new version and then build the new release:

```bash
git pull
Expand All @@ -26,10 +32,10 @@ docker-compose up
MIX_ENV=prod mix release
```

2. Most upgrades requires to run new database migrations. If so continue with the following command:
3. Most upgrades requires to run new database migrations. If so continue with the following command:

```bash
_build/prod/rel/teslamate/bin/teslamate eval "TeslaMate.Release.migrate"
```

3. Finally, re-import the dashboards.
4. Finally, re-import the dashboards.

0 comments on commit d8982a3

Please sign in to comment.