Simple, low power automated tracking of your device location using Tasker
Important - Before Use
Use of your own location Profiles (which may include similar contexts) will confuse or cause undesirable results. Please backup disable/delete any similar contextual Profiles/Projects of your own during use… including previous versions of this project.
Network Location - automated tracking of your device location using Tasker
Network Location provides simple, low power tracking of your device location using Tasker.
Automatically gathering and maintaining a current and updated database of WiFi network and mobile cell interactions enabling you to quickly and easily automate your devices while connected to or within range of your many network locations.
You can track connectable WiFi networks or even nearby networks that you would never connect to. The project has the ability to seamlessly manage multiple overlapping WiFi networks switching between connections while always knowing where you are all automatically with no interaction.
The project automates the process of knowing your devices location allowing you to concentrate on the actions to be taken while arriving or departing each of your known network locations.
Key Features
- Supports an unlimited number of WiFi networks.
- Provides an interface to add or remove known networks.
- Automates network hopping between several access points at the same location.
- User configurable settings such as debug logging and network detection parameters.
- Notifications when entering or exiting a known network (optional).
- Kid App ready, include your network tasks and export as a standalone network automation app.
- Create your own actions, set variables, define locations, toggle settings within a single task.
Easy to use
Once downloaded import the 'Network Location' Project into Tasker. Using the back key exit Tasker to save your changes. The project will now automatically begin tracking your networks with no further interaction required.
You can create project compatible 'mywifi' task(s) and perform your own custom actions when entering or exiting each of your respective networks. See 'Understanding your 'mywifi' Task Structure'.
Network Location Updates
Updating from an older version of the Network Location project?
To update - open Tasker, delete the current Network Location project (do not exit) next import the new update and finally exit Tasker using the back key. Updating this way will retain your data.
Latest Release
Network Location v7 beta 1
Tasker 5.7+ required.
Update to increase OS compatibility of the Network Location project while also making use of Taskers more recent advancements and Androids new features.
What's new:
Android 9.0 (Pie) compatibility.
- Updated 'screen on' action when using "Device wake display=true/false".
- Improved log descriptions.
- Network Location notification system reconfigured.
- Log warnings for Android 9+ when WiFi scanning is unavailable.
- Missed scan warnings.
Changes:
- Configured network checks only when WiFi is on.
- Notification icons changed to material design.
Bug fixes:
- Fixed, on occasion an unset schedule could cause scanning to produce an error msg.
- Fixed, Tasker v5.7+ wasn't performing tasks on profile activation.
- Fixed, hopping could fail for some devices.
- Fixed, network scans could be repeated too quickly.
- Fixed, a change in WiFi connectivity could be missed.
Notes:
Android 9.0 (Pie) restricts the amount of WiFi scans an app can perform. Ultimately this can cause network detection to become slower in some instances.
Network Location v6
Highlights: Auto WiFi Connect, WiFi Network Hopping and Scheduling of network scans.
Previous Versions
Where doeth this sorcery cometh?
Network Location - Project Interface
The Network Location project has included a somewhat basic user interface. You can access this interface by creating a shortcut on your launchers home screen linked to the 'Network - Launch ' Task. You can also use the buttons provided on some of the 'Network Location' notifications.
Input Special Commands
The Network Location interface will accept some special commands in order to help you manage your setup. The following commands are currently supported.
'nl:config' returns a list of the current configuration settings stored within the 'nl.cfg' file.
'nl:backup' this will backup your current network location project data to a file stored within the '/NetworkLocation/database/' directory.
'nl:restore' restores your previously created backup. Note that any new data added since the last created backup will be overwritten and therefore lost.
Creating Your Own User Interface
It is very easy to create a functional user interface for the Network Location project. All data pertaining to the project is stored within the '/Network Location/' directory. This data is used to dynamically populate and control the Network Location project. By building an interface to read or modify this data you can control all aspects of the Network Location project.
Uploaded User Interfaces
Share your creations…
Network Location - UI (Uploaded by, Sean Williams)
Network Location - Requirements
Minimally Android Version 4.3 is required by the Network Location project. This is due to the lack of required features in older firmware versions.
Android v4.3+
Advanced WI-FI settings "Keep WiFi On During Sleep" should be set to "Always".
Detection of nearby networks requires WiFi "Scanning Always Available" to be enabled.
Android v5.0+
Users should conform to Taskers guidelines on "Power Management" from within Taskers user guide.
Android v6.0+
Requires location services minimally "Battery Saving" to be enabled in order to determine available WiFi networks.
As of Android 6.0+ the project may fail to recover nearby networks when the device is in Aeroplane mode while Wi-Fi is enabled - likely due to the new dependency on location services. This means features such as non-connectable network detection, network hopping and auto connect may fail to work while the device is residing in Aeroplane mode.
Android v9.0+
Android 9.0 (Pie) restricts the amount of WiFi scans an app can perform. Ultimately this can cause network detection to become slower in some instances.
Understanding your 'mywifi' Task Structure
A 'mywifi' task is a Network Location compatible task that the project can recognise. These tasks hold your own custom actions for your individual network locations and are performed on arrival (enter) or departure (exit) of your known networks.
Your 'mywifi' Task names must follow certain rules and conform to a formal structure for the project to recognise and perform these tasks correctly.
Your 'mywifi' Tasks and Formatting
The following examples presume the advent of the example WiFi network SSIDs below.
Example WiFi SSIDs: 'Hotspot_01' & 'Hotspot _02'
Note: Hidden WiFi networks will use the access points MAC Address instead of the SSID.
Individual Tasks
You can create individual tasks for your 'mywifi' networks. These tasks will be performed when entering or exiting the corresponding WiFi network.
The following task name examples are valid.
Task name: 'Hotspot_01'
Task name: 'Hotspot_02'
Grouped Tasks
You can group together WiFi networks within a single task. This allows you to perform the same task for different WiFi networks.
The following task name examples are valid.
Task name: 'Hotspot_01/Hotspot_02'
Task Categories
Tasks labelled with a category are useful for either grouping common network locations or where a single location has multiple WiFi networks that overlap one another.
In a situation where your grouped WiFi networks overlap, tasks labelled with a category will be treated as a singular Network Location. As your device passes between these grouped WiFi networks when detected the enter task for each WiFi network will always be performed. However the exit task will only be performed once all of the grouped WiFi networks within the task name are no longer available.
The following task name examples are valid.
Task name: '[Hotspots]/Hotspot_01/Hotspot_02'
Tip: You can also group networks using several different tasks simply by naming each task with the same category. See the following examples.
Task name: '[Hotspots]/Hotspot_01'
Task name: '[Hotspots]/Hotspot_02'
Network Location - Project Data
Path: 'storage/NetworkLocation/'
The Network Location project will create a directory within your device storage.
This directory will hold a number of files and sub directories pertaining to the Network Location project. The following files/directories will be available.
File: 'NetworkLocation/nl.cfg'
'nl.cfg' is a file stored within the Network Location folder. This file holds all the configuration settings for the project. See 'Configuration Definitions' for more information.
File: 'NetworkLocation/nllog.txt'
'nllog.txt' is a file stored within the Network Location folder. This file holds the project log.
Folder: 'NetworkLocation/database/'
The 'database' folder contains a number of files which store important network related data.
App Creation
Network Location supports Taskers App Factory. You can create a stand alone app from this project to install and use across all of your devices. This is useful for people with various devices who want to automate them all in the same way but do not wish to configure the project on each device.
To export as an app you will need App Factory installed (please refer to Taskers user guide for more information). You can export the project as an app without the need to add any additional content, however to automate your network locations you must include your own 'mywifi' Tasks within the project while exporting as an app.
After export the app will function in the same way the project does within Tasker. To add additional automation at a new network location you must always recreate the app with your new 'mywifi' Task(s) included.
Advanced Calibration of Network Parameters
Advanced use of network parameters allows a user to calibrate the entry/exit timing and boundaries of a known network. They also allow for specific customisation of detection accuracy and control over power usage.
The following configuration settings can be adjusted for calibration.
Network boundary (-xxdbm)=99
The 'Network boundary' acts a a signal perimeter of a known network location. If you are outside of this signal boundary the known network will be ignored even when seen. If the known network is a connectable network holding a valid connection, connection and disconnection events will take priority over this boundary. The network boundary is useful for determining the range of your networks on entering and on exiting.
Network green zone (-xxdbm)=70
The 'green zone' is a theoretical area dictated by the signal from the currently detected known network. Where enabled this zone is protected from network hopping (see 'Configuration Definitions' for more information). The 'green zone' is also used when evaluating new overlapping nearby networks and for prevention of adding networks which overlap too closely.
Network exit buffer=30
This is the time taken while evaluating the departure of a known network. Setting this value too low could cause the departure to be missed where as higher values could cause slower detection of network departures. The default value is '30' seconds.
Network scan (sec)=600
Modify the scan intervals of the Network Location project. Higher values will be more battery efficient where as lower values will increase accuracy.
Configuration Definitions
Network boundary (-xxdbm)=99
The minimum acceptable signal quality for detection of a known network.
Network green zone (-xxdbm)=70
The protected zone of a known network.
Within this zone the active known network will be persistent.
Network exit buffer=30
The time taken while evaluating the departure of a known network. A value too low could cause the departure to be missed where as higher values will cause slower detection of network departures. Default is '30' seconds.
Auto WiFi connect=true
When Enabled Auto WiFi Connect will monitor your nearby networks for all previously known connections. When a suitable know network is found Network Location will attempt to automatically make a connection to this network. This is useful for users who prefer to disable their device WiFi when not in use but still want their device to automatically connect when nearby a previously connected and trusted WiFi network.
Auto WiFi timeout=30
Timeout setting for 'Auto WiFI' the project should wait at least this amount of time before disabling the WiFi radio. If a connection is established before the timeout period elapsed then the WiFi radio will be left enabled. A value of 10 - 60 (seconds) is recommend.
Network hopping=false
Network hopping allows the Network Location project to automatically switch the device WI-FI connection to an overlapping network that holds a stronger signal. For the stronger network to become eligible it must hold a signal of at least 10% greater than the currently connected network. The network will not hop if the device is transferring data, this is to avoid disruption to any current processes. Network hopping requires scheduled checks of the devices network environment.
Network log=true
Logging provides information pertaining to the actions Network Location is preforming. You will find the log at, 'NetworkLocation/nllog.txt'. The log contains basic HTML tags - useful when viewing the log within a Tasker scene.
Network perform tasks=true
When set to 'false' during arrival or departure Network Location will not preform your 'mywifi' network Task(s). All other aspects of the project will continue to function as usual. This is useful for users who do not wish to create grouped or singular (project compatible) tasks and instead may prefer to handle any Task(s) themselves by for example monitoring the 'NL_NDCE' variable.
Wake on scan=true
When set to true the device screen will turn on while attempting to scan for networks. This can be useful for devices that struggle to return network data while asleep. Note: this feature will consume more battery power than usual and should be used only where absolutely necessary.
Network scan (sec)=600
The time to wait between scheduling network checks. The accepted values are 180 - 1800 (seconds). Lower values will be battery intensive where as high values will mean the Network Location project will be slower to respond.
When set to '0' scheduling will be disabled.
Notify network events=true
Notification of events regarding networks.
Notify errors=true
Notification when erroneous actions occur.
Notify persistent=true
Hold important notifications within Androids notification area.
Notify bar=false
Notify Bar - show a coloured bar across the top of the device screen (scene overlay).
Bar Colours,
- Amber (solid): connectable network available nearby.
- Grey (pulse): aeroplane mode active.
- Green (pulse): connectable network connected.
Network Location - Project Media
Credits
Special Thanks To The Following People