Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Automated UniFi Guest Wi-Fi Voucher Generator (via Google Sheets/Google App Script)


Recommended Posts

Posted (edited)

Hey everyone,

I manage multiple sites, and easily one of the most annoying little admin tasks on my plate was constantly dealing with guest Wi-Fi vouchers.

 

You know the drill: receptionists lose the printed sheets, visitors show up unannounced, nobody else in the office can be bothered (or knows how) to log into the UniFi portal to generate fresh ones, and old printed voucher sheets end up lying around desks like confetti. 

 

So, to save my own sanity, I built a lazy-proof script that runs completely free inside Google Sheets to handle the whole circus automatically.

What it actually does:

  • Automated Weekly Top-Ups: Fires off every Monday morning and automatically tops up your site inventory (e.g. keeps a steady supply of 20x 8-hour passes and 5x 3-day extended passes for inspectors/VIPs).
  • Stops Voucher Hoarding: Tired of staff leaving months-old voucher slips lying around? You can enable a "purge" option that wipes all unused codes from the UniFi controller every week before issuing the new batch—meaning old paper slips instantly become useless trash.
  • Hands-Off Emailing: Automatically emails your office managers or receptionists their site's fresh codes every week so they stop bugging IT.
  • Foolproof Print Dashboard: The email includes a live link to a clean web page where staff can just click "Print Tickets" if needed. As visitors use codes, they vanish off the screen in real-time. so they dont get handed out multiple times
  • Handles multiple controllers: Built specifically to handle multi-site UniFi setups from a single master sheet.
  • Zero Hosting Costs: Runs 100% on free Google Apps Script—no virtual machines, Docker containers, or servers required.

I've made the script and setup guide open-source on GitHub. Feel free to grab it, fork it, or use it to automate yourself out of the guest Wi-Fi business:

 

https://github.com/DG-WISE/Unifi-Hotspot-Voucher-Generator

 

Hope this saves a few of you from the endless "Can you send over some Wi-Fi codes?" let me know if ive missed anything

And yes the sheet is probably defunct, but it started as a i want an easy list myself and turned into hey it can do all the work for me instead...

Email Example.png

VoucherView.png

Edited by DGardiner
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...