Home Assistant controls for the macOS Touch Bar via MTMR.
- Toggle lights and switches with live state display
- Brightness up/down for all on lights, or scoped to a single light/group
- Color temperature up/down for lights in mired mode
- Trigger scenes, scripts, and automations
- Climate display and setpoint control (±0.5°)
- Cycle and display
input_selectentities - Send push notifications via the HA notify service
- Display live sensor readings (temperature, CO2, etc.)
- Presence indicator - shows your current room when home (bed, desk, etc.) or your HA zone when away
- Open HA in the browser
- Group all HA buttons behind a single
🏠 Homepopover to save space - State caching - buttons read from
/tmp/ha_cache/so opens are instant; cache is busted on toggle so state reflects within ~5 seconds
- Install by cloning the repo then copying
.hato your home directory
cp ha ~/.ha
chmod +x ~/.ha
cp ha_config.example ~/.ha_config- Configure
Edit ~/.ha_config:
HA_URL="https://your-ha-domain.com"
HA_TOKEN="your_long_lived_access_token"Get a token in HA → Profile → Long-Lived Access Tokens.
- Add to MTMR
Copy items from mtmr-items.jsonc into your ~/Library/Application Support/MTMR/items.json, replacing entity IDs with your own. Find your entity IDs in HA → Developer Tools → States.
Reload MTMR.
# Lights
~/.ha status <entity_id> [ShortName] # show state for Touch Bar display
~/.ha toggle <entity_id> # toggle on/off
~/.ha brightness_up # +10% brightness on all on lights
~/.ha brightness_down # -10% brightness on all on lights
~/.ha brightness_up_group <entity_id> # +10% brightness on a specific light/group
~/.ha brightness_down_group <entity_id> # -10% brightness on a specific light/group
~/.ha color_temp_up # warmer (all on lights in color_temp mode)
~/.ha color_temp_down # cooler (all on lights in color_temp mode)
# Scenes, scripts, automations
~/.ha scene_activate <entity_id> # activate a scene
~/.ha script <entity_id> # run a script
~/.ha automation <entity_id> # trigger an automation
# Climate
~/.ha climate <entity_id> # show current temp and setpoint
~/.ha climate_up <entity_id> # increase setpoint by 0.5°
~/.ha climate_down <entity_id> # decrease setpoint by 0.5°
# Input select
~/.ha input_select_status <entity_id> [Label] # display current option
~/.ha input_select_next <entity_id> # cycle to next option
# Sensors and presence
~/.ha sensor <entity_id> [ShortName] # display a sensor value with unit
~/.ha person <entity_id> # show home/away for a person entity
~/.ha where # show current room or zone (edit entity IDs in script)
# Notifications
~/.ha notify "message" [notify_service] # send a push notification (default service: notify)
# Other
~/.ha open # open Home Assistant in the browserThe where command checks person.person_name and cross-references Aqara FP2 bedroom zones. Edit the entity IDs in the where case of ha to match your setup.
| State | Display |
|---|---|
| At desk (FP2 zone) | 💻 Desk |
| In bed (FP2 zone) | 🛏 Bed |
| Elsewhere in bedroom | 🛏 Bedroom |
| Home, location unknown | 🏠 Home |
| At gym zone | 🏋 Gym |
| At work zone | 💼 Work |
| Away | 🚗 Away |
- Tested on macOS 15 with MTMR 0.27
- Requires
curlandpython3(both included with macOS) shellScriptaction type crashes MTMR - actions must useappleScriptwithdo shell script
