Repository navigation
Tasker Plugin
ClusterTune is a standard Locale/Tasker action plugin. Automation apps that support these plugins (Tasker, MacroDroid, Automate and others) can apply profiles, change CPU/GPU settings, set up per-app settings and read what is currently applied.
| Action | Setting | Same as |
|---|---|---|
| Apply profile | A profile name or ID; the screen also lists your profiles to pick from | profile.apply |
| Set CPU/GPU values |
Short settings, such as cpu6.max=2400 gpu.max=600
|
tuning.set |
| Assign an app | The package, then a profile or settings, such as com.example.game medium
|
app.set |
| Remove an app assignment | A package name | app.clear |
| Read current settings | Nothing | state.get |
Settings can use your automation app's variables, such as %profile or cpu6.max=%ceiling; Tasker fills them in before each run. Numbers are MHz unless they carry a unit, and snap to the nearest supported frequency step, just like in the API. Not sure which steps your device has? Run ct device from the command line, or look at a profile's sliders in ClusterTune.
- Tasker: in a task, tap + → Plugin → ClusterTune, then the pencil next to Configuration.
- MacroDroid: add an action, choose the Locale/Tasker plugin action, then ClusterTune.
- Automate: add a Plug-in action block, choose ClusterTune, then Configure.
The first time an automation app opens ClusterTune's screen, ClusterTune asks Allow Tasker to control ClusterTune? (Android tells ClusterTune which app opened the screen, so it knows exactly whom it's allowing.) Tap Allow, pick an action, fill in the setting and tap Save. The automation app then shows a summary such as Apply profile: Medium Underclock.
To check an action, run it once from the automation app: the change shows up immediately in ClusterTune, and Read current settings returns the result in %ct_data.
Each run sets these local variables:
| Variable | Value |
|---|---|
%ct_ok |
true or false
|
%ct_code |
ok, or an error code such as unavailable or access_denied
|
%ct_message |
What went wrong; empty on success |
%ct_data |
The reply data as JSON: the live settings for Read current settings (see state.get), or the applied values and any snapped settings for changes |
On failure the action also sets %errmsg and reports an error, so Tasker's Continue Task After Error option works as usual. Tasker waits up to 15 seconds for the result. Automation apps that don't support plugin results still run the action; they just don't get the variables.
Tasker can read JSON fields straight from a variable, such as %ct_data.profile.name after Read current settings.
Underclock harder on low battery (Tasker)
- Profile: State → Power → Battery Level, 0 to 25.
- Task: Plugin → ClusterTune → Apply profile, setting
small. - Exit task: Plugin → ClusterTune → Apply profile, setting
medium.
Cap the GPU while charging: profile State → Power → Source: Any; task Set CPU/GPU values with gpu.max=600; exit task Set CPU/GPU values with gpu.max=stock.
Pick the profile from a variable: set %profile to large earlier in the task, then use Apply profile with the setting %profile.
Show what is applied: Read current settings, then Alert → Flash with %ct_data.profile.name.
Handle errors: enable Continue Task After Error on the ClusterTune action, then If %ct_ok ~ false → Flash %ct_message.
Per-game settings: you don't need a Tasker profile that watches the game. Use Assign an app once (com.example.game large), and ClusterTune itself applies those settings whenever the game is visible and restores yours afterwards, the same as its own app-profile dialog.
- An automation app is allowed once, in the plugin screen. A denied app sees "not allowed" there and can't configure actions.
- Once it's allowed, ClusterTune stores a random key for that app inside every action it saves. You never see or copy it. Plugin actions arrive as broadcasts that don't say who sent them, so the key proves an action was set up by the app you allowed.
-
Settings → App access in ClusterTune controls the app at any time. Switching it off makes its actions fail with
access_deniedstraight away; switching it on again brings them back. Remove forgets the app and its key, so its existing actions fail until you open and save them again (which asks again). - Profiles and CPU/GPU settings applied through the plugin appear in ClusterTune's History as External API · Plugin · Tasker (with your automation app's name).
| You see | What to do |
|---|---|
| "Tasker is not allowed to control ClusterTune" in the plugin screen | Allow it under Settings → App access in ClusterTune, then edit the action again |
%ct_code is access_denied and the message says the action was set up before access was reset |
The app was removed from App access; open the action and save it again |
%ct_code is unavailable
|
ClusterTune's PServer or root setup isn't working; check it in ClusterTune |
%ct_code is invalid_argument
|
The setting is malformed or names an unknown policy or governor; %ct_message says which |
| An Assign an app action works, but nothing changes in the game | App detection must be running: open ClusterTune once, and check App detection in Read current settings (%ct_data.app_detection.connected) |
The plugin implements the Locale plugin protocol with Tasker's extensions: variable replacement, result variables, the completion signal and a requested timeout. It has been verified with a Locale-protocol test host. If it misbehaves in a particular automation app, please open an issue naming the app and its version.
External API
Project