Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register
  • We just completed a significant update, but we still have some fixes and adjustments to make, so please bear with us for the time being. Cheers!

App Idea, could API be used?

I'd like to have some programmable notification if the car is not plugged in. For instance, if at 11:00 PM the car isn't plugged in send an email, text message, push notification, etc to me.

Don't tell me I'm the only one that needs to plug in nightly and forgets at least once a week. Actually I have to plug in every other night, but I still like to plug in every night just to be safe. It irritates me to no end when I walk outside and see it unplugged.....
 

ACDriveMotor

Member
Aug 11, 2013
891
26
Seattle, WA
I think this seems like it could be relatively straightforward with the API. I don't have a car (yet) or I would write the app to try it. When my car arrives I expect I will want the same app.
 

brianman

Burrito Founder
Nov 10, 2011
17,515
2,980
I think this seems like it could be relatively straightforward with the API. I don't have a car (yet) or I would write the app to try it. When my car arrives I expect I will want the same app.
When/if Tesla opens offers a "limited credentials" authentication model, people like me will consider writing apps like this.

Until then, I'm not publishing any Tesla apps because I don't want to be involved in (potentially) credentials drama.
 

jpasqua

P19325
Feb 19, 2013
696
4
I'd like to have some programmable notification if the car is not plugged in. For instance, if at 11:00 PM the car isn't plugged in send an email, text message, push notification, etc to me.

Don't tell me I'm the only one that needs to plug in nightly and forgets at least once a week. Actually I have to plug in every other night, but I still like to plug in every night just to be safe. It irritates me to no end when I walk outside and see it unplugged.....

Yes, this can be done through the API. It is easy to probe the car at a given time and determine whether it is plugged in. Someone was just asking me to add this feature to VisibleTesla. You can do it for yourself right now using one of the existing client libraries, curl, or teslams. Take a look at the REST API thread and the wiki section on APIs and apps.
 

jak

Member
Apr 20, 2013
47
25
California
This could be done with rest api, crontab and mailx very easily on a mac / linux box.

I was thinking the same thing. A simple Perl/Python script to make a REST call. Heck, you can probably do this with a curl call and shove it into a cronjob. Or if you're a Windows user, you can use the Windows scheduler or download the free version of System Scheduler from Splinterware to do this.

Unfortunately, I don't have a Model S yet... hopefully within a couple weeks.
 

brianman

Burrito Founder
Nov 10, 2011
17,515
2,980
I was hoping there might a relatively simple way I could use the API and run it on my server :(
Sorry, perhaps we have different usages of the word "apps". When I use this word with software, I think of packaged products available for sale (at a physical store, online store, etc.) not product source code that you build by yourself.
 

hans

P631
Sep 27, 2012
1,132
13
Menlo Park
Using teslacmd (from the TeslaMS tools) the following Unix/Linux/Mac command line returns 1 if the car is disconnected and 0 if it is not.

Code:
teslacmd -c | grep Disconnected | wc -l

You should be able to add this into a shell script that sends an email

Code:
#!/bin/bash
SUBJECT="Charge Status"
EMAIL="[email protected]"
BODY="/tmp/emailmessage.txt"


if [ `teslacmd -c | grep Disconnected | wc -l` == 1 ] 
  then
      echo "Your Tesla is Disconnected"> $BODY
      /usr/bin/mail -s "$SUBJECT" "$EMAIL" < $BODY
  else
    echo "Connected"
fi
 
Last edited:

About Us

Formed in 2006, Tesla Motors Club (TMC) was the first independent online Tesla community. Today it remains the largest and most dynamic community of Tesla enthusiasts. Learn more.

Do you value your experience at TMC? Consider becoming a Supporting Member of Tesla Motors Club. As a thank you for your contribution, you'll get nearly no ads in the Community and Groups sections. Additional perks are available depending on the level of contribution. Please visit the Account Upgrades page for more details.


SUPPORT TMC
Top