HA Daily Counter is a custom integration for Home Assistant that provides daily-resettable counters, perfect for tracking repetitive actions like door openings, light switches, sensor triggers, and more. Now with multiple trigger support and custom logic operators.
- Create one or more counters with custom names.
- Configure one or more trigger entities from multiple domains:
- Binary Sensors (doors, windows, motion detectors)
- Sensors (temperature, humidity, etc.)
- Automations (track automation executions)
- Scripts (monitor script runs)
- Input Helpers (input_boolean, input_number, input_select)
- Choose the trigger state from a smart dropdown populated with the entity's known states (
on/off,open/closed, input_select options, etc.). Custom values are always allowed. - Define how multiple triggers are combined with logic operators:
- AND → All triggers must be active.
- OR → Any trigger increments the counter.
- Filter entities by domain type for easy selection.
- Auto-associate the counter sensor with the trigger entity's device — the counter appears on the device's page in HA. When monitoring multiple entities the counter is created as an independent virtual device so it is never duplicated across several device pages.
- Auto-reset counters daily at midnight (00:00 local time).
- Persistent values across Home Assistant restarts.
- Fully manageable via the UI (no YAML required).
- Exposed as
sensorentities withstate_class: total_increasingandmdi:countericon. - Includes reset and set services for manual control.
- Multi-language Support: English, Spanish, French, Portuguese, and German
- Go to HACS → Integrations → Custom Repositories.
- Add the repository URL:
https://github.com/Geek-MD/HA_Daily_Counter - Select category Integration.
- Search for HA Daily Counter in HACS and install it.
- Restart Home Assistant.
- Download the latest release from GitHub.
- Copy the
ha_daily_counterfolder into:/config/custom_components/ha_daily_counter/ - Restart Home Assistant.
-
Go to Settings → Devices & Services → Add Integration → HA Daily Counter.
-
Fill in the multi-step form:
- Step 1 – Counter Setup:
- Name: Friendly name of the counter.
- Entity Type: Select the domain to filter entities (Binary Sensor, Sensor, Automation, Script, or Input Helpers).
- Step 2 – Trigger Entity:
- Trigger Entity: Entity that will increment the counter (filtered to the selected type).
- Step 3 – Trigger State:
- State to Monitor: Select from a dropdown of the entity's known states (e.g.,
on,off,open). You can type a custom value if needed. - Add Another Trigger?: Toggle to add additional triggers. Subsequent entity selectors are automatically filtered to the same domain as the first entity.
- State to Monitor: Select from a dropdown of the entity's known states (e.g.,
- Step 1 – Counter Setup:
-
If multiple triggers are added:
- For each additional trigger, first select the entity, then select its state from the dropdown.
- Configure the logic operator (AND/OR) when adding the second trigger.
- The same logic applies to all subsequent triggers.
- Count how many times the front door opened today.
- Track how often lights were turned on.
- Monitor motion detectors across multiple rooms, combined with OR logic.
- Track automation executions (e.g., how many times "Turn on lights" automation ran).
- Monitor script runs (e.g., count "Night mode" script executions).
- Require two conditions (e.g., window open AND heater on) to increment.
- Use multiple binary sensors to track activity across different zones.
Available services under the ha_daily_counter domain:
Reset a counter to zero.
service: ha_daily_counter.reset_counter
target:
entity_id: sensor.my_counterSet a counter to a specific integer value.
service: ha_daily_counter.set_counter
data:
entity_id: sensor.my_counter
value: 42- The counter increases by
+1when its triggers match the configured states. - If multiple triggers are configured, the logic operator defines how they combine.
- Counters reset to 0 every midnight (local time).
- Values persist across Home Assistant restarts.
MIT License. See LICENSE for details.
| Contribution | Contributor |
|---|---|
| Feature request: attach counter to existing device (#34) | @alsmaison |
| Only binary sensor entities are shown when selecting a different entity type (#31) | @ikswokinok |
💻 Proudly developed with GitHub Copilot 🚀
