Control Your Smart Home from Your Mac’s Menu Bar

Bitbar Smartthings Monitor Smarthome From Macos

Once you’ve set up your SmartThings network, you can monitor and control every part of your smart home from the SmartThings mobile app. But what about controlling your smart home from your laptop? You’ll learn here how to control your smart home from your Mac when you add a SmartThings drop-down menu to the macOS menu bar. With this menu in place, you can monitor and control the full range of SmartThings sensors, run routines and switch between different SmartThings modes, directly from your laptop.

What is ST BitBar V2?

This tutorial will use the ST BitBar V2 smart application to add a SmartThings menu to a Mac.

You can monitor and control your SmartThings network, using the ST BitBar V2 smart application.

The ST BitBar V2 menu can display a range of data, including temperature, humidity and light levels, plus the status of any presence sensors, locks or smart bulbs that are connected to your network.

You can also use this menu to control your smart devices. For example, cranking up your smart thermostat, turning on lights, or activating locks throughout your smart property. Finally, you can view your network’s current mode, switch between modes, and trigger routines, all with just a click of the mouse.

Installing BitBar

The ST BitBar V2 project consists of three parts:

  • BitBar. This macOS application allows you to customize macOS’s menu bar by adding the output of any script to the Mac menu bar.
  • ST Plugin. This is a collection of files you’ll download from GitHub and place within the BitBar plugin directory.
  • BitBar Output. This is a Samsung smart app that you’ll install from code. Installing an app from Groovy code may sound time-consuming, but since the code has already been written, you’ll just need to copy/paste it into the SmartThings IDE, which is accessible via your web browser.

Let’s start by installing BitBar for macOS:

1. On your Mac, head over to the BitBar GitHub page and download the latest release. There are several files available, so make sure you download “BitBar-v(version-number).zip” – for example, BitBar-v1.9.2.zip.

Make sure you download BitBar in the zip format!

2. Once BitBar has finished downloading, launch it and follow the onscreen instructions to install.

3. Launch the application. When prompted, select a folder where you want to place your ST plugin files and then select “Use as plugin directory.”

4. When prompted, move BitBar to your Mac’s “Applications” folder.

5. Launch the BitBar app; a new icon should appear in your Mac’s menu bar.

6. Give the BitBar icon a click and select “Open at Login.”

How to download software from GitHub

Next, download the BitBar Plugin section of STBitBarApp V2’s GitHub repository. Essentially, you just need the folder pictured below.

We need to download a specific folder from BitBar's GitHub repository.

Head to STBitBarApp V2’s page and click the “Clone or download -> Download ZIP” button.

If you don't have a GitHub account, then it may be quicker to simply download the entire repository.

Unzip it, find the “BitBar Plugin” folder, and drag it to a location that’s easily accessible, such as your Desktop. You can now delete the rest of the “STBitBarApp-V2” folder.

Adding BitBar plugin to your plugin directory

Once you have the “BitBar Plugin” folder on your computer, unzip and open the plugin folder. It should contain an “ST” folder and a “ST.1m.sh” file.

The BitBar plugin contains a ST directory and an ST.1m.sh file.

In a new Finder window, navigate to the folder that you set up as BitBar’s plugin directory in the previous step. Drag both the “ST” folder and the “ST.1m.sh” file into the plugin directory.

Add BitBar Output to your SmartThings app

Next, build the BitBar Output smart application:

1. On your Mac, copy the BitBar Output code.

2. Log in to the SmartThings IDE using either your Samsung account or your SmartThings account.

3. Select “My Locations” and then your smart home hub.

4. In the toolbar, select “My SmartApps.”

5. Select “New SmartApp -> From Code.”

6. Paste your code into the subsequent window.

7. Select “Create -> Update.”

8. Click “Publish -> For Me.”

9. Select “App Settings.”

10. Click to expand the “OAuth” section and then select “Enable OAuth in SmartApp.”

That it’s! You can now access the BitBar Output application via your SmartThings mobile app.

Installing the BitBar Output SmartApp

On your smartphone or tablet:

1. Launch the SmartThings mobile app.

2. In the bar that runs along the bottom of the screen, tap “Automation.”

3. Tap the “SmartApps” tab.

4. Select “Add a SmartApp > My Apps.”

5. Select “BitBar Output App.”

Launch the SmartThings Classic app; BitBar Output App should now be available for you to install.

6. Tap “Please complete API setup > Enable API > Save.”

SmartThings will now display a URL and API that you’ll need to share with the ST Plugin in order to create a connection between the various STBitBarApp V2 components.

The BitBar Output App will now display a URL and a secret.

Make a note of the URL and API values before moving on to the next step.

Connecting BitBar: Add your URL and API secret

You will need to switch back to your Mac:

1. Navigate to the folder that you set up as your plugin directory.

2. Open the “BitBar Plugin -> ST” folder. The “ST” folder should contain a “ST_Python_Logic.cfg” file.

We now need to add the secret and URL to the BitBar plugin's ST_Python file.

3. Control-click “ST_Python_Logic.cfg” and open it in your Mac’s TextEdit app.

You need to add your secret and URL to this file's "smartAppURL" and "secret" fields.

4. Find the following line:

smartAppURL = "https://Paste your URL/"

Replace the placeholder value with the URL generated by the SmartThings Classic application. It will look something like this:

smartAppURL = "https://graph-eu01-euwest1.api.smartthings.com:443/api/smartapps/installations/e4488b”

Next, find the “Secret” line:

secret = "Paste your secret"

Add the API that SmartThings generated in the previous step. For example:

secret = 8642fbba-ca72-4096-96e6

Save your changes, by selecting “File -> Save.”

Make ST.1m.sh and ST_Python_Logic executable

Next, make the files within the “BitBar Plugin” folder executable:

1. Launch your Mac’s Terminal application.

2. Switch to the folder that contains your ST.1m.sh file:

cd /Applications/ST

3. Make the file executable:

chmod +x ST.1m.sh

4. Change the directory again so that the Terminal is pointing at the location of your ST_Python_Logic.py file:

cd /Applications/ST/ST

5. Make ST_Python_Logic.py executable:

chmod +x ST_Python_Logic.py

Configure the BitBar Output app

Now that you’ve completed the setup on your Mac, you can finish configuring the BitBar Output application on your smartphone or tablet:

1. Launch the SmartThings Classic mobile app.

2. Select the “Automation” tab.

3. Make sure the “SmartApps” tab is selected, and then tap “BitBar Output App.”

4. Tap “Select sensors/devices” and choose all the sensors you want to display as part of your Mac’s new SmartThings menu.

You can now select all of the sensors that you want to include in your macOS menu.

5. When you’re happy with your selection, tap “Save.”

You can also add modes, routines, and Smart Home Monitor information to your menu bar by tapping “Select display options” and then pushing one or more of the subsequent sliders into the “On” position.

All of this information will now be displayed as part of your macOS menu bar.

Click the little icon in your Mac's menu bar, and you'll be able to monitor and control your smart home.

Depending on how your network is set up, you may even be able to control your sensors, run routines, and activate different modes directly from your Mac.

As you can see, it will take a while to set it up, but the end result will be worth the effort. In addition to controlling your smart home from your Mac, you can also record sensor data to Google Sheets.

Subscribe to our newsletter!

Get the best of IoT Tech Trends delivered right to your inbox!

Jessica Thornsby

Jessica Thornsby is a technical writer based in sunny Yorkshire. When she isn't obsessing about home automation, smart devices, and all things tech, she enjoys researching her family tree and spending far too much time with her house rabbits.