TeslaPSModule
Control your Tesla vehicle from PowerShell
Install / Use
/learn @JonnMsft/TeslaPSModuleREADME
NOT CURRENTLY WORKING -- Tesla updated their endpoint and this is not working currently. You are welcome to try to fix if you like.
TeslaPSModule
Control your Tesla vehicle from PowerShell. Watch the demo at https://channel9.msdn.com/Events/PowerShell-Team/PowerShell-10-Year-Anniversary/PowerShell-For-My-Tesla!
Tesla PowerShell Module
This module will enable you to call Tesla commands (like those from http://mytesla.com and your phone app) in a PowerShell script, and automate them in Scheduled Tasks etc. just like Windows services.
- Start your climate control automatically
- Log your physical location over time
- Use your imagination!
Documentation
See the TeslaPSModule wiki for more info on the project.
Installation
This module is available on PowerShell gallery! If you have Windows 10 or WMF 5.0 or other access to PowerShell Gallery, just run "Install-Module Tesla" or visit http://www.powershellgallery.com/packages/Tesla/.
Otherwise, you can install manually as follows:
- Create folder
C:\Users\<username>\Documents\WindowsPowerShell\Modules\Tesla - Copy
Tesla.ps1andTesla.psm1into that directory. - You will only have to call
Connect-Teslaonce (use your email and password as with http://mytesla.com), these will be encrypted and cached in your user profile. - After that you can call
Get-TeslaandSet-Teslaas much as you like.
This is a first release and not all functions are currently supported, although more can easily be added.
Currently supported commands are:
Get-Teslacommands:climate_statecharge_stategui_settingsdrive_statevehicle_statevehicle_configvehicles
Set-Teslacommands:mobile_enabledauto_conditioning_startauto_conditioning_stopdoor_lockdoor_unlocksun_roof_control?state=closesun_roof_control?state=comfortsun_roof_control?state=ventcharge_stopcharge_start
Example Usage
PS> Connect-Tesla
Enter MyTesla.com web site credentials when prompted
PS> Get-Tesla -Command drive_state
shift_state :
speed :
latitude : 47.636793
longitude : -122.134307
heading : 265
gps_as_of : 1432940624
PS> Set-Tesla -Command auto_conditioning_start
Next Steps
The syntax for specific commands could be improved a bit, and this should eventually have proper installer / package manager package.
Fixes, suggestions, improvements etc. are all welcome via the GitHub repository. https://github.com/JonnMsft/TeslaPSModule
