Philips Hue Plugin

Well first of all you need to famerliarize yourself with how the API works and create a user:

You also need to familiarize yourself with the individual commands for Lights and Groups and also how to query the API for current color and brightness you’ve selected via a phone app, since you need to send that in the on command in the Lua tab.

After getting your username, you can set up some scenes in the LUA tab with something like this one that turns all lights (group/0) off:

os.execute([[curl -H "Accept: application/json" -X PUT --data '{"on":false}' http://HUB_IP_GOES_HERE/api/USER_NAME_GOES_HERE/groups/0/action/]])

and all lights on (group/0):

os.execute([[curl -H "Accept: application/json" -X PUT --data '{"on":true, "sat":140, "bri":254,"hue":8411}' http://HUB_IP_GOES_HERE/api/USER_NAME_GOES_HERE/groups/0/action/]])

An individual group on (group/2):

os.execute([[curl -H "Accept: application/json" -X PUT --data '{"on":true, "sat":219, "bri":199,"hue":3367}' http://HUB_IP_GOES_HERE/api/USER_NAME_GOES_HERE/groups/2/action/]])

An individual group off (group/2):

os.execute([[curl -H "Accept: application/json" -X PUT --data '{"on":false}' http://HUB_IP_GOES_HERE/api/USER_NAME_GOES_HERE/groups/2/action/]])

An individual light on (light 1):

os.execute([[curl -H "Accept: application/json" -X PUT --data '{"on":true, "sat":140, "bri":254,"hue":8411}' http://HUB_IP_GOES_HERE/api/USER_NAME_GOES_HERE/lights/1/state/]])

If you get stuck I can give more examples or help.

Since doing this, I’ve now tied this to some scene controller buttons as a trigger, and depending on the type used… essentially whether it supports a scene being turned on and off from the same button, or whether the scene controller has only an on command, then in the latter case it takes 3 scenes and a virtual switch to make it work like a normal zwave light being toggled on and off.

Despite the convoluted logic of 3 scenes (one to toggle the virtual switch state upon button press) and then two more to fire off the respective on and off commands (triggered by the state of the Virtual switch, it still works near instantaneously and I’m very happy with it.

Anyway, in general using os.execute like this is a bit frowned upon, since if the Hue Hub doesn’t respond, it will hang up your Vera for a little while and potentially cause your Vera luup engine to restart.

Hi

Anyway, in general using os.execute like this is a bit frowned upon, since if the Hue Hub doesn't respond, it will hang up your Vera for a little while and potentially cause your Vera luup engine to restart.
You can try to add "--connect-timeout SECONDS" to curl. If the bridge is unresponsive the curl command will return with timeout and the engine should not restart.

All the Best,

  • Andrei -

[quote=“mcv.andrei, post:442, topic:173293”]Hi

Anyway, in general using os.execute like this is a bit frowned upon, since if the Hue Hub doesn't respond, it will hang up your Vera for a little while and potentially cause your Vera luup engine to restart.
You can try to add "--connect-timeout SECONDS" to curl. If the bridge is unresponsive the curl command will return with timeout and the engine should not restart.

All the Best,

  • Andrei -[/quote]

Thanks, it hasnt hung yet, but I will add that.

For anyone desperate to get this working in UI5, I’ve managed to find a way to link it with a bit of a hack. Will post details if anyone is interested.

After my vera3 died and I bought a veraplus I had to re-link my hub. This code change was needed to link with the newer firmware.

Has anyone gotten this plugin to work on VeraPlus with UI7? Specifically, does it find your GE Link lights?

The VeraPlus uses the v2 version of this plugin. It’s working fine with my Hue hub and it also found my 2 GE-Link bulbs. Which are working. Although I will be retiring them soon as they have an annoying habit of coming on after a power failure. Which (brown-outs) unfortunately we have too many of down here…

After I applied the PR above I was able to pair my 1st gen Hue Hub. I don’t have any GE bulbs though.

After I applied the PR above I was able to pair my 1st gen Hue Hub. I don’t have any GE bulbs though.[/quote]

I too lost GE bulbs after the update and haven’t been able to get the to show again on Vera since.

Hello I have the v2 of the plugin, the new Hue Hub and a Vera Lite with UI7 (firmware 1.7.855): everything works properly, anyway every X hours the plugin changes the IP address of the Hue Hub and the Vera fails to detect it (“Connection with the Bridge could not be established! Check IP or the wired connection!”)
I’ve assigned a static IP address to Hue but every time I need to access the device and manually change the IP address.
Anyone with the same problem?

After I applied the PR above I was able to pair my 1st gen Hue Hub. I don’t have any GE bulbs though.[/quote]

I too lost GE bulbs after the update and haven’t been able to get the to show again on Vera since.[/quote]

I’ll third this. I cannot see my GE bulbs in my Edge buthe Hue bridge Lists them. :cry:

Hello I have the v2 of the plugin, the new Hue Hub and a Vera Lite with UI7: everything works properly, but every X hours the plugin changes the IP address of the Hue Hub and the Vera fails to detect it (“Connection with the Bridge could not be established! Check IP or the wired connection!”)
I’ve assigned a static IP address to Hue but every time I need to access the plugin and manually change the IP address.
Anyone with the same problem? or a solution?

There’s a USE this Ip button. Try and get it to save there. Sometimes the setting seems to not stick.

Have done that a number of times, then the plugin works for a period, and suddenly the ip is missing again :-\

Not really sure what to tell you. Mine accepted it finally and has stayed that way for well over a month now.

Perhaps someone has some other ideas?

Hi

Can anyone help me please ?

How do I change the colour to red (#FF0000) via a Vera scene ?

I have tried using the advanced editor in a new scene, but it does not work and the colour does not change. See attached screen shot, there are two Hue devices in Vera I have tried using both and them individually.

I have also tried using LUA code in the Test Luup Code (LUA) area of Vera, but it doesn’t do anything either.

luup.call_action (“urn:intvelt-com:serviceId:HueColors1”, “SetHueSaturation”, {newHue=40, newSaturation=100}, 150)
luup.call_action (“urn:intvelt-com:serviceId:HueColors1”, “SetColorTemperature”, {newColorTemperature=40}, 150)

The Hue Plug-in for Vera is version 1.28 and I have a gen 1 Philips Hue bridge with one Philips Hue LED light strip.

Also how do you convert hex colour codes for use with hue and this plug-in ?

I used this site here and in the hex field I entered the code for red #FF0000
it then tells me that the HSB values are:

H = 0
S = 100
B = 100

So that is what I tried to use in the advanced area of the Vera scene using “SetHueAndSaturation”

Hue: 0
Saturation: 100

Thanks

It appears there are two Philips Hue plugins in the mios marketplace.

The one I installed a while ago is called “Philips Hue 2”. Which is a different plugin to the one for this thread.

Perhaps I installed the wrong plug-in. What are the differences ?

The one I installed “Philips Hue 2” has been working fine and it gives me a colour wheel picker in the Imperihome mobile app.

Thanks

EDIT: Seems “Philips Hue 2” is now the native plugin from Vera and this plug-in on this thread is an older 3rd party one.

One review on the mios marketplace states:

“Was a good plugin but no longer works with latest UI7 builds. Developer suggests using the Vera HUE plugin. In order to do that, use the wizard to add devices then select ‘Other Devices’ and HUE will appear at the bottom.”

The the IP tat keeps changing. USe your router to bind the IP of the device. Might help.

Is it possible to toggle hue light on / off using a scene?

I installed a Nodon wall switch and would like to be able to toggle hue light on and off using just one push button instead of using two buttons for one light.

In scene creation there is togglestate option for hue in advanced editor but that seems not to work.

[quote=“cw-kid, post:456, topic:173293”]Hi

Can anyone help me please ?

How do I change the colour to red (#FF0000) via a Vera scene ?[/quote]

I’m just starting to learn all the possibilities that home automation can offer so I’m not sure if I can answer for your question but as others have been helping me I try to help as well if I can :slight_smile:

I got hue to change to colors I wanted by editing Hue Scenes (not vera scene) via Hue API. I made a Hue Scene called dim lights and save it to the Hue Bridge. Then I could call it in vera scenes.
Hue Scenes can be made via vera plugin (Philips Hue 2) but via Hue API setting the exact color is much easier.

Edit. oops, just read your second post that you figured out your problem.