Hi,
As I’ve no coding experience, I’d appreciate some help here.
I have some counters (helpers) that keep track on some events.
But I’d like to reset them every Monday at 0.00 hours so I can compare the data week by week.
How do I create a trigger that can reset the counters? In the UI I do not see options for this. And I didn’t find any integrations either.
counter.reset service call for the counters you wish to reset.
Using the Automation Editor, create a new, blank automation, switch to YAML mode (available in the overflow menu, three vertical dots, in the upper right hand corner), and copy-paste the following YAML over whatever may already be there. Save the automation. If you wish you can switch back to Visual mode to see how it looks that way.
alias: example
trigger:
- platform: time
at: '00:00:00'
condition:
- condition: time
after: '00:00:00'
weekday:
- mon
action:
- service: counter.reset
target:
entity_id:
- counter.first
- counter.second
I suggest you change the category from Blueprints Exchange to Configuration (Blueprints Exchange is for sharing functional blueprints).
After you have done that, please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic is resolved. This helps other users find answers to similar questions. For more information, refer to guideline 21 in the FAQ.