GithubHelp home page GithubHelp logo

storm1er / tesla_ble_mqtt_docker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tesla-local-control/tesla_ble_mqtt_docker

0.0 0.0 0.0 125 KB

License: Apache License 2.0

Shell 90.65% Dockerfile 9.35%

tesla_ble_mqtt_docker's Introduction

Tesla BLE MQTT Docker

Send commands via MQTT to a Tesla car using Bluetooth Low Energy (BLE). https://github.com/iainbullock/tesla_ble_mqtt_docker

If Home Assistant (HA) is already using the MQTT integration, then the various entities will be auto-discovered by HA

The advantage of the MQTT setup is that it can run on a device separate to your HA server, e.g. Raspberry Pi located close to where you park your car

Buy Me A Coffee

Contributions

I'm seeing a lot of interest already. Please submit PRs against the dev branch

Installation and setup

TODO, but here's a start. Read this alongside Shankar's blog https://shankarkumarasamy.blog/2024/01/28/tesla-developer-api-guide-ble-key-pair-auth-and-vehicle-commands-part-3

  • You must already have a working MQTT broker. If you want the entities to be auto-discovered by Home Assistant (HA), then the HA MQTT Integration must already be set up and working. It is out of scope of this project to support the setup of this; it is well documented elsewhere

  • I also assume you already have Docker working on the host device, and you are familiar with basic Docker concepts and actions

  • Build the docker image using the Dockerfile. Alternatively you can get the image directly from Dockerhub https://hub.docker.com/r/iainbullock/tesla_ble_mqtt

  • Make any required changes required to suit your setup in docker-compose.yml, in particular the environment variables will need changing according to your requirements

  • Deploy the stack. View the container logs whilst working on the next steps, as this gives some feedback as to what is going on

  • On your HA instance, navigate to the Integrations page, and click on the MQTT Integration tile. A new device called Tesla_BLE_MQTT should have automatically appeared. Click it to view the the associated entities. You should find a list of Button entities and a Number entity

  • If this is the first time you have run the container, press the 'Generate Keys' button. This will generate the public and private keys as per Shankar's blog

  • Wake up your car using the Tesla App. Then press the 'Deploy Key' button. This will deploy the public key to the car. You will then need to access your car and use a Key Card to accept the public key into the car (see the blog for screenshots)

  • Press the other button entities to send various commands, or change the Charging Current. You can use the relevant service calls in HA automations if you wish

  • Note the car has to be awake for this to work, I can't get it to wake via BLE. You must either use the Tesla App, the Tesla HA Integration, or turn on charging power to wake the car

Credits

I got the idea for this from Raphael Murray as described here alandtse/tesla#961 (comment)

The technical method was derived from Shankar Kumarasamy's blog https://shankarkumarasamy.blog/2024/01/28/tesla-developer-api-guide-ble-key-pair-auth-and-vehicle-commands-part-3

tesla_ble_mqtt_docker's People

Contributors

iainbullock avatar mrblj 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.