macOS 13+ · Free · Open Source

Smart Battery
Management

MacSwit automatically controls your smart plug based on battery level, keeping your Mac within the optimal charge window to extend battery lifespan.

Set & forget Menu bar app Native notifications
0%
Optimized charging between 5% and 100%

Everything your battery needs

Automated smart plug control with the precision of native macOS integration.

Automatic Charging

Set your charge window and let MacSwit handle the rest. Smart plug toggles automatically based on real-time battery level.

Smart Notifications

Receive native macOS notifications whenever the plug state changes, so you always know what's happening.

Smart Plug Support

Currently supports Tuya-compatible smart plugs worldwide. Open-source and extensible — new plug providers can be added by the community.

Keychain Security

All credentials are stored securely in the macOS Keychain — never in plain text or UserDefaults.

Smart Command Dedup

Never sends the same command twice — the plug stays in its current state until a threshold crossing triggers the opposite action.

Launch at Login

Start automatically when you log in. Once configured, MacSwit works silently in the background from the menu bar.

Three simple steps

Plug your Mac charger into a smart plug, configure your thresholds, and let MacSwit take over.

1

Set your charge window

Define the battery percentage range where you want your Mac to stay. For example, start charging at 80% and stop at 100%.

2

Connect your smart plug

Enter your smart plug credentials and device ID. MacSwit securely stores everything in the macOS Keychain.

3

Sit back and relax

MacSwit monitors your battery and automatically controls the plug — turning it on when low and off when fully charged.

Designed for macOS

A native SwiftUI interface that feels right at home on your Mac, with a clean dark-mode design.

Battery
80% 100%
Start charging at
Turn the plug ON when battery drops to this level
80%
Stop charging at
Turn the plug OFF when battery reaches this level
100%
Check interval
How often to check battery level
5 mins
Office Plug
Tuya
Home Desk
Tuya
Add Plug
Region
Select your Tuya cloud region
Central Europe
Access ID
p8f3xk••••••••
Access Secret
••••••••••••••••
Device ID
bf63e2••••••••
DP Code
switch_1
Test ON Test OFF Verify Token
Token verified successfully
Enable MacSwit
Turn on/off automatic battery monitoring and plug control
Launch at login
Automatically start MacSwit when you log in
Switch off on shutdown (Experimental)
Send switch OFF command when Mac is shutting down
MacSwit
Smart plugged battery management for your Mac
v1.0
Buy me a coffee
Support the developer

Configure your charge thresholds with intuitive sliders and a real-time battery visualization.

Get started in minutes

From download to automated charging in four straightforward steps.

01
Install MacSwit

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.

02
Set battery thresholds

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.

03
Connect your smart plug

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.

04
Test and enable

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.

MacSwit

Drag to Applications and launch.
MacSwit lives in your menu bar.

87% ← menu bar

Charge Window

80%
ON
100%
OFF
Below 80%
Plug turns ON
At 100%
Plug turns OFF
Your Mac
Cloud API
Smart Plug

Credentials stored securely in
macOS Keychain

You're all set!

MacSwit is now monitoring your battery
and controlling your smart plug automatically.

Test ON ✓ Test OFF ✓ Token ✓

What you need

MacSwit requires a few things to get started.

macOS 13+

Requires macOS Ventura or later with a MacBook battery.

Smart Plug

A supported smart plug connected to your charger. Currently Tuya-compatible plugs are supported.

Cloud IoT Account

An account with your plug provider (e.g. free at iot.tuya.com) for API credentials and device access.

Extend your battery's
lifespan today

Download MacSwit for free and take control of your Mac's charging cycle.

Download MacSwit