[DEPRECIATED] BitBar: Display & Control SmartThings from the macOS Menubar

Thank you @jkp I checked it and it says 1.8, I went to the github (https://github.com/mattw01/STBitBarApp/tree/master/BitBar%20Plugin/ST) and checked it , its also 1.8. Am I checking the wrong location?

Please use my Github version for your SmartThings and Python Code.

I have also placed the new code that fixes the Lock Display bug found by @jkp

2 Likes

The GitHub location for my version of the ST BitBar application has changed to “kurtsanders” and is located here. Please read the README file that I have updated to help you correctly install the complete application, in both the ST IDE and also on your Mac.

  • Please note that this SmartApp requires the separate BitBar application application to be pre-installed.
  • The BitBar application provides the capability for displaying SmartThings devices in the MacOS top menubar and create submenus.

My beta version of the STBitBarApp has many new enhancements and functionality to the original version provided by Matt. Please make sure you have all the correct code 2.x versions of files in my GitHub.

  1. The updated BitBar SmartApp GUI contains all the device and display options.
  2. The ST_Python_Logic.cfg file installed on your PC in the users BitBar directory only contains the two strings with your specific xxx-xxx-xxx-xxx-xxx as shown in the example below:
          smartAppURL = "https://graph.api.smartthings.com:443/api/smartapps/installations/xx-xx-xx-xx-xx/"
          secret = "xxxx-xxxx-xxxx-xxxx-xxxxxxxx"
  1. Users can simplify ongoing version upgrades by:
  • Using the SmartThings GitHub integration for auto-updating the bitbar-output-app.groovy as recommended in Section 1.a. of my ReadMe file

  • Users can Download the latest version of “ST_Python_Logic.py” file by selecting the option at the bottom of the STBitBarApp menu (See Below). Users must move and replace this file in the location of their BitBar directory

  • Users can verify the versions in the About BitBar Output choice in bottom of the STBitBarApp Menu

Planned Enhancements

  1. Simplify Install and Version Upgrades on the Mac
  2. Add Window Shades and Deck Awnings as separate categories
  3. Performance and Code Optimizations
  4. New Stock Market Display App. Users can add their favorite stock symbols via the STBitBarApp config.
  5. New Weather Reports
2 Likes

Thanks a lot @kurtsanders. It’s working now :slight_smile:

Appreciate your help.

By the way, I couldn’t find Github integration in UK site. I don’t think it’s available yet

1 Like

Finally got around to trying this. I’m getting the launch path not accessible error that some one else mentioned. Reinstalled several times with no luck. Any recent installers have any tips?

FYI - section 2 #3 has a typo for “client”.

Had the same problem with the launch path.

Ran the command sudo chmod +x /{replace with proper path}/BitBar/ST.5m.sh

Also, I had problems with the formatting of the Mode and Routines, where it was appearing blank unless I hovered over, so I changed the python script to use the titleColor and the alternating colors instead of black:

# Output Modes
if len(modes) > 0:
    if currentmode['name'] == "Home":
        emoji = " :house: "
    else:
        emoji = ""
    print "Current House Mode: {} {}".format(emoji + currentmode['name'], "| font=Helvetica-Bold size=15")
    print "--Modes (Select to Change) | font=Helvetica-Bold color=" + titleColor + " size=14"
    colorSwitch = False
    for i, mode in enumerate(modes):
        colorText = ''
        if colorSwitch == True: colorText = 'color=#333333'
        if colorSwitch == False: colorText = 'color=#666666'
        if mode['name'] not in currentmode['name']:
            currentModeURL = modeURL + urllib.quote_plus(mode['name'])
            print "-- " + mode[
                'name'], '|font=Menlo ', colorText, ' bash=', callbackScript, ' param1=request param2=', currentModeURL, ' param3=', secret, ' terminal=false refresh=true'
        colorSwitch = not colorSwitch


# Output Routines
if len(routines) > 0:
    print "-- Routines (Select to Run) | font=Helvetica-Bold color=" + titleColor + " size=14"
    colorSwitch = False
    for i, routine in enumerate(routines):
        colorText = ''
        if colorSwitch == True: colorText = 'color=#333333'
        if colorSwitch == False: colorText = 'color=#666666'
        currentRoutineURL = routineURL + urllib.quote_plus(routine)
        print "-- " + routine, '|font=Menlo ', colorText, ' bash=', callbackScript, ' param1=request param2=', currentRoutineURL, ' param3=', secret, ' terminal=false refresh=true'
        colorSwitch = not colorSwitch

Finally, I commented out the repeat display of the menuTitle in the sub menu, just to clean up a little:

if i == mainMenuMaxItems:
    print "{} {} | {}".format(countSensors - mainMenuMaxItems, subMenuTitle, subMenuMoreColor)
    #print "-- " + menuTitle + " (" + str(countSensors - mainMenuMaxItems) + ")"
    subMenuText = "--"
1 Like

This worked for me. However, now I have a different error of “error while communicating with ST API” When I click on it it shows my secret with an â at the end of my secret.

There is no â at the end of my secret in the mobile app or in the .cfg file so I’m not sure where that is coming from.

Try pasting it again, what text editor did you use? I would swear I did it exactly right the first time and it also failed, ended up pasting it a second time and then it worked.

1 Like

thanks for the suggestions.

I used text edit. the inputs were correct.

removing the quotes from the URL and the secret fixed it for me

1 Like

Thanks for the suggestions for mode and routines display @mtuckman.

Version Updates

  1. I have made changes to the python script to use the titleColor and the alternating colors instead of black as enhanced by @mtuckman.
  2. I have added an NEW option in the SmartThings STBitBar GUI to allow the user to select either expanded or compact submenus. This is a boolean setting and the default is ‘False’ (expanded submenus with repeating header title) unless you set it to ‘True’ (Compact, No repeating titles).
  3. Updated the ReadMe file to correct spelling error identified by @mike and reflect not using quotes in the ST_Python_Logic.cfg file for the two strings.

One will need to update the Python script on the Mac as well as update the BitBar Output App in the IDE. For those that have linked this SmartApp to my GitHub, you can easily ‘Update from Repo’ for the BitBar Output App (See Section 1a). To download the latest Python Script to your ‘Downloads’ directory on your Mac, just use the Download option at the bottom of the Menu. Then replace the old version in your BitBar plugins directory.

2 Likes

thanks for maintaining this app. this is great!

I’ve noticed I can’t use certain sensors as the main display sensor. It seems like none of my aeon recessed contacts are available to be chosen. They show up just fine in the contact sensor section. I’m using the ST stock z-wave door/window sensor DTH.

The “Main Display Sensor” should have a device capability of “temperatureMeasurement” which can display the temperature value in the menubar. Here are the temperatureMeasurement devices that show up in my list for the Main Display.

Ok yeah that’s the issue then. Those devices don’t do temperature. I didn’t realize it had to be a temperature sensor.

Do you have any devices that are temperature sensors? Just checking, I did not realize that some people might not have any or want the temp in the top display!

I updated to 2.22 for both smartapp and Logic.py but I do not see the on/off switch for Compact Sub-Menu.

I do, just not a thermostat.

I just named the main sensor display as “Smart Things” and picked a temp sensor that should be representative of the house.

Finally moved over to your version Kurt. I too am now getting the ‘Launch Path’ issue.

Note, I missed the part to watch Live Logging so I have manually typed in my path and secret code from the SmartApp display. I had to do this because even with deleting the app and reinstalling I don’t see anything in Live Logging other than when I set devices up in the app.

So, not sure if I should sudo as suggested above as that seemed to cause another problem.

Kinda stumped.

I was watching live logging and never saw the code there either. I typed mine in manually.

Mine is working great now. I would suggest doing as @mtuckman suggested

Okay. I wasn’t sure as you said you had a new problem after doing that.

You can login to IDE, go to Live Logging. Then open the bitbar output app in ST under Automation: SmartApps, disable API, then reanable API to generate a new URL and secret that will then log in IDE live logging that you can copy/paste.

1 Like