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

BitBar V2: Release V3.13 (3/3/2018)

Files Updated:

Please refer to other version update posts above for procedures for updating the required files identified below.
After updating the required files below, you must launch the BitBar Output APP on the ST mobile client and view the new features introduced below if you desire the new functionality and possibly avoid display errors. Please SAVE or press DONE on each screen as applicable.

  1. ST_Python_Logic.py v3.13
  2. BitBar Output App.groovy v3.13

Features:

– Added fuzzy logic to display either a discrete known color name from a hue value of the current device or a color range using the following RGB values and comparisons:

if      (r>=g & g>=b) {colorRGBName = "Red–yellow"}
else if (g>r  & r>=b) {colorRGBName = "Yellow–green"}
else if (g>=b & b>r ) {colorRGBName = "Green–cyan"}
else if (b>g  & g>r ) {colorRGBName = "Cyan–blue"}
else if (b>r  & r>=g) {colorRGBName = "Blue–magenta"}
else if (r>=b & b>g ) {colorRGBName = "Magenta–red"}

Just updated. Seeing a bit of an issue. I manually updated the Python file and double checked the new version is in my local directory but the SmartApp is not seeing it as it still says 3.12 is loaded. I wonder if this is the same as an old problem some of us had and we had to run a terminal command. However, the last several updates have been fine for me.

That is definitely strange and it appears that somehow BitBar.app is only seeing the old version! I’m proposing that you could:

  1. Reboot the Mac
  2. Quit the BitBar application (⌘ Q located in the BitBar Preferences section of the displayed BitBar Menu & then Restart BitBar.app in your Mac’s Applications directory

and see if that reloads the current ST_Python_Logic.py 3.13 file.

I have the same setup of files and get…

No cigar.

I have this in Live Logging when I refresh on the Mac:

I have also since tried deleting the py file and refreshing. The BitBar app could see the file was missing. I then recreated the py file and I am back to the error posted above.

And … while just watching the logs I also saw this … unrelated I am sure but just FYI:

10:03:18 AM: error java.lang.IllegalArgumentException: 234255255 is not a valid hex value. @line 456 (doCall)

same problem as @Nezmo

:rage:

:thumbsdown: Error Communicating with ST API: HTTP Error 500: Internal Server Error
Please check your Internet Connectivity and Refresh BitBar again when Online

1 Like

I had a dig around in the code. I can’t see anything obvious.

I placed a updated 3.13a bitbar-output-app.groovy release in the Github repository and let’s try that version for the groovy code. If you are updating the groovy file from the “Update From Repo”, it should be an easy IDE upgrade, the 3.13 ST_Python_Logic.py file is the same version and does not need to be replaced as long as both versions are in sync.

Please run the live logging window when refreshing the BitBar menu on the Mac so I can verify that we are all running 3.13 and capture any error messages that you are seeing in the log.

Here is my log window for a LIFX bulb. I am sorry about the issues in this release, but I can only work with errors when I see them. Thanks for being patient while we sort out how our instances and devices are different.

2c19f740-fb6d-4995-b9b3-e8c7c55f7050  12:49:36 PM: debug getStatus complete
2c19f740-fb6d-4995-b9b3-e8c7c55f7050  12:49:35 PM: debug saturation----------: 97
2c19f740-fb6d-4995-b9b3-e8c7c55f7050  12:49:35 PM: debug hue-----------------: 68
2c19f740-fb6d-4995-b9b3-e8c7c55f7050  12:49:35 PM: debug dimmerLevel---------: 25
2c19f740-fb6d-4995-b9b3-e8c7c55f7050  12:49:35 PM: debug RGBHex--------------: #0803FB
2c19f740-fb6d-4995-b9b3-e8c7c55f7050  12:49:35 PM: debug colorRGBList--------: [8, 3, 251]
2c19f740-fb6d-4995-b9b3-e8c7c55f7050  12:49:35 PM: debug value---------------: off
2c19f740-fb6d-4995-b9b3-e8c7c55f7050  12:49:35 PM: debug name----------------: Rocking Chair Light
2c19f740-fb6d-4995-b9b3-e8c7c55f7050  12:49:35 PM: debug colorRGBName = Blue–magenta--------
2c19f740-fb6d-4995-b9b3-e8c7c55f7050  12:49:33 PM: debug getStatus() called
2c19f740-fb6d-4995-b9b3-e8c7c55f7050  12:49:33 PM: debug BitBar Output App v3.13, ST_Python_Logic.py 3.13 installed @ /Users/sandeke/PycharmProjects/Bitbar/ST/ST_Python_Logic.py

Here you go Kurt …

BitBar app in ST still says py 3.12 is installed.

1 Like

d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:18:08 PM: error java.lang.IllegalArgumentException: Command ‘refresh’ is not supported by device 791f70b3-4fcc-44a6-972e-9695f75ee6e8 of type ‘Colorful Temperature Light Group Device’. Supported commands: [on, off, setLevel, setHue, setSaturation, setColor, setColorTemperature, resetLevel, resetColorTemp, resetSaturation, resetHue] @line 454 (doCall)
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:18:07 PM: debug getStatus() called
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:18:07 PM: debug BitBar Output App v3.13, ST_Python_Logic.py 3.13 installed @ /Applications/bitbar/ST/ST_Python_Logic.py

app still shows 3.12 but I have the 3.13 file in there

86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:23:17 PM: debug thermostatOperatingStateHandler received event
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:21:14 PM: error java.lang.IllegalArgumentException: Command ‘refresh’ is not supported by device 791f70b3-4fcc-44a6-972e-9695f75ee6e8 of type ‘Colorful Temperature Light Group Device’. Supported commands: [on, off, setLevel, setHue, setSaturation, setColor, setColorTemperature, resetLevel, resetColorTemp, resetSaturation, resetHue] @line 454 (doCall)
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:21:13 PM: debug getStatus() called
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:21:13 PM: debug BitBar Output App v3.13, ST_Python_Logic.py 3.13 installed @ /Applications/bitbar/ST/ST_Python_Logic.py

d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:28:56 PM: debug RGBHex--------------: #0500FF
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:28:56 PM: error java.lang.NullPointerException: Cannot invoke method toUpperCase() on null object @line 456 (doCall)
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:28:56 PM: debug saturation----------: 100
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:28:56 PM: debug value---------------: off
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:28:56 PM: debug dimmerLevel---------: 27
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:28:56 PM: debug colorRGBName = Blue–magenta--------
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:28:56 PM: debug saturation----------: 97
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:28:56 PM: debug hue-----------------: 86
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:28:56 PM: debug colorRGBList--------: [255, 7, 215]
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:28:56 PM: debug RGBHex--------------: #FF07D7
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:28:56 PM: debug name----------------: Living Room TV Light
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:28:56 PM: debug value---------------: off
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:28:55 PM: debug getStatus() called
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:28:56 PM: debug colorRGBName = Magenta–red---------
d86daa26-5ea7-4ed8-9542-e5ac24b78f51 1:28:55 PM: debug BitBar Output App v3.13, ST_Python_Logic.py 3.13 installed @ /Applications/bitbar/ST/ST_Python_Logic.py

I removed all my lights/switches and bitbar loads with no issues

FOUND THEM!
Philips Hue Lightstrips and Sylvania Gardenspots. removing them allowed bitbar to load

@jkp. Please update the BitBar Output APP groovy file again (3.13c) in the ST IDE. I have updated this interim version with a check to see if the DTH for the colorCapable device supports the refresh() command. Ugh, I thought that all switch device DTH’s supported a refresh command… :rage:

As far as the error with uppercase??? I searched in the groovy file and did not see any line with that command?

Add back one of your color lights at a time into the BitBarOutput App and save, then refresh the menu bar on the Mac and see if you can get through the error.

I have half a mind to remove any non necessary functions in the groovy code in the ‘456’ section and process them on the Mac Python file. Hair is falling out!

I can see that you are running 3.13 code on cloud and Mac from the live logging. I am not sure why the ST BitBarOutput APP display showing a previous release in the top of the screen. I will hunt that down once I have this code stabilized for all the different RGB devices we have installed.

Will test it out later, I am headed out the door for awhile. Thanks again!

1 Like

Me too. I am going to install a rear view mirror camera kit in the 08’ Civic. Perhaps I can make that work!

Note to Others: The errors are dealing with light devices that support color. If you encounter unrecoverable errors, return to v3.12 in both groovy and python files, or remove any color devices from the BitBar Output App device list.

The issue on the Mac ‘error communicating with ST API’ has gone away for me with the latest BitBar SmartApp update. All working again. Thanks!

1 Like

:smiley: Glad to hear @Nezmo, I always try to test as much as I can, but it seems that working with a variety of devices and manufacturers causes unforeseen errors.

  1. Do you have all your color capable devices reporting and setting colors accurately from the macOS Bitbar menu?
  2. Did the BitBar versions match what you are running in the ST Mobile BitBar GUI?

I think I still have some tweaks and bugs to work on, especially with adding checks to make sure that switch devices can accept set levels like, dimmer, hue, saturation, etc. I was going under the assumption that a color capable device had all those basic attributes, but apparently not.

1 Like

updated and all is good now. thanks!

1 Like

I can confirm this is good now.

I’ll let you know later. I tried some testing but ST in general seems to be acting up (laggy) so will try later.

Thanks again Kurt.

1 Like

Kurt, I see there’s another update but you haven’t posted anything on it. Do you recommend we update?

1 Like

Good catch @Nezmo. Thanks for keeping me honest!

BitBar V2 v3.13d Additional Checks for Color Capable Set Commands (3/4/2018)

** This minor version release is the ongoing effort to catch some of the nagging bugs that were introduced when BitBar V2 3.13 added support for color capable devices.

  • Added additional validation checks for set commands to color capable devices which will resolve some SmartThings DTH’s that do not support selected common set commands; eg. setColor() and setSaturation().
  • In this minor release, one can inadvertently try to change the color or saturation level from the macOS BitBar menu, but these settings will be ignored when sent to SmartThings if the DTH does not support these commands.

** In a future release, menu SET choices for color capable devices will only display valid commands. For example, if saturation or hue is not supported, the menu will not display these.

3 Likes

I have updated to the newest version.
I get the error at the moment1

I think that means you have copied the web html version of the python code rather than the raw code of the st_python_logic.py …

Can you check that?

2 Likes