About a year ago I mounted my Nexus 7 2012 Wifi in my car, and came up with some Tasker scripts to have my phone automatically start wifi tethering as soon as I turn the key. I’d like to share with you all how I did it, and answer any questions anybody might have.
I made a video to provide a overview of my setup that can be found here. I can't post links yet so you'll have to copy and paste!
Code:
youtu.be (slash) jkDr9mLY568
Hardware
Nexus 7 Wifi 2012 rooted running stock KitKat with Xposed Framework installed.
Nexus 5 rooted running stock KitKat with Xposed. I’ve also tested this with a GNex and G2 and it worked great with both of those.
Previously I ran CM on both my phone and tablet and it worked fine.
Software
Connectivity:
Tasker
Secure Settings (I use Pro, but I don’t think it’s necessary, correct me if I’m wrong)
Tablet Talk
Tasker/Locale Plugin for Tablet Talk
SSID Selector (Tasker plugin)
All these except for SSID Selector need to be installed on both the phone and tablet.
Apps:
AutoVoice - allows you to create your own voice commands and have Tasker parse them.
GMD Gesture Control Create custom multitouch gestures.
Waze
Spotify
Waze and Spotify are the only apps I have in focus 99% of the time. I have Torque installed and it works great, but I rarely use it.
Tasker
Tablet
Profile: Wifi Tether Control
State: Power any
Entry task: Powered On
Wifi Off: This disconnects me from my home network in case I’m using my home wifi
Brightness up if Daytime profile active, turn down otherwise
Tablet Talk Action: Start BT Mode - start Tablet Talk connection to phone, this tells the phone to turn on the hotspot.
Display timeout: 20 min
Wait 4 secs - this gives the phone time to start the hotspot. I’ve found everything works better if there is a pause here.
SSID Selector - only connect to my phones wifi network
Wifi on
Secure Settings: GPS on
Auto-Sync on
Exit task: Unpowered
Stop task if the powered on task is running. This is to prevent a problem I was having where if I turned the car key too slow, it would start this task while the entry task was still running, leaving the car running but the tablet and hotspot off.
Get location and use Pushbullet to send location to phone
Tablet Talk: Disable - this triggers the exit task on the phone that turns the hotspot off
Wifi, GPS, autosync off.
Send intent to close Waze - Waze doesn’t seem to respond well to being killed, so I use an intent to turn it off. If I don’t do this it is a MAJOR battery drain.
Media Utilities Action: Pause - the built in media actions don’t seem to pause Spotify reliably, so I use this plugin
Lock screen and set lockscreen PIN with Secure Settings
Phone
Profile: Car Tethering
Entry task: Start Wifi Tethering
Ringer on
Wifi Tether on
Notify Sound
Exit Task: Stop Wifi Tethering
Wifi Tether Off
Notify Cancel: Tethering on notification
Notify Sound: Tethering off
Wait 5 secs
Turn wifi back on
Notify Cancel
I've attached all the tasks and profiles I use on my tablet. I'll add some explanations for the rest of them later on if anyone is interested. They include things like:
Gathering sunset/sunrise times to automatically adjusting brightness
Switching to Waze if there is no touches detected for x number of seconds
AutoVoice tasks and profiles for searching Spotify, Waze, and Google Maps
I really want to know how to so this
Gathering sunset/sunrise times to automatically adjusting brightness
braddaniels said:
About a year ago I mounted my Nexus 7 2012 Wifi in my car, and came up with some Tasker scripts to have my phone automatically start wifi tethering as soon as I turn the key. I’d like to share with you all how I did it, and answer any questions anybody might have.
Click to expand...
Click to collapse
So I assume your car turns off the charge port (ie: lighter port) when the ignition is off? That certainly makes this sort of thing a little easier, and sounds like your N7 is dedicated to car duties.
I like the idea of switching back to Waze when otherwise idle, I might do that myself. I do all of the rest, including the backlight management using a tiny web service I wrote for myself to get sunrise/sunset times.
My do it on my phone, however, I don't mount the N7 itself. So I use an NFC tag as my "Start car mode" context.
khaytsus said:
So I assume your car turns off the charge port (ie: lighter port) when the ignition is off? That certainly makes this sort of thing a little easier, and sounds like your N7 is dedicated to car duties.
I like the idea of switching back to Waze when otherwise idle, I might do that myself. I do all of the rest, including the backlight management using a tiny web service I wrote for myself to get sunrise/sunset times.
My do it on my phone, however, I don't mount the N7 itself. So I use an NFC tag as my "Start car mode" context.
Click to expand...
Click to collapse
Yes it stays in my car mounted on the dash unless I'm in a bad neighborhood or something. I live in Central Florida, and so far the heat has not been an issue. The battery still works fine even after sitting my dash for a year now. I know that it is a risk though, a friend of mine had a bargain bin Android tablet that blew up in her car a few weeks ago just sitting on the backseat.
Like I mentioned in the video, I just want it to work without thinking about it, I got sick of fumbling with my phone whenever I got into my car, and I didn't use my Nexus 7 that much anyway, so I decided to do this. Yes my lighter ports only work when the ignition is on. I don't think this is necessarily the most ideal way to detect when to turn the car is on though. I'd like for Tasker to implement Bluetooth proximity as a state, that might be useful. I recall seeing it on their todo list, but I'm not holding my breath.
I have an ODBII BT dongle, and I tried using that to detect when the car was on, but I found it to be clumsy and unreliable. I even experimented with the accelerometer to detect the vibration of the car running, but that wouldn't have worked too well.
In case you were wondering about battery drain while it's off, it's negligible. I'm sure if I left it off for a week or so it would probably die, but my 3.1 A charger charges it even with the screen on full brightness. The only time I've had to charge it while the car's not running is when some service doesn't shut down right due to a bug in my Tasker setup. I have had some bad luck with crappy USB cables, so make sure you get the highest quality and shortest length possible to maximize charging.
Thanks
I know this is an old post now, but this is exactly what I've been trying to achieve with my car setup with Note 3 / Galaxy Tab 8.4. Thank you for posting. This should save me a lot of time.
I have bluetooth in my Jeep and will be sending all tablet audio to the Jeep to play. I've had mixed results with it working and with it playing on the tablet so I may need to tweek Bluetooth Auto Connect. If that still wont work well I'll have to AUX cable it.
I just downloaded all your profiles and tasks and will give this a try with my setup. I really like how you have it auto start wifi tethering on the phone and then open Waze. I have an added step of activating Foxfi and then clicking a few boxes before that activates, so I need to figure that one out.
I also installed all your other profiles/tasks, though I don't know what all of them do yet. I'll need to go through them and see which ones apply to how I use my phone. Do you have any of those on your tablet as well, or are the extras just for your phone?
TheBlueDuck said:
I know this is an old post now, but this is exactly what I've been trying to achieve with my car setup with Note 3 / Galaxy Tab 8.4. Thank you for posting. This should save me a lot of time.
I have bluetooth in my Jeep and will be sending all tablet audio to the Jeep to play. I've had mixed results with it working and with it playing on the tablet so I may need to tweek Bluetooth Auto Connect. If that still wont work well I'll have to AUX cable it.
I just downloaded all your profiles and tasks and will give this a try with my setup. I really like how you have it auto start wifi tethering on the phone and then open Waze. I have an added step of activating Foxfi and then clicking a few boxes before that activates, so I need to figure that one out.
I also installed all your other profiles/tasks, though I don't know what all of them do yet. I'll need to go through them and see which ones apply to how I use my phone. Do you have any of those on your tablet as well, or are the extras just for your phone?
Click to expand...
Click to collapse
I didn't post the profiles and tasks from my phone because it should be relatively simple to implement yourself. I would highly recommend you try to build most of these profiles yourself and just use mine as a template. It'll make troubleshooting much easier if something doesn't work right.
Find My Phone
Hi Brad,
Just like to say thank you for sharing... you are streaks ahead in using tasker! I bought tasker about 1 year ago and fooled around with it and got the basic stuff I needed to work just fine. However, now I will be installing a nexus 7 as a fixed in dash carpc... replacing my old actual carpc running windows with centrafuse/riderunner, I will need to automatize pretty much everything as I will not have access to the side buttons.
I have imported your profiles and task and I am tweaking them for my needs. Only thing it complaining about is "Find My Phone", could you give me some pointers, if you can remember.
Thanks again...
Jared.
braddaniels said:
About a year ago I mounted my Nexus 7 2012 Wifi in my car, and came up with some Tasker scripts to have my phone automatically start wifi tethering as soon as I turn the key. I’d like to share with you all how I did it, and answer any questions anybody might have.
I made a video to provide a overview of my setup that can be found here. I can't post links yet so you'll have to copy and paste!
Code:
youtu.be (slash) jkDr9mLY568
Hardware
Nexus 7 Wifi 2012 rooted running stock KitKat with Xposed Framework installed.
Nexus 5 rooted running stock KitKat with Xposed. I’ve also tested this with a GNex and G2 and it worked great with both of those.
Previously I ran CM on both my phone and tablet and it worked fine.
Software
Connectivity:
Tasker
Secure Settings (I use Pro, but I don’t think it’s necessary, correct me if I’m wrong)
Tablet Talk
Tasker/Locale Plugin for Tablet Talk
SSID Selector (Tasker plugin)
All these except for SSID Selector need to be installed on both the phone and tablet.
Apps:
AutoVoice - allows you to create your own voice commands and have Tasker parse them.
GMD Gesture Control Create custom multitouch gestures.
Waze
Spotify
Waze and Spotify are the only apps I have in focus 99% of the time. I have Torque installed and it works great, but I rarely use it.
Tasker
Tablet
Profile: Wifi Tether Control
State: Power any
Entry task: Powered On
Wifi Off: This disconnects me from my home network in case I’m using my home wifi
Brightness up if Daytime profile active, turn down otherwise
Tablet Talk Action: Start BT Mode - start Tablet Talk connection to phone, this tells the phone to turn on the hotspot.
Display timeout: 20 min
Wait 4 secs - this gives the phone time to start the hotspot. I’ve found everything works better if there is a pause here.
SSID Selector - only connect to my phones wifi network
Wifi on
Secure Settings: GPS on
Auto-Sync on
Exit task: Unpowered
Stop task if the powered on task is running. This is to prevent a problem I was having where if I turned the car key too slow, it would start this task while the entry task was still running, leaving the car running but the tablet and hotspot off.
Get location and use Pushbullet to send location to phone
Tablet Talk: Disable - this triggers the exit task on the phone that turns the hotspot off
Wifi, GPS, autosync off.
Send intent to close Waze - Waze doesn’t seem to respond well to being killed, so I use an intent to turn it off. If I don’t do this it is a MAJOR battery drain.
Media Utilities Action: Pause - the built in media actions don’t seem to pause Spotify reliably, so I use this plugin
Lock screen and set lockscreen PIN with Secure Settings
Phone
Profile: Car Tethering
Entry task: Start Wifi Tethering
Ringer on
Wifi Tether on
Notify Sound
Exit Task: Stop Wifi Tethering
Wifi Tether Off
Notify Cancel: Tethering on notification
Notify Sound: Tethering off
Wait 5 secs
Turn wifi back on
Notify Cancel
I've attached all the tasks and profiles I use on my tablet. I'll add some explanations for the rest of them later on if anyone is interested. They include things like:
Gathering sunset/sunrise times to automatically adjusting brightness
Switching to Waze if there is no touches detected for x number of seconds
AutoVoice tasks and profiles for searching Spotify, Waze, and Google Maps
Click to expand...
Click to collapse
Thanks for all the info and stuff. I'll have to check out the GMD and Autovoice apps. I just got a Nexus 7 set up in my car and am loving it so far. I have Tasker helping me out greatly because I too don't want to take my S6 out of my pocket when I'm driving.
My Nexus 7 has "screen always on while charging" enabled in Dev options. I haven't set the fastboot oem off-mode-charge to a zero yet since I don't think I need it to turn off completely, though I will probably do this since I can't reach the power button with a decent amount of effort.
Turn car key, Nexus 7 comes on and turns on wifi (state -> power any = wifi on). This is mostly because it stopped connecting to my S6 tether unless I toggled wifi off and on. I plan on using airplane-mode but haven't set that up yet since it was not available in Tasker (maybe it is in Secure Settings, I hope).
My S6 turns on wifi hotspot when bluetooth connects to "Alpine CD Receiver". I added an Exit task of "wait 5 seconds, then wifi on" to get wifi to enable again since it wasn't automatically.
The Nexus 7 bases some tasks off of the state = wifi connected to S6 tether. Tasks include turning on bluetooth (I need it to connect to Alpine head-unit AFTER the S6 or else the Alpine goes wonky), setting car mode to ON and going home (Car Home Ultra), launching the speed volume app so my volume fluctuates with speed (I don't want to have to touch the Alpine volume knob), and performs the media key operation of "play" to resume whatever music I had playing.
One difference for me is that I want to still use my phone for talking and don't want to do any texting from the car, so I don't use Tablet Talk. Although...texting via voice commands on the tablet would be handy. I will definitely set that up, so thanks for that idea.
It all works pretty well, but I'm only a day or two into doing all of this so I need to tweak stuff still.
Can anyone explain how automatic exit tasks work, like on my S6 - if it loses BT connection for just a second, wifi hotspot turns off, which then triggers the Nexus to perform a bunch of automatic tasks like exiting car mode, turn off bluetooth thus stopping music, etc. It seems to me like Tasker should show you the tasks it will perform when the State is exited. Sure, you can add exit tasks...does adding an exit task cause it to no longer perform its own invisible/assumed exit tasks? I am still a Tasker newb. In fact, this post clued me into the fact that Tasker has exit tasks, haha. I'd like it if it had some threshold so it wouldn't start doing these exit tasks so quickly. Like, maybe a "wait 5 seconds" exit task to see if the State turns on again. I'll do some reading and testing.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
(imgur and google photos links don't work on XDA???)
link
Exit task not running
I was able to get the auto_connect to my hotspot with the waits. :victory: So thank you for the tip. However, I am running into issues of the task running an exit. It just doesn't seem to run when I disconnect from my Bluetooth device. Any ideas?
By the way, I am able to run each individual task and it works
Hey. I'm having a really hard time (5h) now figuring how to trigger the tether or in my phone. My car doesnt habe a bluetooth so i've been trying to trigger the tether with my tablets bluetooth. The problem is that the bluetooth needs to be activates from the settings each time. I tried with bluetooth suto connect addon but couldnt get that work either. I have Samsung s8+ and lenovo tab 4. Someone please help me
since i am such a cheap bastard, i opted not to pay for tasker and ended up doing it with llama and e-robot, except it was for my g2 dedictated to nav duty rather than a nexus 7.
with bt auto connect on the g2and autotether on my main phone (bacon), it is a pretty much a hands free affair as long as i leave bt on on the bacon. presence of charging source and screen on/off are being used as the triggers to toggle airplane mode, bt, gps and the nav app
the only problem is, i get a massive battery drain with this setup. i usually find my phone either fully discharged or almost there when i come back on the next day. did the exact same on my mom's galaxy note 3 and thay one fares much better albeit not great (about -10% overnight). the battery on the g2 was replaced not too long ago. dunno, maybe it is the version of lineageos i am using (14.1 for d802/f320)
Wanna start apps when I'm in my car. When BT is enabled my Profiles work and detect the near devices. If BT is off it seemes Tasker is not scanning for BT at all.
Bug or Feature?
Using latest Tasker on Galaxy S7 edge.
schmil said:
Wanna start apps when I'm in my car. When BT is enabled my Profiles work and detect the near devices. If BT is off it seemes Tasker is not scanning for BT at all.
Bug or Feature?
Using latest Tasker on Galaxy S7 edge.
Click to expand...
Click to collapse
Same here. I'm using RR ROM.
Have you found a solution?
I know this is a year old but I found a bunch of posts like this while looking for the useage of BTNear, so I figured I'd throw it out there for the next guy. It sounds like you didn't select the "Toggle" option. Without it, it will only turn on your Bluetooth the first time and it leaves it on to scan every X amount of seconds. It won't Toggle on, scan for BT device and then toggle off. Would explain why it runs fine at first and then after you turn off Bluetooth when you reach your destination. It either tries to scan with BT off and fails or it breaks the code when BT is mysteriously off and exits. Hope it helps someone.
I've been posting regularly in Google Android Auto forums, but nothing has been happening. I thought maybe someone here would be of more help.
I use Android Auto (just updated again today, version 4.2.591444-release) on my OnePlus 5 (Android 9, OxygenOS Beta 30) with a Bluetooth FM Transmitter in my car. Same setup as I've had for a while (apart from updates to the OS or the app, of course.)
There are three issues here.
1. The hotword doesn't trigger anything to happen. Sometimes it does right after an uninstall/reinstall, but once and only once and only if it's not connected to my FM transmitter via Bluetooth. I have tried uninstall/reinstall, deleting and retraining my voice model, giving AA every permission it asks for. The hotwords trigger with no problem when it's not in AA mode.
2. AA auto triggers Do Not Disturb mode. This means it doesn't give any audible notification for phone calls/texts/hangouts/weather alerts/job notifications. Doesn't matter what the app is, it doesn't trigger. I only know I'm getting a call if I happen to look at my phone. I can go in and manually turn off DND mode, but I have to touch "turn off" twice every time for it to work.
3. It's set to autolaunch when it connects to my FM transmitter. It often doesn't. It pairs to my transmitter with no problem, but doesn't launch. The AA icon is in my notification shade, but when I pull it down, it's saying that it's launching with the little progress bar. I have to actually launch it myself.
All of these issues are new within the last few months. Before all of this, I'd jump in to take kids to school, my phone would autoconnect to my transmitter, and the kids would proceed to ask Google to play their favorite songs. Awesome. Sometimes I'd get a notification that a job was available (I'm a substitute teacher) and I could accept it. Now...none of this happens.
Any thoughts you all have? I've not seen threads here describing this issue, but in Google's forums, it seems to be happening both with head units and the app, no matter what kind of phone/auto combo it is.
I have the same issues (2 & 3) and I'm pissed
I wondered if any of the tasker expers could advise a way around an issue I have.
I have 2 cars, both with bluetooth conected to my Pixel 6.
I also have a Garmin watch connected via bluetooth used for alerts etc.
Since I've started working from home, I have an issue which is drivng me crazy. If my wife goes out or return in either of the cars, but phone will connect to the car outside whilst I'm in the middle of a call.
I could just turn off bluetooth, but then I'd lose connectivity to my watch.
What I really want is the ability to enable/disable individual bluetooth devices based on my location. So if at home, the cars are disabled, if away from home (i.e. driving) they are enabled. However bluetooth seems to be all or nothing.
I could forget the connections, and re-pair whilst out in the car, but thats a pain.
So I wonder if even if tasker cannot disable individual connections, maybe it can change the settings of those connections. If I go into the car setting, I have 3 toggles which can be set off/on. Phone Calls, Media Audio, Contact Sharing.
Is it possible for tasker to change these settings on an individual bluetooth device based on location? So basically, if I'm home, disable phone calls and media audio on my cars.
And if this is possible, what is the best event trigger? Presumably GPS is one way. I also have wifi at home, but dont use it on my phone (4g is quicker and more reliable)
Can tasker scan for wifi networks and use as a trigger without actually connecting to wifi? Are there any other ways of detecting I have left home?
And if Tasker cannot do this, any ideas how to get around this issue outside of tasker?
Thanks in Advance.
When i had my pixel 5, the Bluetooth automatically turned on after a few minutes of driving, i can't find how to do that in pixel 7. Options does not looks to be the same...
How can i do that or what can i use as an alternative?
Android Auto as alternative
That's why i want Bluetooth on, if it's activated android auto will connect directly.
You can probably do it in Tasker, but I am not sure how you would detect you are in the car. Constant GPS checking would be power hungry.
Assuming you have home WiFi, a partial solution would be to turn Bluetooth on when it no longer sees your router. You can even turn it back off when you get home.