Philips Hue Bridge direct API Control [No custom DTHs]

conditions
variables
light
motion

#1

I previously used a great custom Smartapp/DTH developed for the Philips Hue bridge system. However, I found that the pace of development updates did not keep up with the official ST development cycle. One great example of this was the ability of the custom smartapp to update hue bulb status (nearly instantly vs polling), and if the custom smartapp became unstable it meant that I had to manually remove over 50 bulbs, 20 groups, and 25 scenes. After the 4th time this happened following an ST firmware update, and I spent over 8 hours re-installing this feature, I decided to find another solution!!! In addition, I found it extremely annoying that the ST official app/SuperLAN implementation did NOT offer native support for groups and scenes. I absolutely love to use groups and scenes vs individual bulbs because of the uniform ability to use transition effects, colors, bri, alert, effects and/or new bri_inc abilities of the hue bridge simultaneously (and in perfect sync). I am providing the example below that demonstrates how to directly interface the HUE API through your local LAN courtesy of @ady624’s awesome WebCoRE platform .

Pics of “Motion Sensors” in WebCoRE portal. These are Philips Hue lights/groups used in combination with an ST Motion Sensor; not individual bulb devices imported into WebCore. This example piston emulates a philips hue motion sensors function which results in a seamless transition effect:

Motion triggered (Basement & Dining Sensor)) and Philips Hue light group turned on:


Motion triggered (Basement & Garage Sensor)) and Multiple Philips Hue light groups turned on:

No Motion triggered and all Philips Hue groups turned off:

WebCore Example Piston: Import piston using code below [5iato]

Note: You must create 2 separate global variables named “@hueBridgeID” and “@hueBridgeUser” to use this piston. These are the same credentials that you will find when accessign your Philips Hue Bridge locally. I use the Windows PC application “WinHue 3” to make this process much easier to identify scene, group, and whitelist user keys or IDs used by the Hue Bridge. The WinHue PC Application ca be downloaded for free at: https://hyrules.github.io/WinHue3/ – Please consider donating to Hyrules for the awesome work he has done on this app!


#2

Hi

So does this piston make bulbs come on at the same time and as fast as if I was using the Hue bridge?

My issue with Hue bulbs and sensors setup through a piston, is that they take some time turning on (not as fast as through the Hue bridge) and the bulbs come on one by one.

The above issue leads to very low WAF.


#3

I do not run the setup that you describe for the very reasons you cited (i.e. popcorn effect, cloud delay). This piston will solve the “popcorn effect” by controlling groups rather than individual lights. However, your mileage may vary regarding the motion delay which is introduced by the ST cloud (assuming that you are using ST motion sensors). I eliminated the delay for motion sensors by installing Philips motion sensors vs ST motion sensors altogether. The “pro” for this approach is that you are no longer reliant on ST’s cloud and all motion sensors will run locally without internet. The “con” is that you cannot control Philips motion sensors through STs interface. I was able to overcome this “con” by creating custom rules for my motion sensors.

Hope this helps… If in doubt about whether it will suit your purposes go ahead and try it! Tell your wife it was my fault if it doesn’t work as expected :rofl:


#4

Ok. Thanks.

I will go back to Hue bridge then, but maybe try your piston other things


#5

@blong I will give this a go anyways. A couple of questions though:

  1. I am using Philips sensors. Are they to be connected through The Hue Hub or directly to ST to control them?
  2. Where do I find “@hueBridgeID” and “@hueBridgeUser? I installed Winhue (looks awesome by the way) but cannot seem to find them, but is it any of these:
  3. (and this is an even more noob question, sorry) What is this part for:
    image

Hue bulbs turning on one after another
#6

1.) Must be connected to Philips Hue Bridge.
2.) See directions below:

a.) In WinHue, Select “Gear” icon as follows (maximize window to see this window)
winhue%20settings

–> IP Address is @hueBridgeID
Bridge%20Settings

b.) In WinHue, Select “People” icon as follows (maximize window to see this window)
winhue%20settings

–> Key is @hueBridgeUser (Add new user for WebCoRE)
User%20ID

c.) To see group/room IDs in WinHue select: FILE | SETTINGS | VIEW SETTINGS
Show%20ID

3.) These settings are WebCoRE specific. Disabling “automatic piston state” allows me to update my custom piston status, and disabling “command optimization” gives fine-grain control over which commands that WebCoRE will or won’t execute. I wanted to be certain that all of my commands were sent to the Hue Bridge and not left to chance.


#7

Thanks this is fantastic. Much appreciated


#8

@blong Thanks yet again but must admit that maybe I should have signed up for the “intermediate course” and not the advanced one. To put it short: I have absolutely no idea of what I am doing :wink:

I can now find the right ID´s and such due to your excellent description but I have no idea what to do with them :smiley:


#9

After you import this piston, you must create 2 separate global variables named “@hueBridgeID” and “@hueBridgeUser” to use this piston. Click hyperlink above to read WebCoRE Wiki concerning different variables and how to create them. You can just as easily create local variables named “hueBridgeID” and “hueBridgeUser” for this piston. The reason that I created global variables is because I am using these credentials in multiple pistons, and didn’t want to be repetitive.