I’ve recently set up a simple yet effective automation in my smart home setup, and I wanted to share my experience and a question I have regarding it. The goal was to track the usage of coffee filters in my coffee maker, so I created a counter that decreases by 1 each time my coffee maker brews. This way, I can easily keep track of when I need to restock.
Here’s how it works: I’ve linked the coffee maker to a counter named counter.coffee_filters. Every time the coffee maker brews, the counter decreases by 1. The idea is that when I open a new box of filters (which typically contains 40), I’ll reset the counter back to 40. However, I’ve encountered a small issue that I’d love to resolve.
If I purchase more filters before the counter reaches 0, say when there are 5 filters left, I end up with a total of 45 filters. In this case, the counter should reflect 45 instead of resetting to 40. My question is: Is there a way to increase the counter by a specific number (like 40) based on its current value?
For example, if the counter is currently at 5 and I add a new box of 40 filters, the counter should update to 45. I believe this would make the system more accurate and user-friendly.
I’ve tried a few approaches, but I’m not quite sure how to implement this logic. Any suggestions or guidance would be greatly appreciated!
Thanks in advance for your help!