Skip to content

Displaying Home Assistant sensors in the Macbook Pro's touch bar using BTT πŸ€–πŸ’»

License

Notifications You must be signed in to change notification settings

basnijholt/home-assistant-macbook-touch-bar

Repository files navigation

home-assistant-macbook-touch-bar

Displaying Home Assistant sensors in the Macbook Pro's touch bar using BTT.

See this Reddit thread and this topic on the Home-Assistant forum.

Requirements

Install a button widget

  1. open BetterTouchTool
  2. select Touch Bar (⌘1)
  3. click on (+) sign
  4. at "Select Trigger" β†’ "Touch Bar Widgets" β†’ "Shell Script / Task Widget"
  5. at "Launch Path" leave /bin/bash and at "Parameters" leave -c
  6. at "Script" add FULL_PYTHON_PATH PATH_TO_WIDGET OPTIONAL_ARGUMENTS, for the full Python path, use which python, e.g., /usr/local/bin/python3 ~/Downloads/home-assistant-macbook-touch-bar/widgets/switch.py --entity_id light.living_room_lights --icon fa-lightbulb-o.png

If the widget has an action associated with it, continue

  1. at "Assigned Action(s)" click on "Click here & select action β–Ί" β†’ "Controlling Other Applications" β†’ "Execute Shell Script / Task"
  2. repeat step 5. and 6.
  3. pass the right argument (e.g., add --toggle) to the script

Install a slider widget

See the instructions in

and use the BTT interface to choose an icon.

Examples

To add a light buttons like use the widgets/switch.py script like (trigger script)

~/miniconda3/bin/python ~/Downloads/home-assistant-macbook-touch-bar/widgets/switch.py --entity_id light.living_room_lights --text "πŸ›‹οΈπŸ’‘"

and (action script)

~/miniconda3/bin/python ~/Downloads/home-assistant-macbook-touch-bar/widgets/switch.py --entity_id light.bedroom_lights --text "πŸ›ŒπŸ’‘" --toggle

About

Displaying Home Assistant sensors in the Macbook Pro's touch bar using BTT πŸ€–πŸ’»

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published