BT Trigger

Open-source firmware · ESP32 · iPhone Shortcuts

When it turns on,
your iPhone does something.

A $3 ESP32 board becomes a Bluetooth device your iPhone recognizes. Power it up and the Shortcuts app runs an automation on the phone itself — open Maps, flip a Focus, message someone, call Home Assistant. It works even with no Wi-Fi where the board is: the phone in your pocket is the link.

  • 2-minute setup
  • No code to write
  • Reconnects by itself
  • MIT licensed
power on ESP32 connects Shortcut runs

The "when this turns on, do that" building block

🛴 Scooter, bike, car

Ignition on → your iPhone opens Maps, starts a ride timer, sets the volume. No Wi-Fi out there — the phone does it over Bluetooth.

🖥️ Desk & workshop

Desk lamp or monitor on → Work Focus on, playlist starts. 3D printer powered → a timer and a log entry on your phone.

🚪 Doors & sensors

Pin mode: a reed switch or relay closes → your iPhone gets a notification, runs a scene, or pings Home Assistant.

🔘 A real button

Button mode: press it → the phone connects for a few seconds → any Shortcut runs. A physical button for your phone.

🏠 Home Assistant, from anywhere

The Shortcut forwards the event to HA (webhook or app) over your phone's mobile data — so even a scooter far from home reaches HA.

🌙 Bedside

Night lamp on → Sleep Focus, alarm set, lights dimmed. Lamp off → back to normal.

"Can't an ESP32 with Wi-Fi and Home Assistant already do this?"

For flipping switches and logging data at home, yes. This solves the two things that setup can't:

📱 It acts on your phone

Wi-Fi + HA can control your house, but it can't open Maps, turn on a Focus, start a timer or run a Shortcut on your iPhone. This triggers the phone directly — that's the whole point.

📶 It works with no network

On a scooter, bike or car there's no home Wi-Fi and no SIM. A Wi-Fi ESP32 goes offline the moment you leave. This one talks to the phone in your pocket over Bluetooth, and the phone is the gateway to the internet and HA.

🪶 Nothing to run or install

No Home Assistant server, no companion app, no account, no cloud. Just a $3 board and the Shortcuts app that's already on every iPhone.

In short: a Wi-Fi ESP32 sends data to a server. This sends an event to the phone you carry, wherever you are. The two can work together — the Shortcut can still call Home Assistant.

How it works

  1. FlashPlug the board into your computer, choose a name and options below, click Install.
  2. Pair onceiPhone → Settings → Bluetooth → tap your device. No PIN.
  3. AutomateShortcuts → Automation → Bluetooth → your device → "Is Connected" → add actions → Run Immediately.

The board appears as a mouse that never moves. iOS treats it like any other Bluetooth accessory, and your on-screen keyboard keeps working (a "keyboard" device would hide it). Connecting is the signal; nothing is ever typed or clicked.

Two ways to trigger it

⚡ When it gets power

Wire nothing: power the board from the thing you want to detect (a scooter's USB port, a car socket, a lamp's USB charger). Power on = connected.

📍 When a pin is activated

The board stays powered and connects when a pin you choose changes: a reed switch on a door, a relay, a push button, a sensor output. You set the pin, level, resistor, debounce and timing.

Install from your browser

Uses Web Serial in Chrome, Edge or Opera on a computer (Windows, macOS, Linux, ChromeOS). Nothing to install.

You need an original ESP32 (ESP32-WROOM-32 DevKit, D1 mini32, NodeMCU-32S… about $3–5). ESP32-S3, C3 and C6 won't work: they only have Bluetooth LE, and iOS Shortcuts doesn't list those accessories as triggers.
  1. 1

    Connect your board

    Plug the ESP32 in with a data USB cable (some cables only charge), then click Connect and pick its port.

    Port not listed / can't connect?
    • Try another cable or USB port. A charge-only cable is the #1 cause.
    • Install the USB driver for your board's chip: CP210x or CH340/CH343.
    • Hold the BOOT button, tap RESET/EN, release BOOT, then click Connect again.
    • Close other programs using the port (Arduino IDE, serial monitors, Cura…).
  2. 2

    Choose your settings

    16/29 bytes · Pick something you'll recognize, e.g. "Scooter" or "Desk".
    When should it trigger?
    Status LED, reset button, pairing & transmit power
    Fast blink (blue) = ready to pair · slow blink (amber) = looking for your iPhone · solid (green) = connected. Colors on RGB LEDs only.
    s
    "Pairing window" hides the device from strangers: phones already paired always reconnect.
    Lower power = shorter range, less current and heat: the iPhone must be closer for the trigger to fire. Raise it if the board sits in a box, a vehicle frame or behind metal.
  3. 3

    Install

    Leave it off to keep your iPhone paired across updates.
    Technical log
    
            

iPhone setup

1 · Pair (once)

  1. Power the board (LED blinks fast = ready to pair).
  2. Settings → Bluetooth, tap your device under Other Devices.
  3. It moves to My Devices. That's it, no code.

2 · Create the automation

  1. Shortcuts → Automation → + (New Automation).
  2. Bluetooth → Device: choose yours → Is Connected (or Is Disconnected).
  3. Pick Run Immediately, turn off Notify When Run, then add your actions.

From now on, every time the board powers up (or the switch/button fires) and connects, the automation runs. An AssistiveTouch pointer may appear on screen while it is connected, since iOS thinks a mouse is attached. You can hide it in Settings → Accessibility → Touch → AssistiveTouch → Pointer Devices.

Download the firmware

Prefer the command line? Each file is a merged image: write it at offset 0x0. Without the web flasher the defaults are used: name ESP32-BT-Trigger, connects whenever powered. To use a pin trigger, connect the board to this page later and click Save settings only.

ChipBluetoothFileSize
Loading…
pip install esptool
esptool.py --port <PORT> write_flash 0x0 bt-trigger-esp32.factory.bin

FAQ

Power-on or pin trigger: which one do I need?

Power-on if the thing you want to detect can power the board (USB port, 12 V socket with a USB adapter, a lamp's charger). Pin if the board is always powered and you want to react to a contact: door reed switch, relay, button, the output of another device. It's one firmware: you can switch later with Save settings only, in a second.

With a pin trigger the board stays visible until a phone is paired, so you can pair it before wiring anything. After that it only connects when the pin is active.

Which boards work?

Only the original ESP32 (ESP32-WROOM-32 / WROVER / PICO modules: DevKit, DOIT DevKit V1, NodeMCU-32S, D1 mini32, M5 Atom, ESP32-CAM, TTGO…), including single-core and 26 MHz-crystal variants, with 2 MB of flash or more. It uses Classic Bluetooth HID.

ESP32-S3, C3, C6, C5, H2 do not work. They only have Bluetooth LE, and iOS Shortcuts does not list Bluetooth LE (GATT) accessories as automation triggers: they pair, but never show up in the automation's device list. We tested it. ESP32-S2 and ESP8266 have no Bluetooth at all.

Why a mouse and not a keyboard or a "beacon"?

The Shortcuts "Bluetooth" automation only lists accessories paired in Settings, and iOS only pairs certain device types from there: audio, keyboards, mice, game controllers. A plain BLE beacon never shows up, and Bluetooth LE accessories that do pair are still missing from the automation's device list: it has to be Classic Bluetooth. A keyboard would hide your on-screen keyboard while connected. A mouse has no side effects except an optional on-screen pointer.

Does it work with several iPhones?

Yes. Several phones can pair. The board calls back the last one that was connected first, then the others. Only one is connected at a time.

Is it private / secure?

Nothing leaves your phone: no account, no internet, no app. The firmware sends no input at all. Use the pairing window option if you don't want strangers to see or pair the device.

How do I re-pair or reset it?

Hold the configured button for 5 seconds (LED flashes red/fast), or reinstall with "Forget paired phones" ticked. Then on the iPhone, tap the device → Forget This Device and pair again.

Can I change the settings later?

Yes. Connect the board here again: your current settings are read back from it, and Save settings only rewrites just the 4 KB settings block in a second, keeping your pairing.

Power consumption?

Roughly 30–60 mA while connected depending on the board, so it's meant for things that are powered anyway (vehicles, USB ports, chargers). It's not a coin-cell device.

Free, and staying that way

No ads, no accounts, no paid features. A commercial smart button costs $30–40 and needs its own app. If this saved you that (or an afternoon of fighting Bluetooth stacks), you can chip in for new test boards and iOS updates.

Not in a position to donate? A ⭐ on GitHub or a hardware test report helps just as much.

Thanks for thinking of it ♥

BT Trigger is free and stays free. Support pays for new test boards and for checking every iOS update.

Can't donate? A ⭐ on GitHub helps just as much.