Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

TeslaMate [megathread]

This site may earn commission on affiliate links.
I’ve obviously missed a trick here, how do you make it auto- update? (spot the unix noob!)
So I'm using docker-compose. The first one is something called Watchtower that will look for updates to containers and then pull and update them. It needs access to the docker.sock for this to work. I also have it set to only update them at 4am and only containers where I put a label on them.

Put this in a folder and a file called docker-compose.yml

Code:
version: "3.5"

services:
  watchtower:
    image: v2tec/watchtower
    container_name: watchtower
    restart: always
    network_mode: none
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    command: --label-enable --schedule "0 0 4 * * *" --cleanup
    environment:
      - TZ=Europe/London
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

Now run docker compose up -d

It'll be running but won't do anything yet, the key is you need to add the label "com.centurylinklabs.watchtower.enable=true" to containers you want to automatically update.

I've cut a lot out here but for Teslamate it'll have these bits in it:

Code:
version: "3.5"

services:
  teslamate:
    image: teslamate/teslamate:latest
    container_name: teslamate
    restart: always
    ...
    ...
    ...
    ...
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  database:
    image: postgres:14
    container_name: teslamate-db
    restart: always
    ...
    ...
    ...
    ...
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  grafana:
    image: teslamate/grafana:latest
    container_name: teslamate-grafana
    restart: always
    ...
    ...
    ...
    ...
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  mosquitto:
    image: eclipse-mosquitto:2
    container_name: teslamate-mosquitto
    restart: always
    ...
    ...
    ...
    ...
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

Here's where someone tells me I have it pinned to some old components but I've not touched it for 1.5 years. :)

Or you can just take out --label-enable on the watchtower one and then it will update everything you are running in docker when it sees something new at 4am. I just wanted a bit more control is all.
 
Not sure if it's a blip but tonight the status just went back to asleep again
I just had a look through my Teslamate States history & most of the asleeps are shown as offline. However, there was one a couple of nights ago that was shown as asleep. Looks like a glitch then. It's weird because the Tesla app can tell the difference between asleep & offline, so it's being reported, just not to the public-facing (private) API.