home-assistant-macbook-touch-bar
Displaying Home Assistant sensors in the Macbook Pro's touch bar using BTT.
See this Reddit thread.
Requirements
- Macbook Pro with touch bar (obviously
๐ ) - install BetterTouchTool
- clone/download this repository
- rename widgets/secret-example.py to
widgets/secret.py
and fill in a token and URL
Install a button widget
- open BetterTouchTool
- select Touch Bar (โ1)
- click on (+) sign
- at "Select Trigger" โ "Touch Bar Widgets" โ "Shell Script / Task Widget"
- at "Launch Path" leave
/bin/bash
and at "Parameters" leave-c
- at "Script" add
FULL_PYTHON_PATH PATH_TO_WIDGET OPTIONAL_ARGUMENTS
, for the full Python path, usewhich python
, e.g.,/Users/basnijholt/miniconda3/bin/python /Users/basnijholt/Downloads/home-assistant-macbook-touch-bar/switch.py --entity_id light.living_room_lights --icon fa-lightbulb-o.png
If the widget has an action associated with it, continue
- at "Assigned Action(s)" click on "Click here & select action โบ" โ "Controlling Other Applications" โ "Execute Shell Script / Task"
- repeat step 5. and 6.
- pass the right argument (e.g., add
--toggle
) to the script