Connect a counter to Home Assistant with webhooks
Turn any counter into a Home Assistant trigger. When a counter reaches a value, the Counter app for Android fires a webhook to Home Assistant, so you can flip a switch, send a notification, or log a sensor. No code required.
What you need
- The free Counter app for Android.
- A Home Assistant instance reachable from your phone (a local URL on the same Wi-Fi, or a remote URL such as Nabu Casa).
- A few minutes.
Step 1: Create a webhook automation in Home Assistant
- In Home Assistant, open Settings > Automations & Scenes and create a new automation (start with an empty one).
- Add a trigger of type Webhook. Home Assistant generates a webhook ID for you.
- Note the full webhook URL, which looks like
https://your-home-assistant/api/webhook/your-webhook-id. - Add the actions you want Home Assistant to run (turn on a light, send a notification, update a helper).
Step 2: Create a counter
Open Counter, tap the + button, and create the counter you want to track, for example "Water glasses" or "Pushups". Set the increment step and, if it helps, a maximum value.
Step 3: Add an Events & Actions rule
Open the counter, go to Events & Actions, and add a rule. Pick the event that should fire the webhook:
- Reached Value: fire at an exact number.
- Reached Greater Value: fire at or above a threshold.
- Counter Updated: fire on every change.
- A time-based event: fire on a schedule (every day, weekly, monthly, or every N minutes), regardless of the counter value.
Step 4: Configure the Webhook action
As the action, choose Webhook and fill in:
- URL: your Home Assistant webhook URL from Step 1.
- Method: POST.
- Headers:
Content-Type: application/json(optional). - Body: a JSON payload that uses template variables.
Example body:
{
"counter": "{{title}}",
"value": {{value}}
}
Counter replaces {{title}} and {{value}} with the live counter data when the webhook is sent.
Step 5: Test it
Increment the counter until the event condition is met. Home Assistant receives the webhook and runs your automation. If nothing happens, check the automation traces in Home Assistant and make sure the URL is reachable from your phone's network.
Things you can build
- Turn on a desk lamp when your focus-session counter hits its goal.
- Send a phone notification when a shared "chores done" counter reaches a target.
- Increment a Home Assistant counter helper to keep a long-term log.
- Flash a light when a "water intake" counter falls behind schedule.
For the full list of webhook options (authentication, retries, timeout), see the FAQ.
Start automating your counters
Free download. No account required. Unlimited counters.
Get it on Google Play