[DEPRECATED] [PORT] Hue B Smart

@xap one more question I forgot to ask. Can you think of any reason why one of my lights seems to miss off commands when using RM occasionally? I have a couple of RM rules that turn off more than one light after a motion timeout and for whatever reason it seems one of the lights stays on after the rule completes.

As a work-a-round I created "off scenes" for areas that were troublesome which seems to resolve it, but I thought it was strange. I think I saw the same thing happen with the HE built-in integration too.

The two rules that were't working as expected are both turning off a "group" and a single bulb (not part of the group), not sure if that would matter.

Just tried to add a new scene using the latest code, no bulbs or scenes are being discovered in the setup menu. Perhaps the change in polling didn't work as planned?

Yep, something is definitely wrong now, it found my bulbs and groups, no scenes, then lost all but the groups.

I'm thinking a roll-back would be a good idea? Unfortunately I don't have the code for the pre-polling change can you provide a copy?

There ya go, it's in github.

@xap thanks for the quick post, any idea what might have caused setup to go haywire with the change in polling method?

Truth is, it's not my code. I just ported it. I'm just hacking at it to make it behave a bit better. Ideally I would write my own integration from scratch but it currently does what I need it to so I'll just leave it as is for now.

Got ya, well I hope that HE developers take a look at this code and perhaps use it as an example of how they could improve the stock integration.

BTW got an error when I tried deleting a scene from hue b smart after the code change:

app:49722018-11-22 10:29:09.119 am errorjava.lang.NullPointerException: Cannot get property 'label' on null object on line 575 (chooseScenes)

Seemed to work fine, but thought you'd want to know anyway.

Thanks for porting (I'm the original coder). Planning on getting onto this platform soon. Let me know if you have any questions.

4 Likes

Definitely looking forward to any input you can give with regards to optimization of your code for the HE platform. @xap has done a great job, but I'm sure your expertise could help even more.

No probs. It could probably do with the more knowledgeable touch of the original author, you may want to re-port it as I simplified a fair bit for my purposes. :slight_smile:

1 Like

This seems to be working great but I can't use flash with rule machine. Anyone else have that problem? All of the flash buttons work on the device page but when I set rulemachine to flash a single bulb or group it gives the error "Command 'flash' is not supported by device"

You need to create custom command with RM either flash or flash notify (notify will flash a specific number of times as set in device page)

1 Like

That did it. Haven't tried custom commands yet. Very cool. Thanks!

1 Like

@xap after going back to the stock hue integration for a bit, I'm back! Can't live without the hue scene integration or the advanced flash commands! Any new development with the port since the last update or did @infofiend offer any new optimization tips?

Only issues I can see at this point is that I usually have to re-discover the scenes and bulbs if I go go back into the app to add new scenes or bulbs (for whatever reason the groups seem to remain).

Other than that just want you to know how much I appreciate the work you did with this and look forward to future development.

I finally got around to installing this on my test hub. Nice! Hue Scene access was my main reason. If there's any way to show the room name in addition to the scene name, that would help in identifying scenes quite a bit (and who knew my v1 Hue apps scenes were still around?!) since bulb number is all I see right now.

A couple other issues compared to the native integration:

  • setLevel(0) turns the bulb on. I think it's somewhat of a Hubitat standard that this should turn or keep a bulb/dimmer off (but any other setLevel will indeed turn it on due to either bulb or Hubitat convention)
  • startLevelChange and stopLevelChange are not implemented, unsurprising since ST doesn't support anything like this

I might take a look at the code when I have a bit more time to see if there's anything I can do. Thank you both for your work on this! (And hopefully Hubitat adds the option for Hue scenes sometime--that's my main interest in this, but I figured I might as well use it for the bulbs too so I don't have more apps than needed polling my bridge.)

(EDIT: The issue noted below has since been fixed.)

FYI, for anyone using this, hub firmware 2.0.7 breaks some of the imports some of the Hue B Smart drivers use, specifically: java.lang.SecurityException: Importing [groovy.json.JsonSlurperClassic] is not allowed. Actually, it tries to import groovy.json.*, and I was hoping that finding the specific class it appears to use would help (it compiles with the * import but throws an error in the logs, Indirect import checks prevents usage of expression). Alas, that still did not help.

I'll probably revert back to the stock Hue integration (never got around to using Hue Scenes like I thought I would), but maybe this could be fixed/addressed on either end.

I updated to 2.0.7 firmware today but noticed right away that my Hue integration wasn't working with the Hue B Smart app. So I reverted back to 2.0.6 firmware for now.

I don't know about others but I actually do use it for the access to Hue Scenes. I'm actually curious why the stock Hubitat integration doesn't support Hue Scenes.

Ah, a fun update present for me :wink: I'll have a look today.

I have pushed an update to Github. This works fine for me with hub firmware 2.0.7. Thanks for the heads-up on the problem.

If it doesn't work for anyone please let me know.

@xap Wow, a quick response on this! Thank you! I can confirm those changes you made fixed it! The Hue B Smart app is now working in 2.0.7

2 Likes

@xap getting this error when adding new scenes from app running latest HE firmware.

dev:57802019-04-03 11:15:33.858 pm errorgroovy.lang.MissingMethodException: No signature of method: user_driver_info_fiend_Hue_B_Smart_Scene_2894.configure() is applicable for argument types: () values: [] (configure)

dev:57792019-04-03 11:15:31.225 pm errorgroovy.lang.MissingMethodException: No signature of method: user_driver_info_fiend_Hue_B_Smart_Scene_2894.configure() is applicable for argument types: () values: [] (configure)

dev:57782019-04-03 11:15:29.367 pm errorgroovy.lang.MissingMethodException: No signature of method: user_driver_info_fiend_Hue_B_Smart_Scene_2894.configure() is applicable for argument types: () values: [] (configure)

dev:57772019-04-03 11:15:27.294 pm errorgroovy.lang.MissingMethodException: No signature of method: user_driver_info_fiend_Hue_B_Smart_Scene_2894.configure() is applicable for argument types: () values: [] (configure)