ESP8266 Wake-on-LAN and relay control with Google Sheets and Google Apps Script
ESP8266 (the bot) will check the time and commands in the Google Sheet and choose to send multiple Wake-on-LAN magic packets and/or control LC-Relay-ESP01-2R-5V relay module. Users can edit "MAC address" and "on time" in the Google Sheet. If the value of "on time" is NOW(), it will be updated whenever the sheet is edited or when someone goes to the App URL.
- Create a copy of the example Google Sheets.
- Edit MAC address and time zone.
- Deploy Google Apps Script and get your App ID and URL. Should look like this:
https://script.google.com/macros/s/YOUR-APP-ID/exec
- Go to your App URL to update NOW(), so the bot will know the link is clicked. example user link
- Go to your App URL with
?client=bot
added to the end, to see what the bot will get. example bot link
- Edit YOUR-WIFI-SSID, YOUR-WIFI-PASSWORD, and YOUR-APP-ID in main.cpp
- Build and upload. (PlatformIO recommended)
- The built-in LED will blink at a perid of 0.05 seconds at startup, or when sending Wake-on-LAN magic packet/controlling relay, 0.1 seconds when connecting to WiFi, 0.5 seconds when updating time with NTP, and 1 second when waiting for changes in Google Sheets.
- Open serial monitor to see more information.