A native macOS menubar app for controlling your Philips Hue lights. Toggle rooms, adjust brightness and colors, activate scenes, set up global keyboard shortcuts, and automate lights on sleep/wake β all from your menu bar. Built with SwiftUI, zero dependencies.
Philips discontinued the official Hue macOS app years ago, and most third-party alternatives are closed-source, use older APIs, or require a paid license. HueBar is a free, open-source alternative built on the modern CLIP API v2 with real-time updates via Server-Sent Events. It's native SwiftUI with zero external dependencies β just a lightweight menubar app that does what you need.
- π‘ Rooms & Zones β View all your Hue rooms and zones with on/off toggles
- ποΈ Brightness Control β Adjust brightness per room/zone with a slider
- π¨ Scene Selection β Browse and activate saved scenes in a color-coded grid
- π‘ Individual Lights β See and control each light in a room with per-light on/off toggles and brightness
- π¨ Color Picker β Full color wheel and color temperature slider for individual lights
- π Multi-Bridge Support β Connect multiple Hue Bridges and control all your lights from one place
- π Pin to Top β Pin favorite rooms/zones to the top of the list
- π Custom Order β Right-click any room or zone to Move Up/Down/Top/Bottom
- β¨οΈ Global Keyboard Shortcuts β Assign system-wide hotkeys to toggle any room or zone on/off, even when HueBar isn't focused
- π΄ Sleep/Wake Automation β Automatically turn rooms off when your Mac sleeps and back on when it wakes, with optional scene recall
- π Real-time Updates β Live state updates via Server-Sent Events (SSE) from the Hue Bridge
- π Launch at Login β Optional auto-start on login, configurable from the menu
- π Auto-discovery β Finds your Hue Bridges automatically via mDNS and cloud discovery with retry
- π Secure β TLS with Signify root CA pinning, IP validation, credentials stored locally with restricted permissions
- πͺΆ Lightweight β Native SwiftUI, no external dependencies, lives in your menu bar
- macOS 15.0 (Sequoia) or later
- One or more Philips Hue Bridges on your local network
- Go to Releases and download the latest
HueBar.zip - Unzip the file and move
HueBar.appto your/Applicationsfolder - On first launch, right-click β Open (the app is ad-hoc signed, so Gatekeeper will ask once)
git clone https://github.com/jurre/huebar.git
cd huebar
./scripts/install.shThis builds a release binary, wraps it in a .app bundle, code-signs it, and copies it to /Applications. You can then launch HueBar from Spotlight or Finder.
To start automatically on login, toggle "Launch at Login" in the HueBar menu.
swift run- Launch HueBar β a lightbulb icon appears in your menu bar
- The app will search for your Hue Bridge on the network
- When your bridge is found, click it and press the link button on your physical Hue Bridge
- That's it β your rooms and zones appear with toggle switches, brightness sliders, scene selection, and individual light controls
If you have more than one Hue Bridge:
- During initial setup, after pairing your first bridge, any additional discovered bridges are shown β click to pair them too
- To add a bridge later, open Settings β Add Bridge
- Each bridge appears as a separate section in the room list
HueBar supports global keyboard shortcuts to toggle rooms and zones without opening the menubar:
- Click the βοΈ gear icon in HueBar to open Settings
- In the Keyboard Shortcuts section, click Add Shortcut
- Select a room or zone, then press your desired key combination (e.g.
ββ₯L) - The shortcut works system-wide β press it from any app to toggle that room on or off
Shortcuts are registered via Carbon RegisterEventHotKey and do not require Accessibility permissions.
HueBar can automatically control rooms when your Mac sleeps and wakes β great for office lights or desk lamps:
- Click the βοΈ gear icon in HueBar to open Settings
- In the Sleep / Wake section, click Add Rule
- Select a room or zone, then choose a mode:
- Sleep β turn off when Mac sleeps
- Wake β turn on when Mac wakes
- Both β turn off on sleep, turn on on wake
- Optionally select a scene to recall on wake instead of just turning the lights on
HueBar uses the Hue CLIP API v2 for modern resource-based control. No external dependencies β only Apple frameworks:
- SwiftUI β
MenuBarExtrawith.windowstyle for the popover UI - Network β
NWBrowserfor mDNS bridge discovery - Foundation β
URLSessionfor HTTPS communication
Sources/HueBar/
βββ HueBarApp.swift # App entry point, MenuBarExtra
βββ Info.plist # App metadata and permissions
βββ Views/
β βββ MenuBarView.swift # Main room list, navigation, footer
β βββ RoomDetailView.swift # Scene grid + light grid for a room/zone
β βββ LightDetailView.swift # Per-light brightness, color wheel, temperature
β βββ LightCard.swift # Individual light card (on/off, icon, color dot)
β βββ LightRowView.swift # Room/zone row card with gradient background
β βββ SceneCard.swift # Scene card with palette gradient
β βββ ColorWheelView.swift # CIE xy color wheel picker
β βββ ColorTemperatureSlider.swift # Mirek color temperature slider
β βββ SetupView.swift # Bridge discovery & link-button auth flow
β βββ AddBridgeView.swift # Add additional bridges from settings
β βββ SettingsView.swift # Settings (push-navigation in popover)
β βββ ShortcutsSettingsView.swift # Keyboard shortcut management
β βββ SleepWakeSettingsView.swift # Sleep/wake automation management
β βββ KeyRecorderView.swift # Key combo capture (NSViewRepresentable)
βββ Models/
β βββ Room.swift # Room model + API response types
β βββ Zone.swift # Zone model
β βββ GroupedLight.swift # Grouped light state (on/off, brightness)
β βββ Light.swift # Individual light (on/off, color, temperature)
β βββ Scene.swift # Scene model with palette colors (CIE XY + mirek)
β βββ EventStream.swift # SSE event stream models
β βββ HueResponse.swift # Generic API response envelope
β βββ ResourceLink.swift # API resource reference
β βββ SharedTypes.swift # Shared type definitions
β βββ BridgeCredentials.swift # Bridge connection credentials (id, IP, key, name)
β βββ HotkeyBinding.swift # Keyboard shortcut model
β βββ SleepWakeConfig.swift # Sleep/wake automation config
βββ Services/
β βββ HueBridgeDiscovery.swift # mDNS + cloud bridge discovery with retry
β βββ HueAPIClient.swift # CLIP v2 API client with SSE streaming
β βββ HueAuthService.swift # Link-button authentication
β βββ BridgeManager.swift # Multi-bridge coordinator
β βββ BridgeConnection.swift # Per-bridge connection lifecycle
β βββ EventStreamUpdater.swift # Real-time state update handler
β βββ SSEParser.swift # Server-Sent Events parser
β βββ RoomOrderManager.swift # Room/zone pinning & ordering persistence
β βββ CredentialStore.swift # Credential + bridge storage
β βββ HotkeyManager.swift # Global keyboard shortcut registration
β βββ SleepWakeManager.swift # Sleep/wake notification observer
βββ Utilities/
βββ ColorConversion.swift # CIE xy / mirek β SwiftUI Color conversion
βββ ArchetypeIcon.swift # SF Symbol mapping for Hue archetypes
βββ HueBridgeRootCA.swift # Bundled Signify/Philips Hue root CA certs
βββ TrustDelegate.swift # TLS validation via Signify root CA pinning
βββ IPValidation.swift # Bridge IP address validation
Sources/HueMockBridge/ # Mock bridge server for UI development
βββ HueMockBridgeMain.swift # CLI entry point (--port, --name, --rooms)
βββ MockBridge.swift # In-memory bridge state & API handler
βββ MockHTTPServer.swift # Lightweight HTTP server (Network framework)
Credentials (bridge IPs and application keys) are stored in ~/Library/Application Support/HueBar/bridges.json with owner-only file permissions (0600) in an owner-only directory (0700). Legacy single-bridge credentials are automatically migrated.
We use a file rather than the macOS Keychain because the Keychain prompts for access on every launch with unsigned/ad-hoc signed builds β which is the default when building from source with swift build. The Hue application key is a local network token that only works to communicate with your specific bridge on your LAN; it is not a cloud credential or password.
Other security measures:
- TLS root CA pinning β the bridge's TLS certificate is validated against the bundled Signify/Philips Hue root CA certificates, preventing MITM attacks without requiring trust-on-first-use.
- TLS custom validation scoped to bridge IP β only the known bridge IP uses the bundled root CAs; all other HTTPS connections (e.g. cloud discovery) use normal system CA validation.
- IP validation β bridge IPs are validated as IPv4/IPv6 addresses using
inet_pton, preventing URL injection via hostnames or paths. - Resource ID sanitization β API resource IDs are validated against UUID format before use in URL paths, preventing path traversal.



