A personal project for controlling your Tesla vehicle(s) through your Android phone and/or Wear OS smartwatch using the unofficial Tesla API.
This is by no means perfect or optimized, most code was taken from various StackOverflow threads to get to a working state.
The Mobile and Wear OS apps/code are provided "as is" without warranty of any kind, either express or implied. Use at your own risk.
Login with your Tesla credentials or with an Access token. Optionally include your Refresh token to stay logged in past the Access token expiration.
Tesla username/password is not saved. Only the Access and Refresh tokens are stored.
View Vehicle name, Battery charge/range remaining, Indoor/Outdoor temperature, Charging status and time of last data update. The app also dynamically displays car alerts in the app when the data refreshes.
Icons show when these conditions are met:
Vehicle is unlocked
Door(s) is/are open
Frunk is open
Trunk is open
Windows(s) is/are open
Software Update is available
Sentry Mode is on
Climate controls are active
Notifications are not supported at this time
Lock/Unlock
Turn on/off climate
Open frunk/trunk*
Vent/Close windows
Turn on/off sentry mode
Start/Stop charging
Open/Close charge port
Set charge limit (50-100%)
Activate Homelink*
*note: App will display a confirmation message before executing these commands.
Wear OS controls give you a 2.5 second confirmation delay before executing the command.
Add Widgets
Add Shortcuts
Implement permanent notification
Implement Complications
Implement Tile
Implement sync access/refresh token from phone
Add direct commands from app list, like Google fit
Implement Settings:
Custom confirmation time delay
Move from static views to List/Adapters
Set climate for driver/passenger
Show current climate setting
Include STANDARD/MAX in set charge limit dialog
Reset car data when selecting a new car
Gate commands by vehicle config:
Trunk Open/Close, if vehicle_config.plg==true
Start/Stop charge, if charge_state.charging_state!=Disconnected
Open/Close charge port, if vehicle_config.motorized_charge_port==true
Open/Close sunroof, if vehicle_config.sun_roof_installed!=null
TBD
Optimize APKs, drawables and code
Wear: CarSelect take RotaryInput
Wear: Remove dark gray backgrounds
Wear: Enhancements for round/square displays
Mobile: Update UI
Mobile: Change TokenActivity to InfoActivity
Common: Fix parking/charging logic
Common: Update to cleaner Sentry Mode icon
Improve CarSelect activities for mobile and wear
Move CarAlerts from static images/views to a list/adapter
Wear: Reorganize home screen
Mobile: Change Tokenscreen to Car Info screen
Create common code directory for mobile and wear
common: new app icon
common: Move start of data update to onResume()
common: Clear previous vehicle data when new vehicle is selected
mobile: Fix AutoFill
wear: Fix RotaryInput
wear: Reset back to top of home screen on re-open
wear: Properly close LoginSelectorActivity when login is good
Initial implementation