This guide is for people with HA and macbooks with BetterTouchTool installed.
You can use your iphone or Apple Watch to control your MacBook in any other way want. Mine’s set up for basic media controls including PlayPause, Volume up/down, and having Spotify start playing either of my 2 most used playlists.
In BTT:
Settings > Web Server > Enable BetterTouchTool Web Server.
Choose which port you want to use. This is the BTT documention for using the web server
Create a named trigger and assign an action.
eg. name: MacPlayPause with Assigned Action: PlayPause.
BTT has a lot of options for actions, including Apple Script, Shell Script and Javascript, so you can do whatever you want.
In HA configuration.yaml:
shell_command:
macbook_playpause: 'curl http://192.168.1.##:PORT/trigger_named/?trigger_name=MacPlayPause'
Just make sure the trigger_name matches exactly with your named trigger.
In automations:
- alias: action_ios_macbook_playpause
trigger:
- platform: event
event_type: ios.action_fired
event_data:
actionName: 'Mac PlayPause'
action:
- service: shell_command.macbook_playpause
Finally, in the ios Companion app > App configuration > Integrations > Actions
Create a new action with the name identical to your automation actionName. Set the text, icon & colours. Save it, exit, and you’re done.