Skip to content
A prototype of a simple MagicMirror module for the Tesla
JavaScript
Branch: master
Clone or download
Jan Henrik Gundelsby
Jan Henrik Gundelsby User-Agent added
Latest commit 3f6705d Oct 7, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
MMM-Tesla.js First commit Feb 22, 2018
README.md Updated docs Oct 7, 2018
node_helper.js User-Agent added Oct 7, 2018
package.json Added dependency to specific simple-oauth2-version Oct 7, 2018

README.md

Module: MMM-Tesla (early prototype)

The MMM-Tesla module is a MagicMirror addon. This module displays some of your Tesla's data on your Mirror.

This is just an early prototype, supporting one vehicle only - displaying the location of the car, charge state, driving state and battery level in percentage. It can be easily expanded with more attributes, the API is rich! It uses the unofficial Tesla JSON API from https://timdorr.docs.apiary.io

alt Preview

Installing the module

run git clone https://github.com/janhenrik/MMM-Tesla.git from inside your MagicMirror/modules folder. Then run npm install to install dependencies.

Using the module

To use this module, add it to the modules array in the config/config.js file:

modules: [
		{
			module: 'MMM-Tesla',
			position: 'bottom_right',	// This can be any of the regions.
									// Best results in one of the side regions like: top_left
			config: {
				// See 'Configuration options' for more information.
				email: 'nn@example.com', 
				password: "XXXXXX",
				client_id: 'XXXXX',
				client_secret: 'XXXXXX',
				vehicle_id: 'XXXXX',
				google_api_key: 'XXXXX',
				refreshInterval: 1000 * 60 * 10 // 60 minutes
			}
		}
]

Configuration options

The following properties can be configured:

Option Description
email Your tesla.com email adress, matching the owner's login information for https://my.teslamotors.com/user/login.

Example: elon@tesla.com
This value is REQUIRED
password Your tesla.com password, matching the owner's login information for https://my.teslamotors.com/user/login.

Example: password
This value is REQUIRED
client_id The current client_id is available here.

Example: abc
This value is REQUIRED
client_secret The current client_secret is available here.

Example: abc
This value is REQUIRED
vehicle_id The vehicle_id can be found calling https://owner-api.teslamotors.com/api/1/vehicles with e.g. curl with an OAuth-token attached. Documentation here. Or simply install the excellent teslams command line client and run teslacmd vehicles... and get the vehicle_id from there.

Example: abc
This value is REQUIRED
google_api_key You will need a Google API key, can be generated here.

Example: abc
This value is REQUIRED
refreshInterval How often this refreshes

Example: 60000
I'm not stressing the service, so once an hour is default.
Default value: 600000
You can’t perform that action at this time.