Preheat the car in the morning if it is cold outside, or switch on Sentry mode when leaving the car in the parking lot at work. Or create a notification if you forgot to connect the car to the charger if the battery level is low.
With ‘Automatic’ mode you can charge with the lowest utility prices in the selected charge period.
Go to app store to install the Tesla Smart Charger app.
To be able to use the app, a refresh token must be created. Download the “Auth app for Tesla” for iOS, or the “Tesla Tokens” app for Android. After you have authenticated in the mobile app, copy the “Refresh Token” and use that when adding the Tesla to Homey.
Install:
To install:
- Add the Tesla device.
- Add a flow to adjust the ‘Charge start’, ‘Charge end’ and ‘Max. charge hours in period’, or update directly in ‘Advanced settings’.
- Go to ‘Advanced settings’ and set the ‘Utility price settings’: ‘Price area’, and ‘Currency’.
Device: Tesla
Triggers
- Charging started (token: battery (%))
- Charging stopped (tokens: battery (%), meter_power (kWh), complete (boolean))
- The vehicle state changed (token: vehicle_state)
- Charge plan created (token: charge_plan)
- Homelink nearby (tokens: latitude, longitude)
- Shift state changed (token: shift_state)
- Vehicle left home (token: distance_from_home)
- Vehicle came home (token: distance_from_home)
- Vehicle left location (tokens: name, latitude, longitude)
- Vehicle entered location (tokens: name, latitude, longitude)
- Vehicle started moving (tokens: latitude, longitude)
- Vehicle stopped moving (tokens: latitude, longitude)
- Software update is available (token: version)
Conditions
- Is plugged in
- Is charge port open
- Is charging
- Is Homelink nearby
- Is locked
- Is Sentry Mode on
- Is aircondition on
- Is home
- Is moving
- Is shift state (P, D, R, N)
- Is at location (Location)
- Is software update available
- Is user present
Actions
- Set charge mode (Off, Automatic, Manual, Charge now)
- Set period for charging (Start charging, Stop charging, Max. charge hours in period)
- Set ‘Data fetch interval’ (Data fetch interval)
- Set ‘Data fetch enabled’ (Data fetch enabled)
- Charge port door (Close, Open)
- Charging (Off, On)
- Set charge limit mode (Standard, Max range)
- Set charge limit % (limit)
- Set charging current
- Aircondition (Off, On)
- Aircondition temperature (temperature)
- Seat heating
- Steering wheel heating
- Lock / unlock doors (Lock, Unlock)
- Actuate trunk (Front, Rear)
- Set Sentry Mode (Off, On)
- Reset power meter
- Add current location to geofence (Name)
- Add location to geofence (Name, Longitude, Latitude)
- Delete location from geofence (Location)
- Navigate to (Address, Google Maps url)
- Activate Homelink device
- Activate speed limit
- Deactivate speed limit
- Clear speed limit pin
- Schedule software update
- Cancel software update
- Honk horn
- Flash light
Capabilities
- Charge mode (off, automatic, manual_std, charge_now)
- Charging state (Disconnected, Stopped, Charging, Complete)
- Charging rate (km/h)
- Battery range (km)
- Measure battery (%)
- Battery ideal range (km)
- Planned charge (km)
- Time to full charge (h)
- Charge limit (%)
- Measure power (W)
- Meter power (kWh)
- Measure temperature (inside C)
- Measure temperature (outside C)
- Speed (km/h)
- Shift state (P, D, R, N)
- Odometer (km)
- Locked (true/false)
- Vehicle state (online, asleep)
- Location (address)
- Distance from home (m)
- Longitude (lon)
- Latitude (lat)
- Software version
Modes
Mode: Off
Will not handle any charging, but charging can be controlled by flows.
Mode: Charge now
Will start charging instantly. After the charging is complete, or the charger is unplugged, the mode will switch automatically to ‘Off’.
Mode: Manual
Will handle charging in the ‘charge period’, but does not require utility prices.
Mode: Automatic
Will handle charging in the ‘charge period’, and will charge when utility prices are low. To charge when the prices are low, just a few of all the hours in the period must be used for charging. So to get the lowest prices, it is better to charge the car every night.
Details about triggers (when):
Charging started / stopped
Will trigger when the app sees that charging has started or stopped, and not just charging started or stopped by this app.
The vehicle state changed
Trigged when the app sees that the vehicle state (Online, Offline, Asleep) has changed.
Charge plan created (automatic mode)
For ‘Automatic’ mode, the ‘Charge plan created’ will trigger when a new charge plan is created. The charge plan is created when the app sees that the vehicle is home, the charger is plugged in, and utility prices for today and tomorrow have been fetched.
The charge plan is available as a token, with information about ‘km to be charged’, ‘sum charge hours’, ‘cost reduction in percentage’ and ‘hours for charging with prices’.
The cost reduction is calculated as the difference between ‘Automatic’ and ‘Manual’ modes in percentage, i.e. how much you save by using the automatic mode compared to manual mode. NB! Fees and grid costs are not taken into consideration here. Just the utility price.
Details about actions (then):
Add current location to geofence
The current location of the Tesla will be added to a list of locations.
The ‘Vehicle entered location’ and ‘Vehicle left location’ triggers can be used to trigger when the car enters and leaves the location.
The ‘Is at location’ condition can be used to check if a specific location is close to the current location.
A maximum of 20 locations can be added.
Navigate to (Address, Google Maps url)
To start navigation, both an address and a Google Maps URL must be provided.
Example:
Address: Rigtersbleek-Zandvoort 10, 7521 BE Enschede, Nederland
Google Maps URL: Google Maps
Details about Advanced settings:
Charge start and end
The period of the day for charging.
Charge hours per period (automatic mode)
To get the lowest prices, it is better to charge often, with a low number of charge hours per day.
Example
- Set the charge period to 22:00 in the evening, to 06:30 in the morning, for a maximum of 8.5 hours during the night.
- Charge 5 of the 8.5 hours when the prices are lowest, so set the ‘Charge hours per period’ to 5.
Charge rate (km/h) (automatic mode)
The charge rate is used for calculating the necessary hours for charging, and is updated once each day.
Price area (automatic mode)
Price area for utility prices.
- Austria: AT
- Belgium: BE
- Denmark: DK1, DK2
- Estonia: EE
- Finland: FI
- France: FR
- Germany and Luxembourg: DE-LU
- Latvia: LV
- Lithuania: LT
- Netherlands: NL
- Norway: Oslo, Kr.sand, Bergen, Molde, Tr.heim, Tromsø
- Sweden: SE1, SE2, SE3, SE4
Currency (automatic mode)
Currency for utility prices.
Data fetch interval (minutes)
Fetching data will wake up the vehicle, and it will stay awake for 10 minutes before going to sleep again. So a low fetch interval will lead to higher battery loss, i.e. vampire drain.
The default value for the fetch interval is 60 minutes, so the vehicle will be awake 10 minutes and asleep 50 minutes every hour.
When the vehicle is charging or driving, the state of the vehicle is checked every minute.
The value of the fetch interval will affect the latency of the triggers that respond to the state of the vehicle.
Data fetch enabled
Uncheck ‘Data fetch enabled’ to disable fetching data, ref. ‘Data fetch interval’.
Location accuracy
Radius in meters for checking if home or at a location.
Minimum refresh interval when streaming
To avoid a too high load on the Homey when streaming, there is a minimum refresh interval. The default is 10 seconds.
Details about Maintenance Actions:
To repair go to device settings → Maintenance Actions, and click the Repair - button.
Disclaimer:
Use at your own risk. I accept no responsibility for any damages caused by using this app.
Release Notes:
1.5.3
- Fix for chargeplan date/time format
1.5.2
- Fix for fetching prices
1.5.1
- Utility prices for more countries
1.5.0
- Added action to set charging current
- Upgraded to SDK3
1.4.1
- Fix for software update trigger
- Fix for charging stopped trigger
1.4.0
- Switched to refresh token for authentication
1.3.3
- Icon for Model Y
1.3.2
- Fixed titles for flows
1.3.1
- Fixed issue with authentication
1.3.0
- Added support for Homelink
- Added support for ideal battery range