SwitchBot Plug Mini
| Chip | ESP32-C3 |
|---|---|
| Form factor | US smart plug (15 A) |
| Flash | 4 MB |
| Antenna | PCB antenna |
| Install | ESPreSwitch over WiFi, else serial (case is welded; see notes) |
| Stores | amz/us |
| GPIO | Function | ESPresense setting |
|---|---|---|
| 6 | Relay | Outputs |
| 7 | White LED (active low) | LEDs |
| 8 | Status LED (active low) | LEDs |
| 2 | Button (active low) | Inputs |
| 18 | BL0937 CF | Power monitor |
| 19 | BL0937 CF1 | Power monitor |
| 20 | BL0937 SEL (inverted) | Power monitor |
Template
Section titled “Template”Paste this into the Board Template box on the node's Templates page, then Preview and Apply (firmware v5.0.0b1 or later). It sets the board's pins (and Ethernet type, if it has one) in one go. Apply it before any add-on template. The LED, input and output lists replace what was configured before, so the result doesn't depend on the node's old setup. See Templates.
{"name":"SwitchBot Plug Mini","chip":"esp32c3","settings":{"leds":[{"type":"pwm_inverted","pin":7,"count":1,"control":"output","output":1},{"type":"pwm_inverted","pin":8,"count":1,"control":"status"}],"inputs":[{"name":"Button","role":"button","pin":2,"type":"pullup_inverted"}],"outputs":[{"name":"Relay","pin":6,"type":"output","power_on":"restore","input":1}],"power":{"model":"bl0937","cf":18,"cf1":19,"sel":20,"sel_inverted":true,"voltage_divider":1450,"current_resistor":0.0011}}}Formatted, with what each value means
{
"name": "SwitchBot Plug Mini",
"chip": "esp32c3",
"settings": {
"leds": [
{
"type": "pwm_inverted",
"pin": 7,
"count": 1,
"control": "output",
"output": 1
},
{
"type": "pwm_inverted",
"pin": 8,
"count": 1,
"control": "status"
}
],
"inputs": [
{
"name": "Button",
"role": "button",
"pin": 2,
"type": "pullup_inverted"
}
],
"outputs": [
{
"name": "Relay",
"pin": 6,
"type": "output",
"power_on": "restore",
"input": 1
}
],
"power": {
"model": "bl0937",
"cf": 18,
"cf1": 19,
"sel": 20,
"sel_inverted": true,
"voltage_divider": 1450,
"current_resistor": 0.0011
}
}
}LED type: pwm, pwm_inverted, grb, grbw, rgb or rgbw (the last four are addressable). LED control: mqtt, status, motion, count, or output (follows the output numbered byoutput). Input type: pullup, pulldown or floating, with_inverted for active-low. Output type: output, output_inverted, or high/low for a pin that's just held at that level. An output's input is the 1-based input that controls it. power takes ESPHome's hlw8012 values (a cse7766 needs only rx); sel_inverted matches ESPHome's inverted on sel_pin. eth is the Ethernet Type's option number.
Flashing
Section titled “Flashing”ESPreSwitch converts a stock plug to ESPresense over WiFi, no disassembly needed. It installs the full ESPresense image, bootloader and partition table included, so the plug ends up on the same flash layout as any other node. It has been tested on stock firmware v2.7; newer versions are untested, so don’t accept SwitchBot firmware updates before converting. If the OTA route is closed, you’ll need serial, and the case is welded shut.
Plugs converted earlier with SwitchbOTA still have Tasmota’s bootloader and partition table. ESPreSwitch moves them to ESPresense’s layout over MQTT, without Bluetooth: see Plugs already running ESPresense.
- The relay is output 1. It shows in Home Assistant as a switch named Relay, and MQTT
espresense/rooms/<room>/output_1/settakesON,OFForTOGGLE. The button toggles it, and after a power cut it returns in its last state. The white LED follows the relay; the other shows status. - Power monitoring uses the BL0937 with digiblur’s ESPHome calibration (
voltage_divider1450,current_resistor0.0011). Reports power, voltage, current and energy every 10 s. SEL is inverted here (sel_inverted: true, as in that config). - Always-on loads such as a robot vacuum dock: set the output to
"power_on": "on", "input": 0. The plug then always powers up on, and a bump of the button no longer cuts the dock. Home Assistant can still switch it, and it still reports power.