Trigger Tasker and Automate from a counter
Counter speaks Android intents in both directions. Make a counter fire a broadcast intent that Tasker, Automate, or MacroDroid can catch, or let those apps control your counters. No code required.
Two ways to connect
- Direction A: a counter triggers Tasker (the Broadcast Intent action).
- Direction B: Tasker controls a counter (the External Intent Receiver).
Direction A: a counter triggers Tasker
- In Counter, open the counter and add a rule under What it does on its own. Pick an event (Reaches the value, Changes, or a time-based event like "Every day at").
- Choose the Broadcast Intent action. Counter sends a broadcast with the action
com.zipangulu.counter.ACTION_COUNTER_EVENT(you can change it), carrying the counter data plus any custom extras you add. - In Tasker, create a Profile > Event > System > Intent Received and set the action to the same string.
- Attach a Task that does what you want: toggle Bluetooth, send an SMS, launch an app, or call a web service.
The broadcast carries these extras: counter_id, counter_title, counter_value, counter_step, counter_min, counter_max and timestamp. Custom extras accept the variables ${counter.id}, ${counter.title} and ${counter.value}.
Direction B: Tasker controls a counter
- In Counter, open Settings > External integration and turn on External commands. Then open Security token and copy the token: it is required by default.
- In Tasker, use the Send Intent action with the action and extras below.
Action: com.zipangulu.counter.ACTION_EXTERNAL_COMMAND
Extras:
counter_id (long) - required
command (string) - required: increment, decrement, reset, set_value
value (long) - optional
auth_token (string) - if authentication is enabled
For example, in Tasker's Send Intent action set the extras counter_id:1L, command:increment and auth_token:your-token to bump counter 1 by its step. The L matters: counter_id and value are long numbers, and Tasker sends a plain 1 as an int, which Counter ignores.
Works with Automate and MacroDroid too
The same broadcast intents and commands work with Automate and MacroDroid. Use their "intent received" and "send intent" blocks in place of Tasker's.
Things you can build
- When a "work sessions" counter hits 8, have Tasker turn on Do Not Disturb.
- Increment a counter from a Tasker location profile to count gym visits automatically.
- Chain Counter to Tasker to a smart home API call for a fully custom automation.
For the full intent format and command reference, see the FAQ.
Start automating your counters
Free download. No account required. Unlimited counters.
Get it on Google Play