Git Product home page Git Product logo

teslanotify's Introduction

teslanotify | Receive notifications when car state changes

Simple addon to TeslaMate that uses ntfy.sh to notify when car state changes.

Usage

Environment Variables

Variable  Description Default
DEBUG Outputs more verbose logging if set to 1. 0
NTFY_URL ntfy instance. https://ntfy.sh/
NTFY_TOPIC ntfy topic. You want to change this. teslas
NTFY_MSG Notification message template. This is the message your notification device receives. Car is {{.State}}
MQTT_HOST The host of the TeslaMate MQTT server. moquitto
MQTT_PORT The port of the TeslaMate MQTT server. 1883
TESLA_STATES Comma separated list of states to notify about. Can be charging, driving, suspended, online or offline charging
TESLA_CAR_ID The TeslaMate ID of the car. 1

Setup

To use together with TeslaMate under docker-compose, you can add this to the services section of your docker-compose file. A prebuilt image of this repo is available on Docker Hub.

services:

  teslanotify:
    image: hnesland/teslanotify:latest
    restart: always
    environment:
      - NTFY_TOPIC=secret_tesla_topic
      - TESLA_STATES=charging

Or you can run the binary anywhere you like, it reads configuration from the environment variables like above.

Build the binary with go build -o teslanotify ./cmd/teslanotify and run it like:

export NTFY_TOPIC=secret_tesla_topic
export MQTT_HOST=127.0.0.1
export MQTT_PORT=1883
export TESLA_STATES=charging
export DEBUG=1
./teslanotify

teslanotify's People

Contributors

hnesland avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.