Skip to content

Instantly share code, notes, and snippets.

@Geek-MD
Last active May 9, 2025 03:13
Show Gist options
  • Save Geek-MD/03e8c752df638546a79a4defec19a09a to your computer and use it in GitHub Desktop.
Save Geek-MD/03e8c752df638546a79a4defec19a09a to your computer and use it in GitHub Desktop.
blueprint:
name: Daily Counter Blueprint
description: >
Increments a selected counter each time the specified entity is triggered.
The counter resets automatically every day at 00:00.
domain: automation
author: Edison Montes @_GeekMD_
homeassistant:
min_version: "2023.0.0"
input:
counter_entity:
name: Counter - domain "counter"
description: Select the counter to increment.
selector:
entity:
domain: counter
trigger_entity:
name: Trigger Entity
description: Select the entity that will trigger the counter increment.
selector:
entity:
filter:
- domain: binary_sensor
- domain: sensor
- domain: device_tracker
- domain: input_boolean
- domain: person
trigger_state:
name: Trigger State
description: State that triggers the increment (e.g., 'on', 'home', 'detected').
default: "on"
selector:
text:
mode: single
trigger:
- platform: state
entity_id: !input trigger_entity
to: !input trigger_state
- platform: time
at: "00:00:00"
action:
- choose:
- conditions:
- condition: template
value_template: "{{ trigger.platform == 'time' }}"
sequence:
- service: counter.reset
target:
entity_id: !input counter_entity
default:
- service: counter.increment
target:
entity_id: !input counter_entity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment