Want to automatically turn your golf simulator system on + off with each booking?
If so, you've come to the right place. AllBooked integrates with smart plugs, which can be connected through IFTTT to automatically turn your launch monitor on at start of each booking, and turn it off when the booking ends.
Why set this up?
Prevents players from playing outside of scheduled bookings.
Helps you save on energy costs when no one's using the facility.
It can also open the door to more revenue by powering a 24/7, 365 operating model—without extra overhead from onsite staff.
Follow this step-by-step guide to set up an IFTTT connection with a SONOFF iPlug—a smart plug—to turn your launch monitor on when a booking begins, and turn it off when it's done.
What is SONOFF?
SONOFF is a leading provider of smart home essentials, and the company you'll be buying your smart plug from.
What is IFTTT?
IFTTT is a platform that helps you automate smart devices—like plugs, thermostats, and security systems—so everyday tasks are handled for you. It's a simple way to cut down on energy costs and run your venue 24/7. You can think of IFTTT as a middle man that lets two platforms exchange data.
Before starting:
Connect your AllBooked account with Google Calendar to have bookings automatically show up in your Google calendar.
By default, bookings from all spaces are included in your calendar link—unless you uncheck the spaces in your AllBooked account. If you have multiple spaces, you’ll need to set up integrations for each one by creating a separate calendar link in AllBooked and connecting it to your Google Calendar. See video below for how to create separate calendar links for each space.
Heads up: Bookings can sometimes take a while to show up in Google Calendar because of how Google handles syncing. Follow the instructions in this video to run a quick script to speed things up. Here is the code referenced in the video.
Purchase the SONOFF iPlug Series Wi-Fi Smart Plug (make sure to purchase model S40, Type B) and plug it in. As part of installation instructions, you'll be prompted to set up an eWeLink account and register your device with it.
Note: You will need to purchase a smart plug for each launch monitor.
Download the eWeLink app to your smartphone by visiting the App Store or Google Play.
Within the app, upgrade to Advanced plan, so that you will be able to integrate with IFTTT.
Note: It may take up to four hours for the Advanced plan to appear in your account. Wait until it’s visible before starting on your integrations.
Note: Do not opt for the free version because automations can take an hour to process.
How to set it up for multiple rooms
As noted above, each launch monitor requires it's own smart plug and Google Calendar link. Create the following two integrations for each plug so that your simulators turn on and off with the start and end of each booking.
Example:
If you have 5 plugs, you'll need to create a total of 5 Google Calendar links and 10 integrations (one to turn the simulator on when the booking starts and one to turn the simulator off when the booking ends).
Step #1: Turn simulator on when booking starts
Trigger
Login to IFTTT.
Click Create in upper right hand corner of screen.
Click Add and search for Webhooks.
Select Receive a web request.
Under event name, enter a name of your choice. We recommend setting up a naming convention that matches your spaces. This way, when you eventually create an Apps Script for each space, it's clear which plugs are being used.
Example: If you’re creating the start integration for your first space with a smart plug, name it space1_start
Select Create Trigger.
Action
Next to Then That, select Add.
Search for eWeLink Smart Home.
Select Turn 1-Channel Plug on or off.
Click Connect and login to your eWeLink account.
Under eWeLink Smart Home account, select your account.
Under Which 1-Channel Plug?, set select your plug.
Under Turn on or off?, select on.
Select Create Action.
Step #2: Turn simulator off when booking ends
Trigger
Click Create in upper right hand corner of screen.
Click Add and search for Webhooks.
Select Receive a web request.
Under Event Name, enter a name of your choice. We recommend setting up a naming convention that matches your spaces. This way, when you eventually create an Apps Script for each space, it's clear which plugs are being used.
Example: If you’re creating the end integration for your first space with a smart plug, name it space1_end
Select Create Trigger.
Action
Next to Then That, select Add.
Search for eWeLink Smart Home.
Select Turn 1-Channel Plug on or off.
Select eWeLink account (it may already be pre-populated).
Under eWeLink Smart Home account, select your account.
Under Which 1-Channel Plug?, set select your plug.
Under Turn on or off?, select off.
Select Create Action.
Step #3: Google Apps Script
Watch the full tutorial here.
Make sure you are logged into your Google account on your browser.
Click here to get the script → navigate to Overview → click Make a copy. This copies the script over to your own account so you can edit it!
Next to const CAL_ID =, put in the code to your calendar ID (see video for how to do this).
Next to const IFTTT_KEY =, paste all characters after the last backslash from your IFTTT maker URL (see video for how to do this).
Next to const EVT_ON =, put in the event name you created in Step #1.
Next to const EVT_OFF =, put in the event name you created in Step #2.
Navigate to Triggers on the lefthand side → Add trigger.
Under Choose which function to run, select run.
Under Choose which deployment should run, select head.
Under Select event source, select Time-driven.
Under Select type of time based trigger, select Minutes timer.
Under Select minute interval, select Every minute.
Under Failure notification settings, select Notify me daily.
Click Save.
Navigate to Editor on the lefthand side → Next to Execution Log, click on the dropdown and Select run.
Click run from the main navigation bar.
Reminder: Complete these three steps for each smart plug.
You've successfully configured your smart plugs to turn your launch monitors on and off with bookings! Should you have any questions along the way, don't hesitate to reach out to us at info@allbooked.com—we're more than happy to help.
FAQs
Can I do this with a Microsoft Outlook calendar or do I have to use Google Calendar?
While you can set up this integration the same exact way with your Microsoft Outlook Calendar, it's common to experience a slow sync time with Outlook—bookings generally take about 24 hours to populate. This unfortunately can’t be changed with a script, like it can with Google Calendar.
We recommend testing out how long it takes for bookings to sync with your own account and determine a lock-in period to ensure the correct booking information is in Outlook when the integration is triggered.
What else can I automate with AllBooked?
The possibilities are endless. With AllBooked's integrations feature, you can connect with thousands of popular apps through Zapier—a tool that works like IFTTT to automate your workflows.
Can I send data into AllBooked from other apps?
Not at this moment. AllBooked's integrations are one-way only (from AllBooked to the outside app).