If you’re tired of manually checking loadshedding schedules, this tutorial is for you. Initially, my coworker Justin had the idea of using Google Home to fetch loadshedding times. After some research, we decided to create an iOS Shortcut instead. It calls the ESP API (formerly Eskom se Push) to fetch the next loadshedding time for a specific area in South Africa.
Prerequisites
- An iPhone running iOS 13 or higher
- ESP API token (Get it here)
- Postman or another API testing tool
Steps
Get Your API Token
First, go to ESP’s API page and get an API token. It’s free for up to 50 requests per day.
Find Your Area ID
To find your Area ID, you’ll also need to use the ESP API:
- Open Postman or your preferred API testing tool.
- Make a GET request to
https://developer.sepush.co.za/business/2.0/areas_search?text=YOUR_SEARCH_TERM
, replacingYOUR_SEARCH_TERM
with the name of your area, town, or region. - Add a header named
token
and insert your API token as its value. - Look for the
id
field in the JSON response to get your Area ID.
Create the Shortcut
- Open Shortcuts: Open the Shortcuts app on your iPhone.
- Create Shortcut: Tap on “+”, then “Add Action”.
- Call the API: Add a “Get Contents of URL” action.
- URL: Use the Area Information API endpoint, for example:
https://developer.sepush.co.za/business/2.0/area?id=YOUR_AREA_ID
- Headers: Add a header named
token
and paste your API token as its value.
- URL: Use the Area Information API endpoint, for example:
- Get Dictionary Value: Add a “Get Dictionary Value” action to extract the
events
from the API response. - Get First Item from List: Use a “Get Item from List” action to retrieve the first item from the
events
list. - Retrieve ‘Start Time’: Use another “Get Dictionary Value” action to get the
start
time from the first event. - Format Date: Use a “Format Date” action to change the date format to a more readable one.
- Display Result: Use a “Show Result” action to display the formatted start time.
Use Siri to Run the Shortcut
You can also trigger this shortcut through Siri by saying the name of the shortcut. For instance, if you named your shortcut “When is loadshedding”, saying this to Siri will execute the shortcut and provide you the next loadshedding time.
Stay empowered and never be in the dark again about when the next loadshedding will occur. This shortcut is your own personal loadshedding assistant, always a voice command away. Enjoy your newfound convenience!
That’s it! You now have a simple Apple Shortcut that allows you to ask Siri when the next loadshedding event is. Just activate Siri and say your shortcut’s name, like “When is loadshedding,” and you’ll get the next start time.
Happy loadshedding planning!
If you want to find out more about how Maverick Labs can help your company build custom apps you can contact us or if you want to see more on what Maverick Labs does view our full products and services.