Repository navigation
External Control and Integrations
Essentials provides robust interfaces for external automation apps (like Tasker, MacroDroid, Automate), custom ADB scripts, and system integrations (like Android 16 App Functions) to control settings, toggle features, query state, and trigger workflows programmatically.
| Method | Best For | Requirement |
|---|---|---|
| Broadcast Intents | Tasker, MacroDroid, ADB scripts, Quick shell triggers | External Control Permission (com.sameerasw.essentials.permission.EXTERNAL_CONTROL), or an External control token for apps that cannot hold the permission |
| Content Provider | Direct queries, state checking, read/write via content URI | Read/Write access via Provider URI |
| App Functions (Android 16+) | System Assistant, AI Agents, App Function Manager | android.permission.BIND_APP_FUNCTION_SERVICE |
Essentials exposes two exported broadcast receivers for the action com.sameerasw.essentials.action.EXTERNAL_CONTROL. Both accept the same extras. They differ in how the sender is authorised.
| Receiver | Class | Authorisation | Use for |
|---|---|---|---|
| Permission receiver | com.sameerasw.essentials.external.ExternalActionReceiver |
Sender must hold com.sameerasw.essentials.permission.EXTERNAL_CONTROL
|
Apps that declare the permission in their manifest |
| Token receiver | com.sameerasw.essentials.external.ExternalTokenActionReceiver |
token extra must match the External control token |
Tasker, MacroDroid, Automate and other apps that cannot hold the permission |
-
Action:
com.sameerasw.essentials.action.EXTERNAL_CONTROL -
Package:
com.sameerasw.essentials(orcom.sameerasw.essentials.debug/com.sameerasw.essentials.foss) - Class: one of the two above
⚠️ Automation apps such as Tasker do not request the External Control permission, and it cannot be granted to them. Android silently drops broadcasts from apps that do not hold it, so use the token receiver for them.
- Open Essentials ➔ Settings and find External control token.
- Tap the refresh button to generate a random token, or type your own.
- Tap save. Without a saved token the token receiver ignores every request.
- Add the token to your intent as the
tokenextra.
Treat the token like a password. Anyone who knows it can change Essentials settings, and you can replace it at any time to revoke access.
| Extra Key | Type | Description | Values / Examples |
|---|---|---|---|
path |
String |
Target routing path (settings/<key> or location_alarm) |
settings/island_enabled, location_alarm
|
action |
String |
Action operation to perform |
update, toggle, start, stop
|
value |
String |
Value to set (for update action) |
"true", "false", "100", "unlocked"
|
token |
String |
External control token (token receiver only) | The token saved in Settings |
Any setting stored in Essentials (SettingsRepository) can be directly updated or toggled.
settings/<preference_key>
| Feature | Key | Type | Supported Values / Actions |
|---|---|---|---|
| Island | island_enabled |
Boolean |
update (true/false), toggle
|
| Island Catch-up | island_catch_up_enabled |
Boolean |
update (true/false), toggle
|
| Island Media | island_show_media |
Boolean |
update (true/false), toggle
|
| Island Flashlight | island_show_flashlight |
Boolean |
update (true/false), toggle
|
| Caffeinate | caffeinate_running |
Boolean |
update (true/false), toggle
|
| Screen Off Lock | screen_off_lock |
Boolean |
update (true/false), toggle
|
| Notification Lighting | notification_lighting_enabled |
Boolean |
update (true/false), toggle
|
| Smart Pixels | smart_pixels_enabled |
Boolean |
update (true/false), toggle
|
| App Lock | app_lock_enabled |
Boolean |
update (true/false), toggle
|
| Monochrome Mode | monochrome_mode_enabled |
Boolean |
update (true/false), toggle
|
| Flashlight Pulse | flashlight_pulse_enabled |
Boolean |
update (true/false), toggle
|
💡 Finding other keys: Check the full list of setting keys in
com.sameerasw.essentials.data.repository.SettingsRepository.
- In Tasker, add a new action: System ➔ Send Intent.
- Configure the action:
-
Action:
com.sameerasw.essentials.action.EXTERNAL_CONTROL -
Package:
com.sameerasw.essentials -
Class:
com.sameerasw.essentials.external.ExternalTokenActionReceiver -
Target:
Broadcast Receiver -
Extra 1:
path:settings/island_enabled -
Extra 2:
action:update -
Extra 3:
value:true(orvalue:false) -
Extra 4:
token:<your External control token>
-
Action:
- In Tasker, add action Send Intent:
-
Action:
com.sameerasw.essentials.action.EXTERNAL_CONTROL -
Package:
com.sameerasw.essentials -
Class:
com.sameerasw.essentials.external.ExternalTokenActionReceiver -
Target:
Broadcast Receiver -
Extra 1:
path:settings/island_enabled -
Extra 2:
action:toggle -
Extra 3:
token:<your External control token>
-
Action:
You can execute these commands directly over USB, Wi-Fi debugging, or via Termux / Shizuku shell.
To use the token receiver instead, add -n com.sameerasw.essentials/.external.ExternalTokenActionReceiver --es token "<your token>" to any of the commands below.
# Enable Island
am broadcast -a com.sameerasw.essentials.action.EXTERNAL_CONTROL \
--es path "settings/island_enabled" \
--es action "update" \
--es value "true"
# Disable Island
am broadcast -a com.sameerasw.essentials.action.EXTERNAL_CONTROL \
--es path "settings/island_enabled" \
--es action "update" \
--es value "false"
# Toggle Island state
am broadcast -a com.sameerasw.essentials.action.EXTERNAL_CONTROL \
--es path "settings/island_enabled" \
--es action "toggle"# Start location alarm for a specific alarm ID
am broadcast -a com.sameerasw.essentials.action.EXTERNAL_CONTROL \
--es path "location_alarm" \
--es action "start" \
--es id "<alarm_id>"
# Stop active location alarm
am broadcast -a com.sameerasw.essentials.action.EXTERNAL_CONTROL \
--es path "location_alarm" \
--es action "stop"Essentials exposes a Content Provider authority:
content://com.sameerasw.essentials.external
content query --uri content://com.sameerasw.essentials.external/settings/island_enabledReturns a cursor with columns key, value, type.
content update --uri content://com.sameerasw.essentials.external/settings/island_enabled --bind value:s:truecontent query --uri content://com.sameerasw.essentials.external/location_alarm/listReturns cursor with columns id, name, latitude, longitude, radius, isEnabled, isPaused, lastTravelled, isActive, iconResName.
For Android 16 and AI Agent environments, Essentials implements EssentialsAppFunctionService (BaseEssentialsAppFunctionService), providing structured and schema-backed tool calls:
toggleFlashlight(enabled: Boolean)toggleCaffeinate(enabled: Boolean)-
setSoundMode(mode: String)(SOUND,VIBRATE,SILENT) getDeviceStatus()-
getAlarms(),toggleAlarm(alarmId, enabled) -
listAutomations(),toggleAutomation(automationId, enabled) -
getFreezeTags(),freezeTag(tagId),unfreezeTag(tagId)