Skip to content

Latest commit

 

History

History
103 lines (95 loc) · 3.71 KB

README.md

File metadata and controls

103 lines (95 loc) · 3.71 KB

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