Use IFTTT webhooks to mute your Android and iOS during a Pomodoro sprint

I am a big fan of the Pomodoro Technique and have written several blogposts on it. The goal is to reach flow and deep work in order to get stuff done. I currently use a PowerShell Pomodoro timer which

When you successfully reach the flow state, you forget about time and suddenly minutes and hours have gone by. This is why it is crucial to become available again after 25 minutes. You are entitled to a break, but even more important, people need to be able to reach you again. If you find that nothing special has happened, then you can plan a new Pomodoro sprint or join your next meeting.

The reason why you would use a timer like this to turn off distractions is to not disturb yourself. You are always just one notification away from breaking your flow. It takes between 7 and 30 minutes to get back in to flow.  it is too easy to be stuck in a semi available loop of task switching and not get any real work done. This is where IFTTT webhooks comes in to play.

IFTTT stands for If This Then That. By sending a web message to IFTTT you trigger an action. It is not easy to get started with but the benefits are worth the effort. To be able to easily mute your phone and turn it back on again after 25 minutes is the goal, if you don’t do this, you have the potential of breaking you flow from a notification on you phone.

The final result, iOS phones goes to Do not Disturb during a Pomodoro sprint

Setting up IFTTT

  1. The webhook URL key
  2. Android triggers and Android setup
  3. iOS triggers and iOS setup
  4. Using the triggers in the Pomodoro script
  5. Create a shortcut to the Pomodoro script

The webhook URL key

  • Create an IFTTT account or log in with your existing account
  • Go to Settings on the Webhooks service page
    • If this is the first time you are setting up a webhook, click connect
  • Copy the key at the end of the URL, as you see mine is
  • Save your key as we are going to use it as the IFTTTWebhookKey in the Pomodoro script

Android triggers

  • We need two triggers for Android MuteAndroid and UnMuteAndroid
  • First lets create the MuteAndroid trigger
    • Go to Create
    • Search for webhook and select it
    • Use MuteAndroid as Event Name
    • Search for Android and select mute and set vibrate to No
    • Finish the setup
  • Now create the UnMuteAndroid trigger
    • Go to Create
    • Search for webhook and select it
    • Use UnMuteAndroid as Event Name
    • Search for Android and select mute and set vibrate to Yes, personally I do not use sound on my phone, only vibrate
      • If you want sound you should use the Set Ringtone Volume action
    • Finish the setup
  • Install the IFTTT app on your phone and log in with the same user
  • That’s it you are now ready to mute and unmute your Android from PowerShell
    • You can test it by using the following command
    • Invoke-RestMethod -Uri https://maker.IFTTT.com/trigger/MuteAndroid/with/key/IB4In0nMeJq7pcUa6VTtQ -Method POST -ErrorAction Stop
  • In the Pomodoro PowerShell script the following values are now available
    • $IFTTTMuteTrigger = MuteAndroid
    • $IFTTTUnMuteTrigger = UnMuteAndroid
    • $IFTTTWebhookKey = IB4In0nMeJq7pcUa6VTtQ

iOS triggers and iOS setup

  • We will not install the IFTTT app on iOS, instead we will use the two apps Shortcuts and Pushcut
  • We are not going to mute the phone, but set it to Do Not Disturb
  • Pushcuts integrates with IFTTT triggers, but we need to click the notification popup on the phone or Apple Watch in order to active Do Not Disturb
  • Start with installing Shortcuts
    • Create the Do Not Disturb shortcuts as shown in the GIF
  • Install Pushcut
    • First import the shortcuts
    • Then create notifications for iOSMute and iOSUnMute and choose the shortcuts as actions
    • Test the notifications, note that you have to tap the notification for the phone to go to Do Not Disturb
  • In IFTTT you need to create the iOSMute triggers
    • Click create and choose webhook
    • in Event Name call it iOSMute
    • as action, search for and choose Pushcut
    • The first time you need to connect IFTTT to Pushcut using the QR code as shown in the GIF
    • After you have connected IFTTT to Pushcut, choose notification, iOSMute and the device you want to send the notification to
    • Click finish
  • In IFTTT create the iOSUnMute trigger
    • Click create
    • Search for Webhooks and call it iOSUnMute as Event Name
    • As action, choose Puschut, notification, iOSUnMute and select the device you want to push the notificaiton to
    • Finish to save Applet
  • That’s it you are now ready to mute and unmute your Android from PowerShell
    • You can test it by using the following command
    • Invoke-RestMethod -Uri https://maker.IFTTT.com/trigger/iOSMute/with/key/IB4In0nMeJq7pcUa6VTtQ -Method POST -ErrorAction Stop
  • In the Pomodoro PowerShell script the following values are now available
    • $IFTTTMuteTrigger = iOSMute
    • $IFTTTUnMuteTrigger = iOSUnMute
    • $IFTTTWebhookKey = IB4In0nMeJq7pcUa6VTtQ

Using the triggers in the Pomodoro script

  • Download the Start-SimplePomodoro.ps1 from GitHub
  • Open the script in your favorite PowerShell editor
  • Scroll down to the bottom of the script and populate the run command as shown in the GIF
  • Save the script and run it from PowerShell, remember to navigate to where you stored the script
Add your Spotify playlist, your triggers and IFTTT keys
The result, you need to tap the notification from Pushcut in order to set the phone in DND

3 thoughts on “Use IFTTT webhooks to mute your Android and iOS during a Pomodoro sprint

  1. Hi Ståle

    Everything works fine.
    I just made a small improvement (only for me):
    – Pomodoro ON Shortcut includes start Apple Music/playlist due I don’t have Spotify account. 😉
    – Pomodoro OFF includes an pause music actions too.

    It can be extend with a home kit function too, like play sound on Sonos. Good stuff.

    This Pushcut app could more nice and productive when you could start a shortcut directly via webhook. For this action you need an automation server extension for CHF24.-/year. But then you wont have this notification area, which you have to firstly tap on you phone.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.