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

What would prevent it from logging? I am on the live logging screen and I see other events and log messages from ST but nothing from your app when I set up the API?

Never mind I figured it out, it doesn’t show the urls in the log until you hit save. That key bit of info eluded me.

1 Like

I keep getting :thumbsdown: Error Communicating with ST API: HTTP Error 500: Internal Server Error

Please check your Internet Connectivity and Refresh BitBar again when Online.

64da044f-d995-43f5-9555-e8fea143dbf5 2:12:29 PM: error java.lang.NullPointerException: Cannot invoke method negative() on null object @line 413 (doCall)

64da044f-d995-43f5-9555-e8fea143dbf5 2:12:29 PM: debug getStatus() called

64da044f-d995-43f5-9555-e8fea143dbf5 2:12:29 PM: debug BitBar Output App v3.15, ST_Python_Logic.py 3.16 installed @ /Applications/bitbar/ST/ST_Python_Logic.py

@bob5731
I think this error is related to one or more of the SmartThings devices you have specified in the BitBar Output App for a Which Temperature Sensor. This device is apparently not reporting temperature numeric values that BitBar Output App can sort, hence the null value and 500 response. What temperature devices do you have defined?

Would try and remove all temperature sensors you have defined/configured in the ST BitBar Output App, save and refresh your Mac BitBar Icon and see if one of them might be the culprit. If you get BitBar to display OK onthe Mac, you can add one back at a time to see which is the problem.

I had this similar error happen for my Hot Tub temperature sensor, it would output a “–” when temperature was not available, and caused the 500 error…

If that does not work, I will revise the BitBar Output App to catch and handle the null data from the device which would mean that temperature nothing would be displayed for that sensor.

tank you I got it to work.

1 Like

@bob5731 :grinning:

Great. What was the issue or the device that was causing the error?

it was a arduino

1 Like

I can’t get pass Enable Oauth, everytime I click on Update after checking enable Oauth, I get the following :
Access to graph-na04-useast2.api.smartthings.com was denied
You don’t have authorization to view this page.

Try again using incognito mode on your browser. The issue you are hitting is a known one and not related to the BitBar app.

2 Likes

I use Incognito view on Mac Chrome browser anytime I need to make changes to a device handler or oauth. Not sure why ST is so weird about Google Chrome, but using Incognito mode works!

1 Like

Thanks for the quick answer. Incognito mode did the trick

2 Likes

Similar error to some above on new install "couldn’t posix spawn error 8 "
I read about possibly mistakenly copying the files as HTML (which I also had)

so now I have taken the raw text from all 3 files into textedit and then saved it into the correct place (by the way I CREATED the folder ST inside the plugin folder to put the 2 files inside…is that correct)
2 files inside the ST folder , one outside…I also did the terminal commands on the 2 files…
Still no go…one thought…textedit of course messes up the file suffix, which I had to manually rename on all 3 files after install…is that an issue

anyway , not working for now !

Thanks

Bill P

@wakevortex,

I wish this BitBar installation would be many times easier as many of the steps can cause frustrating cryptic error messages. Hang in there, it will work.

I just checked the ‘ST_Python_Logic.py’ python file on BitBar Github and noticed that, for some unknown reason, it is missing the required ‘#!/usr/bin/python’ header. Please click on this link to display the python code and copy is completely into the python file.

Here are what my BitBar macOS files look like when I verify them in macOS Finder. Please verify that your copies are named as I have them shown in the pics below and that the files are pure Python code and not anything else added.

Thanks Kurt…
verified that file names are correct (screenshot attached) also redid the raw code and pasted into the python file…same issue…
Could location be an issue? …mine is in my users/name directory in a new folder called BITBAR

also just checking my config file looks correct (re where quotes and spaces are in the urls) …I changed a few numbers in this post in case I shouldn’t be positing the real one LOLOL

[My Section]

################################################################################################

USER INPUT

Enter your SmartApp URL and Secret below

Example Below, Double Quotes are Optional, https:// and trailing ‘/’ is required

smartAppURL = “https://graph.api.smartthings.com:443/api/smartapps/installations/xxxxx-xxxx-xxx/

################################################################################################

smartAppURL = “https://graph-eu01-euwest1.api.smartthings.com:443/api/smartapps/installations/xxxxxxxxxx/

secret = “xxxxxxxxxx-xxxxxxxxxx”

################################################################################################

END USER INPUT

################################################################################################

thanks for the help !

Bill P

Arg… Had my fingers crossed, but apparently that was not enough. :crazy_face:

OK, let’s try the next step. It’s more techie, so hang in there…

Are you familiar with the macOS Terminal application & basic commands? This application is similar to the Windows CMD window if you were a windows user.

On your Mac Applications folder, locate the Utilities folder and in that folder is the Terminal application. Launch that application and a Unix Terminal window will open up for your commands. You should find your location in the home directory, ie users/name. For example, mine is /Users/sandeke as I have shown below using the PWD command. Using the CD command you can change the directory. I have shown the Unix Unix commands I used to get to the subdirectory that contains the ST_Python_Logic.py file.

In your Terminal window, navigate to the subdirectory that contains the ST_Python_Logic.py file, using the CD command as I have done below for my individual installation.

Kurts-MacBook:~sandeke$ pwd
/Users/sandeke

Kurts-MacBook:~ sandeke$ cd PycharmProjects/Bitbar/ST

Kurts-MacBook:ST sandeke$ pwd
/Users/sandeke/PycharmProjects/Bitbar/ST

Kurts-MacBook:ST sandeke$ ls -l
total 184
-rw-r–r--@ 1 sandeke staff 1046 Apr 19 2017 ST_Python_Logic.cfg
-rwxr-xr-x 1 sandeke staff 88187 Oct 9 07:00 ST_Python_Logic.py

Kurts-MacBook:ST sandeke$ python ST_Python_Logic.py /Users/sandeke/PycharmProjects/Bitbar/ST/

My ST_Python_Logic.cfg file only has the following lines, where ‘55555’ is my personal strings

[My Section]
################################################################################################
## USER INPUT ##################################################################################
## Enter your SmartApp URL and Secret below ####################################################
## Example Below, Double Quotes are Optional, https:// and trailing '/' is required
## smartAppURL = "https://graph.api.smartthings.com:443/api/smartapps/installations/xxxxx-xxxx-xxx/"
################################################################################################

smartAppURL = "https://graph.api.smartthings.com:443/api/smartapps/installations/55555-555555-5555/"
secret = "55555555555"

################################################################################################
## END USER INPUT ##############################################################################
################################################################################################

a little familiar with Terminal (used it anyway in the installation)
Ok navigated to those files
these are the files

-rw-r–r--@ 1 padman staff 1909 9 Oct 13:41 ST_Python_Logic.cfg
-rwxr-xr-x@ 1 padman staff 85963 9 Oct 13:19 ST_Python_Logic.py

is that correct?

Bill P

1 Like

Yes, those are the correct files. You should be able to run the following command and get some output to the screen:

python ST_Python_Logic.py /Users/padman/ST/

assuming the subdirectory that the ST_Python_Logic.py file is named /Users/padman/ST/

if you want to know the subdirectory name where the ST_Python_Logic.py file is located, just issue the terminal command pwd

Here is my example:

python ST_Python_Logic.py /Users/sandeke/PycharmProjects/Bitbar/ST/

72° | font=‘Menlo’ size=14
'—
Hot Tub 0° | font=‘Monaco’ size=11 color=Black color=#666666
Lower Level Freezer 0° | font=‘Monaco’ size=11 color=Black color=#333333
Rocking Chair Light :red_circle: | font=‘Monaco’ size=11 color=Black color=#666666
SleepIQ - Kurt :house: | font=‘Monaco’ size=11 color=Black color=#666666
SleepIQ - Nancy :house: | font=‘Monaco’ size=11 color=Black color=#333333
'—
truncated

The output from the ST_Python_Logic.py program is read by the BitBar APP that you have previously installed from GitHub - KurtSanders/STBitBarApp-V2: SmartThings BitBar for MacOS Menu Bar (Version 2) and designated the subdirectory for BitBar plugins.

Ok my directory is actually **/Users/padman/BITBAR/ST/
and running python ST_Python_Logic.py /Users/padman/BITBAR/ST

produces
File “ST_Python_Logic.py”, line 1
{\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf830
^
SyntaxError: unexpected character after line continuation character

is that any help ? …good luck ! :slight_smile:

Bill P

I think that when you one uses macOS TextEdit, the default setting for filetype is Rich Text File (RTF). You will need to re-edit the ST_Python_Logic.py python file and Make Plain Text, then save the file.