MacSwit automatically controls your smart plug based on battery level, keeping your Mac within the optimal charge window to extend battery lifespan.
Features
Automated smart plug control with the precision of native macOS integration.
Set your charge window and let MacSwit handle the rest. Smart plug toggles automatically based on real-time battery level.
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, configure your thresholds, and let MacSwit take over.
Define the battery percentage range where you want your Mac to stay. For example, start charging at 80% and stop at 100%.
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.
Configure your charge thresholds with intuitive sliders and a real-time battery visualization.
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 from the menu bar and go to the Battery tab. Set your "Start charging at" threshold (when the plug turns ON) and "Stop charging at" threshold (when the plug turns OFF). The on-threshold must be at least 5% lower than the off-threshold.
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.
Use the Test ON, Test OFF, and Verify Token buttons 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