MacSwit automatically controls your smart plug to extend your battery's lifespan. Choose from threshold-based automation, event-driven control, or a hybrid of both.
Features
Automated smart plug control with the precision of native macOS integration.
Choose Threshold mode for battery % automation, Event-Based to control the plug at launch and shutdown, or Hybrid for idle-aware charging.
Receive native macOS notifications whenever the plug state changes, so you always know what's happening.
Currently supports Tuya-compatible smart plugs worldwide. Open-source and extensible — new plug providers can be added by the community.
All credentials are stored securely in the macOS Keychain — never in plain text or UserDefaults.
Never sends the same command twice — the plug stays in its current state until a threshold crossing triggers the opposite action.
Start automatically when you log in. Once configured, MacSwit works silently in the background from the menu bar.
How it works
Plug your Mac charger into a smart plug, choose your mode, and let MacSwit take over.
Pick Threshold for battery % automation, Event-Based to turn the plug on at launch and off at shutdown, or Hybrid for idle-aware charging.
Enter your smart plug credentials and device ID. MacSwit securely stores everything in the macOS Keychain.
MacSwit monitors your battery and automatically controls the plug — turning it on when low and off when fully charged.
App Preview
A native SwiftUI interface that feels right at home on your Mac, with a clean dark-mode design.
Select your power management mode and configure charge thresholds with intuitive sliders.
Setup Guide
From download to automated charging in four straightforward steps.
Download the .dmg file and drag
MacSwit into your Applications folder.
Launch the app — it will appear as an icon
in your menu bar showing your current
battery percentage.
Open Settings and go to the Battery tab. Pick your mode: Threshold (battery % automation), Event-Based (plug on at launch, off at shutdown), or Hybrid (threshold + idle-aware off). Configure your chosen mode's settings.
Go to the Smart Plug tab.
Select your provider (e.g.
Tuya) and cloud region.
Enter your Access ID and
Access Secret from your
provider's IoT platform, then your
Device ID and
DP Code (usually
switch_1). Click
"Save Secret" to store
credentials securely in the Keychain.
In the Smart Plug tab, use the ON and OFF buttons on each plug row to confirm your plug responds correctly. Then go to the General tab and toggle "Enable MacSwit" on. Optionally enable "Launch at login" for a truly set-and-forget experience.
Drag to
Applications
and launch.
MacSwit lives in your
menu bar.
Charge Window
Credentials stored securely in
macOS Keychain
You're all set!
MacSwit is now monitoring your
battery
and controlling your smart
plug automatically.
Requirements
MacSwit requires a few things to get started.
Requires macOS Ventura or later with a MacBook battery.
A supported smart plug connected to your charger. Currently Tuya-compatible plugs are supported.
An account with your plug provider (e.g. free at iot.tuya.com) for API credentials and device access.
Download MacSwit for free and take control of your Mac's charging cycle.
Download MacSwit