Android agent with trigger monitoring and action execution via Centrifugo WebSocket.
- Kotlin + Jetpack Compose (Material 3)
- Koin for dependency injection
- Retrofit + OkHttp for HTTP
- centrifuge-java for Centrifugo WebSocket
- Room + DataStore for local storage
- Foreground Services for trigger monitoring and action execution
Trigger and action names follow a unified naming scheme across all Agimate platforms:
{platform}.trigger.{plugin}.{event}
{platform}.action.{plugin}.{verb}
- platform —
desktop,android,ios, etc. - trigger/action — fixed literal
- plugin — plugin or module name (e.g.
wifi,tts,notification) - event/verb — specific event or action (e.g.
connected,speak,show)
| Name | Params |
|---|---|
android.trigger.call.incoming |
phoneNumber, timestamp |
android.trigger.battery.low |
batteryLevel, threshold, timestamp |
android.trigger.wifi.connected |
ssid, bssid, connected, signalStrength, timestamp |
android.trigger.wifi.disconnected |
ssid, bssid, connected, signalStrength, timestamp |
android.trigger.shake.detected |
acceleration, x, y, z, timestamp |
| Name | Params |
|---|---|
android.action.notification.show |
title, message |
android.action.tts.speak |
text |
| Purpose | Method | Path |
|---|---|---|
| Link device | POST | /device/registration/link |
| Send trigger | POST | /device/trigger/new |
| Centrifugo token | POST | /device/centrifugo/token |
| WebSocket | WS | /connection/websocket |
X-Device-Auth-Key: {deviceKey}
- Link device — POST
/device/registration/linkwith{deviceId, deviceName, deviceOs, triggers, actions} - Fetch Centrifugo tokens — POST
/device/centrifugo/tokenwith{deviceId}, returns{connectionToken, subscriptionToken, channel, wsUrl?} - Connect WebSocket — using connection token, subscribe to server-provided channel with subscription token
- Receive actions — actions arrive as JSON
{type, parameters}via Centrifugo publications
If server doesn't provide wsUrl in token response:
- Multi-level domain: replace first subdomain with
centrifugo, usewss://(e.g.api.agimate.io->wss://centrifugo.agimate.io/connection/websocket) - Single-level host: keep host, match scheme (e.g.
http://localhost:8080->ws://localhost:8080/connection/websocket)
Default server: https://api.agimate.io
Settings are stored in DataStore:
- Device Key
- Server URL
- Device ID (auto-generated)
- Debug Logging toggle
./gradlew assembleDebug