TMC is an independent, primarily volunteer organization that relies on ad revenue to cover its operating costs. Please consider whitelisting TMC on your ad blocker and becoming a Supporting Member. For more info: Support TMC

Improved Android/Android Wear car control

Discussion in 'Model S: User Interface' started by Footbag, Jan 19, 2016.

  1. Footbag

    Footbag Member

    Jun 29, 2013
    Edmonton, Canada
    Last weekend I played around with improving the experience of controlling the car with my android phone and hopefully my android wear watch. My main pain point is quickly turning on the climate control to the car. The darn android app often needs to be started twice, and even when it works, it takes a good while (I'm impatient!) before it finishes loading and is ready for input.

    I am far from a programmer, so whatever I came up with would have to rely on tools I found/had available to me. I'm sure a more elegant solution could be made, but I think what I have is actually pretty effective. If nothing else, I hope it gives others in my position some ideas. I'd love to hear feedback/suggestions to improve things even more.

    I have a windows PC on 24/7 (it is where visibletesla lives, although VT is not part of my system). A colleague at work actually brought to my attention the Tesla Powershell tools (JonnMsft/TeslaPSModule: Control your Tesla vehicle from PowerShell). That provides an assortment of controls and info about the car, and is the mechanism my system utilizes to talk to the car.

    I already had Outlook running on the PC, so I decided to use its rule engine to act as the trigger/interface to the Tesla powershell commands.

    The above is only part of the puzzle, I still need to deal with the android/android wear side of the equation. For that I relied on Tasker, a tool I already had (although I use it minimally), and a few plugins I found. First, I needed a way to send out emails without user intervention. For that I ended up with Locale SendSilentMail Plug-in. It will send an email that Outlook will pick up, with a specific subject line, so Outlook knows what action to perform.

    This would be everything needed on the Android side, but I still wanted to try to involve my watch with this process. Thus, I acquired another plugin, AutoWear.

    So... I can invoke AutoWear either by a twist of the wrist (hands free) or by swiping in from the left. If hands free, I can then say "tesla on", "tesla off", "where's my car" to have climate control turn on or off, or in the case of the last one, honk the horn and flash the lights. Sometimes voice recognition isn't ideal, so I have the swiping method as well, which brings up some basic buttons on the screen that do turn climate on/off, or if one is held for a few seconds (to reduce accidental activation), act as the 'where's my car' voice command. I could replace the basic buttons with a graphic/background image, but my AutoWear seems a little picky and didn't like the first/only graphic I tried so far. AutoWear then passes those 'words'/requests to Tasker, which then uses that SendSilentMail plugin to send the required email message outbound for Outlook to pick up.

    I also created shortcuts to the specific Tasker profiles on my phones main screen, allowing super quick one tap access to those functions. While the watch stuff was cool, and I'm happy it works, I think I'll use my phone most often.

    Outlook uses basic rule parsing (keying in on subject line) to run a command and then delete the email (no need to clutter my inbox once the email has done its job). At the moment, I have kept it simple, and have 3 rules, one each for climate on, climate off, and 'wheres my car' aka horn honk/flash lights. Those simply run a basic cmd file that starts powershell with the required commands (where's my car issues both commands separately, horn and flash lights). One difficulty I had here was the need to bypass the powershell executionpolicy, as Outlook would run the commands in a different 'session' than my normal user (where I have already set my execution policy). Easy to fix, but took me a little bit to figure out why powershell was failing when called by Outlook.

    The net improvement for me is that rather than it taking ~15 seconds to get into the Tesla app (when it works first try) and issue a command, in just 3 seconds, I can have my phone unlocked and press the button to do what I want, and about 10 seconds later it has reached the car. I save ~12 seconds. Is it a big deal? Not really. But it sure is a nice little improvement. And given how often I turn climate control on in my car, I'll be using this several times a day. Better yet, I can do it with people watching, and not have to deal with the frustration of killing and relaunching the android app, which isn't the best 'first impression' to give strangers about the car.

    If there is interest, I can go into a bit more detail about each step. Tasker has been a bit flaky with AutoWear (working with my watch)... once it works, it works perfectly from then on, but i've had to reboot/kill tasker/wish on a falling star to get it to 'like' each profile initially. And then tweaking a profile 'resets' whether tasker likes it, so yet again get to jump thru hoops to make it happy (this has nothing to do with the profile being correct, tasker just seems to have issues deciding to 'start' a profile when launched from AutoWear). Again, once it likes it once, it works perfectly until a change is made, so at least it works consistently, unlike the Tesla app. None of that impacts the use just on the phone, that part is perfect.

    I initially toyed with using TeslaMS and its restla webserver. I decided against it, as having a webserver running (that could open the sunroof) seemed like a bit of a risk. Cool tool nonetheless.

    I'm sure other email clients could be swapped in for Outlook, just so long as they can run a program as part of a filter. There are also little utilities that do this sort of thing.

    My first attempt at the android side was actually to use IFTTT's DO button app. It also gave one button access (once a shortcut was made), but wasn't going to help on the watch front.

    I'm now 'less' annoyed when I see the great third party iOS apps that run on iPhones and Apple Watches (but those are certainly prettier, and have more functions).
  2. green1

    green1 Active Member

    Mar 25, 2014
    Calgary, Alberta, Canada
    Great work, and my kind of kludge :)

    I don't have a windows box on 24/7, but I do have a linux web-server that is, so I'm still working on getting Restla working the way I want, I just haven't had the time to play with it much. I'll have android wear in a few months too I suspect, so then I'll want it even more.

    I agree it's frustrating seeing all the development resources (both Tesla, and 3rd party) go to the minority phone OS instead of the one with massive market share.

Share This Page