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.
Thanks in advance for your help.
Create an automation with:
Time Trigger set to midnight
Time Condition restricting the day to Monday
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.
- platform: time
- condition: time
- service: counter.reset
Thanks. That is actually very obvious. To obvious to think of myself
This is actually in the wrong category.
you have it in the “Blueprints Exchange” but it has nothing at all to do with blueprints.
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.