[UPDATED 4/19/17] Hue B Smart (Smart and FAST Hue Lighting)

hue
smartapp_lighting
dth_lighting
scenes
groups

(Tony - SmartThings Unpublished Contributor ) #1

HUE B SMART
Hue B Smart - total control of Hue Bulbs, Groups, Scenes, and more!

This is a follow-up to my earlier Hue Connect Service Manager called Hue Lights Groups Scenes (oh my). This version has ability to integrate & control all of your (i) Hue Color Bulbs, (ii) Hue Lux Bulbs, (iii) Hue Color Groups, (iv) Hue Lux-Only Groups, (v) White Ambience Bulbs and (vi) Hue Scenes.

It is very fast and responsive (whether controlling a bulb, group, or a scene). It is a complete overhaul from the HLGS app, so if you are switching from that app, you will unfortunately need to start over. A PITA, yes, but I’m sure that you’ll be very happy with the end results.

Installation
To install, you will need to import the Hue B Smart app AND all of the relevant DTHs into the IDE. If you only have Hue Color bulbs, then you will need to import (i) the bridge DTH, (ii) the Hue Bulb DTH, (iii) the Hue Group DTH, (iv) and the Hue Scenes DTH. If you also have Hue Lux bulbs, then you will also need to import (v) the Hue Lux Bulb DTH and (vi) the Hue Lux Group DTH.

If you need to create / delete Hue groups or Hue scenes, you will need to use either the Philips Hue app (download here) or the CLIP API debugger (instructions for the Philips Hue CLIP debugger can be found here.

You can update the level, hue, and saturation settings for an existing scene by clicking the “Update Scene” tile in any Scene momentary device.

Scenes
As in the HLGS app, scenes are momentary devices. A new feature is the “setToGroup” function for scenes. This function (which you can use in CoRE) allows you to apply the selected scene to a single Group – rather than to all of the bulbs in that Scene. This means that you do not need to set up individual scenes for each Room / Group, thus drastically reducing the number of scenes you need.

For example, I have 25 Hue lights in my house. I set up a single scene for each of my location modes (e.g., “Morning”, “Daytime”, “Nighttime”, “Late”, etc.). I then set up a CoRE Piston for each room of my house, and when the appropriate conditions are met for each room, I use the same Scene momentary device as the action, calling the “setToGroup” function and use that room’s group number as the parameter. My Living Room group has the groupID of “1” (each Group device displays its groupID number), so to apply the Morning Scene only in my Living Room, I select the “Morning” momentary switch, use the “setToGroup” task, and set Parameter #1 (type Number) to the value of 1. I then limit that action to execute only when my house is in Morning mode, and repeat this for each of my modes.

In this way, I really don’t use the groups themselves at all – they are just parameters for how / where I want my Scenes to work.

Of course, if I want any scene to work on all of the lights, I just push that Scene’s momentary button (scenes, by default, use a Group of “0” - which the Hue Hub interprets as “all lights”).

Features

  • Compatibile with CoRE, Echosistant, and ActionTiles
  • setToGroup() and setTo2Groups() functions reduce the number of scenes you need
  • Control color via Hue & Saturation, via Hex, or via XY coordinates. All interactions between the DTH and the Hue Hub are standardized on XY coordinates.
  • Bulb status now immediately updated from a Group (or Scene) action
  • ColorTemperature control
  • Flash (Alert)
  • ColorLoop
  • Light and Group DTHs remember changes to color / colorTemperature while device is off. Those settings will be applied when bulb is turned on

Please let me know if you run into any problems, or have any suggestions. The code is on GitHub: https://github.com/infofiend/Hue_B_Smart

And, if you feel like making a donation for these community efforts, it would be greatly appreciated: https://www.paypal.me/infofiend . Thanks!

-Tony


[BETA] Hue (Re)Connect - with scene handling
[UPDATED as of March 24, 2016] Hue Lights & Groups & Scenes (OH MY!)
CoRE? SceneMachine? Other? Looking for Synchronized Dimmer
Best way to change intensity and colors in bulbs
Creating a scene with Philips Hue and WebCore
[UPDATED SEPT 2018] Hue B Smart (Groups & Scenes) - Remove Popcorn Effect!
[RELEASE CANDIDATE] CoRE (Community's own Rule Engine)
ST on Cellular backup, how to connect to hue Bridge?
Hue delay between bulbs?
[DEPRECATED] Ask Alexa 2.2.3
[UPDATED as of March 24, 2016] Hue Lights & Groups & Scenes (OH MY!)
[RELEASE] Ask Alexa
[DEPRECATED Thread: visit community.webcore.co for assistance] webCoRE - Piston Design Help (ask your fellow members for assistance)
[DEPRECATED] Ask Alexa 2.2.3
[DEPRECATED] EchoSistant Version 4.0 ~ Evolved
(Tino Race) #2

I’m very excited by this development. Well done on this new app and I look forward to having a play this afternoon!
Can you edit your initial post to include the link to the code please? I can’t see it.

Does this app now support scenes from the Gen 2 app?

How does the app handle scenes with duplicate names, e.g. Relax in Living Room, Relax in Kitchen?


(Tony - SmartThings Unpublished Contributor ) #3

[> quote=“Tino_Race, post:2, topic:60672”]

Can you edit your initial post to include the link to the code please? I can’t see it.

Lol. I knew I forgot something… :sunglasses:

Does this app now support scenes from the Gen 2 app?

Yes. And in fact, I recommend using Gen 2 scenes because they contain more info (e.g., individual light states). I converted all of my Gen1 scenes to Gen2.

How does the app handle scenes with duplicate names, e.g. Relax in Living Room, Relax in Kitchen?
[/quote]

I would recommend creating a single “Relax” scene for all of the rooms that you use one in. Then use the setToGroup() function to limit the application of that scene to the desired group/room. That said, the app relies on the sceneID and does not rely on what you name your scenes, so it shouldn’t be a problem.


#4

Nice, do I need to delete hue connect and all my bulbs before installing this? Or is it simply to install it with no furter actions regarding old setup?


(Tino Race) #5

I would recommend creating a single “Relax” scene for all of the rooms that you use one in. Then use the setToGroup() function to limit the application of that scene to the desired group/room. That said, the app relies on the sceneID and does not rely on what you name your scenes, so it shouldn’t be a problem.

Unfortunately it is counter to how Alexa works, which is "Alexa, turn on {scene name] in [Room name]

However I still think this is a brilliant feature. I will likely have whole-house Motion-triggered scenes which only switch on in each room, plus room-specific scenes for more colourful variants which I will trigger with Alexa. :grinning:


(Alex) #6

Does it have a DTH for the White Ambience bulbs with the ColorTemperature parameter?


(www.smartukhome.co.uk) #7

Will multiple hue bridges be supported? I know its a huge feature to code in

Edit:
Just looked at the code looks like you based your code around Hue & Improved hopefully multiple bridges still work

Will take a matter of minutes to add I will switch to this code next monday as I have the day off if its not added by then I will do it and do a pull request


(Tony - SmartThings Unpublished Contributor ) #8

That’s actually how I have it. I have 5 daily modes, and have 5 whole-house scenes that are Motion activated. I have a couple more localized scenes - e. g.," dinner" or “working” which only apply to 1-2 rooms. So if I change the mode to dinner, which will cause the kitchen, hallway, and living room to use the “Dinner” scene, I set up the other rooms to still use “Nighttime” scene. Thus, all I ever have to say via Alexa is the Mode.

I have a CoRE Piston that I use to restore to the correct daily mode after I’m done with the localized mode.


(Tony - SmartThings Unpublished Contributor ) #9

Yes, multiple bridges will work.


#11

I like it so far. Thanks for the work putting this together. It would be nice while adding bulbs if they moved from “Available Bulbs” to :“Added Bulbs”. I thought it wasn’t working but figured out it was after going back and doing a refresh.


(Tony - SmartThings Unpublished Contributor ) #12

It should do that. It did when I set up my bulbs. Is that only occurring for you when you set up bulbs - or does that also happen for groups and scenes?


#13

Same behavior with bulbs scents and groups for me. Don’t move to the added group.


#14

Same here. Loading icon shows but doesn’t change them to added. Refreshing will change them like @Michael_D stated. Love the app. Works great


(Marcus) #15

3 Things from my side on this new version:
1st: (RE)Connect, has an option to turn the Hue Scenes off again. There is inside the device handler a switch button called “off” and turnes the scene off again. I tried just copying the function in the device handler but it doesnt work. Can this be added?

Actually, i wonder if it maybe makes more sense to have a scene be a real on/off button, instead of a momentary switch?

2nd: Maybe its just me, but the light states are not as fast as before with the new app. If i turn a scene, the individual lights are not updated. It takes quite a while for the lights to update. Same if you turn on or off a light from HUE App.

3rd: Looks like finally this new app is not “overtaking” any new Zigbee devices anymore… but again, that was probably just me in the first place as it happend with OH My Hue & (RE)Connect.


(Tony - SmartThings Unpublished Contributor ) #16

Maybe. But it almost certainly take more than just copying the function into one of my DTHs. I can take a look. I use a scene called “All Lights Off” that - you guessed it - turns my lights off. Would that work for you in the meantime?

I’ll be adding push light state updating. The current beta only updates the light states on a pull instead of a push basis.

Working on adding Hue Schedules now. Then Hue Sensors. I imagine thats where you’ll see those additional Zigbee devices again. The HLGS app logged everything from the Hue Hub.


(Tony - SmartThings Unpublished Contributor ) #17

Can you two either post or PM me the IDE log of when you add / remove a bulb? Adding / removing a bulb, group, and scene automatically updates on my system so I’m a little confused on why this is occuring for you two. Also - let me know what version of Hue Hub and SmartThings Hub you are using.

Thanks!


(Tony - SmartThings Unpublished Contributor ) #18

Actually, before you bother with all that, try the version I just uploaded to GitHub - I added a submitOnChange() parameter to those pages that may solve it. Let me know.


(Marcus) #19

Maybe. But it almost certainly take more than just copying the function into one of my DTHs. I can take a look. I use a scene called “All Lights Off” that - you guessed it - turns my lights off. Would that work for you in the meantime?

Is it still the case that the scenes from Hub v2 are saved always as “SceneX ON” & “Scene X OFF”?


#20

I can try the new version in a bit. This is what the log gave me when I tried to remove an added bulb. I did not get an error when trying to add a scene I had not added already.

5d6066b5-4c71-4328-a72e-b4f4781b2ca4 10:16:21 AM CDT: error groovy.lang.MissingPropertyException: No such property: errorText for class: script1477149320017198383084 @ line 427

Edit: I refreshed and added a scene and got this:

LogsClear
5d6066b5-4c71-4328-a72e-b4f4781b2ca4 10:18:34 AM CDT: debug Does scene [id:pYvARpdUMM0CVPM, lights:[12, 14], name:Arctic aurora, type:scene] have a schedule using it? scheduleId = null
5d6066b5-4c71-4328-a72e-b4f4781b2ca4 10:18:34 AM CDT: debug adding scene [id:pYvARpdUMM0CVPM, lights:[12, 14], name:Arctic aurora, type:scene]. Are lights assigned? lights = [12, 14]
5d6066b5-4c71-4328-a72e-b4f4781b2ca4 10:18:34 AM CDT: debug Adding pYvARpdUMM0CVPM


#21

That didn’t help me. Same problem of not updating. I am using a V2 Hue bridge and the V2 ST Hub.