Once in a while, we should give our coffee machine a deep clean and decalcify it. It's one of those tasks we all know we should do regularly but like to postpone too often. A simple recurring timer can help us, but we can do better because how often we clean it should really depend on how often we use it. For example, we can count how often the machine is switched on and send a notification if that counter reaches a threshold. We can then reset the counter manually when we clean the machine.
What we want to achieve:
We want to receive a notification when the coffee maker is switched on more than 30 times. After that, we want to get a message each time it is used until we manually reset the counter.
We need three things to make this work.
- A Counter Notification.
- A Shortcut to raise the counter that will sent the Notification.
- An Automation to trigger the Shortcut.
The Notification
We'll use a Counter Notification, which we'll trigger when we turn on the coffee maker's power plug. The counter will count how often this happens and send the Notification when it reaches 30.
- Go to Notifications, add the new Counter Notification and give it a title.
- Choose 'Keep Latest Notification' as behavior because we don't need multiple Notifications to tell us the same thing.
- We don't need any action for this. However, we can adjust the Snooze time. For example, I use six hours because I rarely want to clean when I drink my coffee in the morning.
- Enter 30 as 'Count.' That ensures that the Notification will be sent after 30 uses.
- Change 'Reset' to 'Manual.' We only want to reset the count when we have actually cleaned the machine. Until we do that, we will always get a Notification when the coffee maker is used, and the count is above 30.
- Finally, select the devices that should receive the Notification.
The URLs to raise and reset the count are at the end of the Notification settings. You can copy the URLs to your clipboard by tapping on them. You'll need the Raise-URL in the Shortcut we'll create next.
The Shortcut
At this point, we need to build a connection between HomeKit and Controllers Notification Server. That is possible with Apple's Shortcuts app. If you need to get more familiar with Shortcuts, you can learn more about them here.
We'll use the Shortcut to increment the count. Our Automation will trigger it every time the power plug is switched on.
- Open the Shortcuts app, switch to the Automation tab and tap the plus icon in the upper-right corner.
- Select 'Create Home Automation.' That will create an Automation in HomeKit, that we can customize in the next step.
- Select 'An Accessory is Controlled' as the event, select the power plug, and tap next.
- Select 'Turns On,' and tap next.
- Here you choose what the Automation will do. Scroll down to the bottom of the list and choose 'Convert to Shortcut.'
- At this point, we have an HomeKit Automation that will trigger a Shortcut. In the Shortcut, delete the 'Set Scenes and Accessories' action.
- Search for the 'Get contents of URL' action in the search bar on the bottom and add it.
- Open Controller and copy the Raise-URL of our Notification. Go back to the Shortcuts app and tap 'URL' in the Get contents of URL action. Paste the copied URL here.
- Tap 'Next.'
Finally, tap 'Done' and then close the Shortcuts app.
The Automation
The previous step already created our HomeKit Automation for us. In this example, we don't need to change anything about it. Our cleaning reminder should work already. However, you might want to use Controller to change the name to something more meaningful.
Wrap Up
That's it. Controller will now keep track of how often you use your coffee maker and let you know when it's time to clean it. To reset the count, touch and hold the Notification in the app and select 'Reset Count.' You can also see the current count here. Alternatively, you could create a second Automation and Shortcut and use a physical switch to reset the count using the Reset-URL.
If you like this, look at our Advanced HomeKit Notifications Documentation. We have some other great examples there!