Notifications overview

Notifications help

Everything needed to get the Notifier running next to your TeslaMate, and what to check when an event does not arrive.

Before you start

Three things, and most TeslaMate installs already have the first two.

  • TeslaMate with an MQTT broker. Mosquitto ships with the default TeslaMate Compose file.
  • Docker on the same machine as TeslaMate, or any host that can reach the broker.
  • Outbound internet access. No inbound port, and your TeslaMate does not have to be public.

Install the Notifier

Your TeslaMate has no way to reach your phone on its own, and an iOS notification can only arrive through Apple. The Notifier is the small container that watches MQTT and hands events over. It sits next to TeslaMate and never opens a port.

  1. Get your token in the app

    Open HedgieMate, go to Settings, then Push Notifications, and turn notifications on. The app shows a linking token starting with hm_ and a server ID for the TeslaMate server you are connected to. Copy both.

    The token pairs the app with the container. Treat it like a password.

  2. Add the container to your Compose file

    Open the docker-compose.yml you run TeslaMate from and add the service below. Keeping it in the same file means it shares a network with your broker, so MQTT_HOST is just the broker service name.

    docker-compose.yml
    # add under services: in the docker-compose.yml you run TeslaMate from
      hedgiemate-notifier:
        image: hedgiemate/notifier:latest
        restart: unless-stopped
        depends_on:
          - mosquitto
        environment:
          HEDGIEMATE_USER_TOKEN: "hm_your_token_here"
          SERVER_ID: "your-server-uuid"
          MQTT_HOST: "mosquitto"
          MQTT_PORT: "1883"
          CAR_IDS: "1"
          LOG_LEVEL: "info"
        volumes:
          - hedgiemate-notifier-data:/data
    
    # and under the top-level volumes: key, adding it if the file has none
      hedgiemate-notifier-data:

    The volume is optional. It caches car names across a restart; without it the relay fills the name in anyway. Use a named volume rather than a bind mount: the container runs as a non-root user and cannot write to a host directory Docker created as root.

  3. Start it

    Bring the new service up. Nothing else in your stack has to restart.

    Terminal
    docker compose up -d hedgiemate-notifier

    Then read the logs. A healthy start prints the broker connection and the car IDs it is watching.

    Terminal
    docker compose logs -f hedgiemate-notifier
  4. Confirm in the app

    The app marks the server as connected within a few seconds. From there you can switch individual events on or off, per car.

    Nothing arrives until the car actually changes state. Plugging in is the quickest way to see the first event.

Without Compose

If TeslaMate is not managed by Compose, docker run does the same job. Point MQTT_HOST at a host the container can reach.

Terminal
docker run -d \
  --name hedgiemate-notifier \
  --restart unless-stopped \
  -e HEDGIEMATE_USER_TOKEN="hm_your_token_here" \
  -e SERVER_ID="your-server-uuid" \
  -e MQTT_HOST="your-mqtt-host" \
  -e CAR_IDS="1" \
  hedgiemate/notifier:latest

More than one TeslaMate

Run one Notifier next to each server. The same linking token works everywhere. The server ID is what keeps them apart in the app.

Configuration

Everything is set through environment variables. Three are required, the rest have working defaults.

Variable Default Description
HEDGIEMATE_USER_TOKEN required none Linking token from the app. Starts with hm_.
MQTT_HOST required none Hostname of your MQTT broker. Inside Compose this is the service name, usually mosquitto.
SERVER_ID required none Server UUID from the app. The container starts without it, but per-server and per-car settings made in the app are then ignored.
MQTT_PORT 1883 Broker port.
MQTT_USERNAME none Broker username, if yours requires authentication.
MQTT_PASSWORD none Broker password.
MQTT_CLIENT_ID hedgiemate-notifier Client ID used on the broker. Change it if something else already connects under this one.
MQTT_TLS false Set to true for a TLS broker. The default port then moves to 8883.
MQTT_NAMESPACE none Match your TeslaMate MQTT_NAMESPACE if you set one. Topics become teslamate<namespace>/cars/#.
CAR_IDS 1 Comma separated car IDs to watch, for example 1,2. Each car gets its own state machine.
LOG_LEVEL info debug, info, warn or error.
RELAY_URL https://push.hedgiemate.com Relay endpoint. There is no reason to change this.

Every event

Each row is an independent switch per car in the app. Live Activity updates are not notifications and are not listed here.

Notification Sent when
Driving
Drive Started state → driving
Drive Ended state leaves driving
Charging
Charging Started charging_state → Charging
Charging Completed charging_state → Complete
Charging Interrupted charging_state leaves Charging without Complete
Plugged In plugged_in → true
Unplugged plugged_in → false
Battery
Battery Low battery_level ≤ BATTERY_LOW_THRESHOLD
Battery Target Reached battery_level ≥ BATTERY_HIGH_THRESHOLD
Location
Geofence Entered geofence set
Geofence Exited geofence cleared or changed
Security
Sentry Recording center_display_state = 7
Vehicle
Software Update update_available → true
Falling Asleep state → asleep pending
Asleep state → asleep
Woke Up state leaves asleep

Nothing arrives

Work down the list. Most cases are one of the first three.

The app still says the server is not connected

Check the container is actually running with docker compose ps, then read its logs. A wrong MQTT_HOST is the usual cause: inside Compose it is the broker service name, mosquitto, not localhost.

The container runs, but no event ever fires

CAR_IDS has to match the car ID TeslaMate uses. TeslaMate numbers cars from 1, and with several cars you list them: CAR_IDS=1,2.

MQTT connects and the log stays quiet

If you set MQTT_NAMESPACE in TeslaMate, set the same value on the Notifier. Without it the topic names do not match and the container sits there with nothing to read.

Some events arrive, others never do

Every event is a switch per car in the app. Open the server in Settings and check the event list for that car.

Battery notifications never fire

BATTERY_LOW_THRESHOLD and BATTERY_HIGH_THRESHOLD default to 20 and 90. They fire once per charging session, so a car that never crossed the line since it started charging will not send one.

Notifications stop after a few days

Make sure the service has restart: unless-stopped so it comes back with the host. Then check iOS: a Focus mode or the app's notification settings can be swallowing them.

Live Activities do not show up

Live Activities have to be allowed for HedgieMate in iOS Settings, and there has to be an active session. The Dynamic Island needs iPhone 14 Pro or later.

The broker needs a login or TLS

Set MQTT_USERNAME and MQTT_PASSWORD. For TLS set MQTT_TLS to true, which moves the default port to 8883.

You need to see what it is doing

Set LOG_LEVEL to debug, reproduce the case, then set it back. Debug prints every MQTT message and every decision made from it.

Questions

Why do I need the Notifier at all?

Your TeslaMate lives on your own server and has no way to reach your phone, and an iOS notification can only be delivered by Apple. The Notifier is the piece that closes that gap: it watches your MQTT topics, spots the state change, and posts the event out to be delivered.

Does my TeslaMate have to be reachable from the internet?

No. The Notifier only makes outbound connections, so nothing has to be exposed and no port has to be forwarded for notifications to work.

What actually leaves my server?

The event type, battery level, charging state and the geofence name if you use geofences. Coordinates and driving routes stay on your TeslaMate, and your server address is never sent. Event data is deleted after a few hours.

Can it run on a different machine than TeslaMate?

Yes, as long as it can reach your MQTT broker. Set MQTT_HOST to that host and make sure the broker port is reachable from it.

Does it work with several cars?

Yes. List the IDs in CAR_IDS and each car gets its own state tracking and its own switches in the app.

What happens if the relay is unreachable?

The container retries a few times with a growing delay and then drops that event. It keeps running and picks up the next state change normally.

Does it store anything?

Only a cache of car names, and only if you mount the optional volume. Everything else is held in memory for as long as the container runs.

How do I update it?

Pull the image again and recreate the service. Release notes are on the GitHub releases page.

How do I turn notifications off?

Switch them off in the app, or stop the container. Both work on their own, and nothing else in your TeslaMate stack depends on it.

Source code

The Notifier is MIT licensed Go. Read it, or open an issue if something is off.

LukStankovic/hedgiemate-notifier

Docker image hedgiemate/notifier:latest Docker Hub

Need Help?

Having trouble with setup? We're here to help you get started.