I have currently TeslaMate running on a Raspberry Pi 4 Model B 4GB together with a Samsung T5 SSD with 500GB. I use TeslaMate simultaneously with TeslaFi for our family Tesla Model 3 (still 6 months of subscription to TeslaFi left so that I have time to see whether I like TeslaMate as its replacement or not). TeslaMate is running next to Domoticz and HomeBridge, so there is still a good portion of capacity available on the Raspberry Pi.
I have now ordered also a Tesla Model 3 to replace my current ICE company car, and would like to add it to TeslaMate on the same Raspberry Pi. So this Tesla Model 3 will have another Tesla account. From what I read this is possible, but it would require a second instance of TeslaMate and Grafana to run on the Pi. It is possible to use same Postgres instance but with a separate database, and use the same MQQT broker.
But how to implement this on my Raspberry Pi is one way or the other a mystery to me. I tried to ask my big friend Google, but I can not find a (understandable) How-to. Can anybody share how to do this or point me to a webpage describing this step-by-step?
Thank you in advance for your help!
My docker-compose.yml file is stored in my /home/pi folder, and the content is standard as can be seen below:
version: "3"
services:
teslamate:
image: teslamate/teslamate:latest
restart: always
environment:
- DATABASE_USER=teslamate
- DATABASE_PASS=secret
- DATABASE_NAME=teslamate
- DATABASE_HOST=database
- MQTT_HOST=mosquitto
ports:
- 4000:4000
volumes:
- ./import:/opt/app/import
cap_drop:
- all
database:
image: postgres:13
restart: always
environment:
- POSTGRES_USER=teslamate
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=teslamate
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=database
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:
When I run "docker volume inspect pi_teslamate-db" to get info about the TeslaMate database, I get following (when this information is needed):
[
{
"CreatedAt": "2021-02-11T20:12:48+01:00",
"Driver": "local",
"Labels": {
"com.docker.compose.project": "pi",
"com.docker.compose.version": "1.27.4",
"com.docker.compose.volume": "teslamate-db"
},
"Mountpoint": "/var/lib/docker/volumes/pi_teslamate-db/_data",
"Name": "pi_teslamate-db",
"Options": null,
"Scope": "local"
}
]