[122] Philips Hue support

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

mvdarend
Posts: 4
Joined: Friday 31 October 2014 14:15
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [122] Philips Hue support

Post by mvdarend »

gizmocuz wrote: Is this transition time possible via the API ?
Yes, you can find it here:
http://www.developers.meethue.com/docum ... lights-api
transitiontime uint16
The duration of the transition from the light’s current state to the new state. This is given as a multiple of 100ms and defaults to 4 (400ms). For example, setting transistiontime:10 will make the transition last 1 second.
Here's an example: (Full brightness Reading theme with a 1 minute transition)

Code: Select all

{"on":true,"bri":255,"sat":212,"hue":13088,"transitiontime":600}
Edit: Is there a way to send the above example directly through Domoticz? I'm still finding my way around and can't seem to find a way.
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

Re: [122] Philips Hue support

Post by bbqkees »

It is pretty simple right now to implement the following:

-transition time
-colorloop
-alert

With the transition time parameter you can create a Wake Up Light.
1. Create a virtual switch.
2. Create an 'on' script like below and put it into the scripts directory (see the older Hue tutorial):
cat > hue_wake_8_on.sh
#! /bin/bash
curl -s -H "Accept: application/json" -X PUT --data '{"on":true, "bri":255, "transitiontime":600}' http://bridge-ip-address/api/newdevelop ... ts/8/state ; \

The above script will turn on the light with number 8 and go from 0 to 255 brightness in 60 seconds.

3. chmod 0755 hue_wake_*

4. Enter this script as the 'On' script in the switch settings.

5. Create an 'off' script to turn of the light in the morning after you wake up.
cat > hue_wake_8_off.sh
#! /bin/bash
curl -s -H "Accept: application/json" -X PUT --data '{"on":false}' http://bridge-ip-address/api/newdevelop ... ts/8/state ; \

6. chmod 0755 hue_wake_*

7. Enter a timer in this virtual switch when you want to wake up minus the transition time.

With other scripts like this you can also implement the 'alert' function which will cause the lamp to blik for a certain time.
{"alert": "lselect"} will cause 30 seconds of blinking.
{"alert": "select"} will cause a short blinking burst.
{"alert": "lselect", "hue": 20000} will cause the light to blink for 30 second with an orange color.

If you include other parameters other than alert, then the lamp will remember those settings after the blinking period is over.
If you only include the alert parameter, than the light will return to its previous state when it stops blinking.
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
mvdarend
Posts: 4
Joined: Friday 31 October 2014 14:15
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [122] Philips Hue support

Post by mvdarend »

Thanks for that bbqkees, I'll give it a try.
LanWolf
Posts: 36
Joined: Wednesday 20 August 2014 10:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [122] Philips Hue support

Post by LanWolf »

Is it also possible to implement support for color temperature? I would like to set my lights to warm white when waking up / entering the room in the morning but seems impossible with hex codes.
It seems only possible to set cold white at the moment via the colorpicker.

There is the option to set color via CT option afaik, to be set between 154 and 500.
*/ Just A Byte /*
Mr-Leo
Posts: 5
Joined: Monday 24 November 2014 8:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [122] Philips Hue support

Post by Mr-Leo »

Or make picking a color optional, so you can set a warm color via the Hue App.

See: http://www.domoticz.com/forum/viewtopic.php?f=6&t=4086
User avatar
tcviper
Posts: 89
Joined: Monday 30 June 2014 13:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: [122] Philips Hue support

Post by tcviper »

Hello there,

Using latest domoticz beta version, added the HUE bridge fine but for some reason, light switches work but when i try to group them together the on/off doesnt do anything after adding each light into the group. Any idea on this? Whenever i click on or off from a group, the lights only go off.
LJ80
Posts: 20
Joined: Wednesday 14 January 2015 21:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [122] Philips Hue support

Post by LJ80 »

tcviper wrote:Hello there,

Using latest domoticz beta version, added the HUE bridge fine but for some reason, light switches work but when i try to group them together the on/off doesnt do anything after adding each light into the group. Any idea on this? Whenever i click on or off from a group, the lights only go off.
I had something almost similair.
My solution was adding the switch via a blocky command instead of coupling this switch in the group.
User avatar
tcviper
Posts: 89
Joined: Monday 30 June 2014 13:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: [122] Philips Hue support

Post by tcviper »

Can you tell me how you did that exactly? :) Been trying to figure it out but im stuck here.
webster
Posts: 15
Joined: Saturday 13 December 2014 22:16
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [122] Philips Hue support

Post by webster »

No problems with group here

Made a group all lights 25%
Put the hue lights in
And It is working fine
RPI B+
RPI 2
Fibaro motion sensors , Philips Hue, Z-Wave dimmers, Eneco Toon
Honeywell Evohome 1-Wire Wifi sensors
LJ80
Posts: 20
Joined: Wednesday 14 January 2015 21:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [122] Philips Hue support

Post by LJ80 »

tcviper wrote:Can you tell me how you did that exactly? :) Been trying to figure it out but im stuck here.
Just like this, and now it is respondig by on and off:
Image
I even changed the off comand to turn of one extra lamp which in not going on by the on command.
micksel
Posts: 50
Joined: Wednesday 28 January 2015 17:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [122] Philips Hue support

Post by micksel »

Blueone wrote:Maybe a feature request when everything is working correct, the Hue tap support so it is also possible to use the switches in combination with domoticz.
It would be a wonderful function if it isn’t already implemented.
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

Re: [122] Philips Hue support

Post by bbqkees »

micksel wrote:
Blueone wrote:Maybe a feature request when everything is working correct, the Hue tap support so it is also possible to use the switches in combination with domoticz.
It would be a wonderful function if it isn’t already implemented.
There is no 'push' functionality in the bridge, so you need constant polling of the bridge to see the status of the Tap buttons.
So at the moment it is not really convenient to implement this natively in domoticz. You would need to poll at least once a second to get a response that is fast enough in practice. If you press a button on the Tap, and nothings happens for 10 seconds that is not good enough).
They might be working on such a functionality for a future firmware release see click

But you can write a script if you want, with the Hue API you can write your own polling mechanism in f.i. LUA.
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
micksel
Posts: 50
Joined: Wednesday 28 January 2015 17:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [122] Philips Hue support

Post by micksel »

bbqkees wrote:
micksel wrote:
Blueone wrote:Maybe a feature request when everything is working correct, the Hue tap support so it is also possible to use the switches in combination with domoticz.
It would be a wonderful function if it isn’t already implemented.
There is no 'push' functionality in the bridge, so you need constant polling of the bridge to see the status of the Tap buttons.
So at the moment it is not really convenient to implement this natively in domoticz. You would need to poll at least once a second to get a response that is fast enough in practice. If you press a button on the Tap, and nothings happens for 10 seconds that is not good enough).
They might be working on such a functionality for a future firmware release see click

But you can write a script if you want, with the Hue API you can write your own polling mechanism in f.i. LUA.
Thanks for the answer and I will look at a script for now and hope for a future release :)
Morcegolas
Posts: 24
Joined: Wednesday 01 October 2014 12:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [122] Philips Hue support

Post by Morcegolas »

bbqkees wrote:It is pretty simple right now to implement the following:

-transition time
-colorloop
-alert

With the transition time parameter you can create a Wake Up Light.
1. Create a virtual switch.
2. Create an 'on' script like below and put it into the scripts directory (see the older Hue tutorial):
cat > hue_wake_8_on.sh
#! /bin/bash
curl -s -H "Accept: application/json" -X PUT --data '{"on":true, "bri":255, "transitiontime":600}' http://bridge-ip-address/api/newdevelop ... ts/8/state ; \

The above script will turn on the light with number 8 and go from 0 to 255 brightness in 60 seconds.

3. chmod 0755 hue_wake_*

4. Enter this script as the 'On' script in the switch settings.

5. Create an 'off' script to turn of the light in the morning after you wake up.
cat > hue_wake_8_off.sh
#! /bin/bash
curl -s -H "Accept: application/json" -X PUT --data '{"on":false}' http://bridge-ip-address/api/newdevelop ... ts/8/state ; \

6. chmod 0755 hue_wake_*

7. Enter a timer in this virtual switch when you want to wake up minus the transition time.

With other scripts like this you can also implement the 'alert' function which will cause the lamp to blik for a certain time.
{"alert": "lselect"} will cause 30 seconds of blinking.
{"alert": "select"} will cause a short blinking burst.
{"alert": "lselect", "hue": 20000} will cause the light to blink for 30 second with an orange color.

If you include other parameters other than alert, then the lamp will remember those settings after the blinking period is over.
If you only include the alert parameter, than the light will return to its previous state when it stops blinking.
Nice done bbqkees! Just one question, I can't set my color to blink I already tried to put this on the script but with no luck:

#! /bin/bash
curl -s -H "Accept: application/json" -X PUT --data '{"alert": "lselect", "hue": 20000}' http://ipofphilips/api/newdeveloper/lights/4/state; \

and

#! /bin/bash
curl -s -H "Accept: application/json" -X PUT --data '{"alert": "lselect", "bri":240, "hue":5911, "sat":254}' http://ipofphilips/api/newdeveloper/lights/4/state; \

None of them change the color, If I hade white as the last color used by that lamp it will blink white :/

Hope you can help me.
Thanks.
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

Re: [122] Philips Hue support

Post by bbqkees »

Did you try the commands first in the Hue debug interface?

http://www.developers.meethue.com/docum ... ng-started

Otherwise first set the color, then add a second command for the blinking.
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
Morcegolas
Posts: 24
Joined: Wednesday 01 October 2014 12:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [122] Philips Hue support

Post by Morcegolas »

Yes I did, if I make a script like this just to turn on the light with some color it works:

#! /bin/bash
curl -s -H "Accept: application/json" -X PUT --data '{"on": true, "bri":240, "hue":5911, "sat":254}' http://ipofphilips/api/newdeveloper/lights/4/state; \

If I put the same thing with the alert command too it will change the color and blink, but it beaver it's strange, instead of turning ON/OFF it fades a little and then bright again to 100%. The code I used was this:

#! /bin/bash
curl -s -H "Accept: application/json" -X PUT --data '{"on": true, "bri":240, "hue":5911, "sat":254}' http://ipofphilips/api/newdeveloper/lights/4/state; \
curl -s -H "Accept: application/json" -X PUT --data '{"alert": "lselect", "bri":240, "hue":5911, "sat":254}' http://ipofphilips/api/newdeveloper/lights/4/state; \

Thanks.
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

Re: [122] Philips Hue support

Post by bbqkees »

I will try it myself this weekend, I played with these commands a few months ago, I cannot really recall anymore what the actual response from the lamps was.
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
LJ80
Posts: 20
Joined: Wednesday 14 January 2015 21:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [122] Philips Hue support

Post by LJ80 »

simple question:

It is very hard to select a normal warm white color with the hex code.
Or the light will be orange, or it will be very industrial white.

Does someone know or want to post their hex code?
iMiMx
Posts: 9
Joined: Wednesday 21 January 2015 18:38
Target OS: Linux
Domoticz version:

Re: [122] Philips Hue support

Post by iMiMx »

LJ80 wrote:simple question:

It is very hard to select a normal warm white color with the hex code.
Or the light will be orange, or it will be very industrial white.

Does someone know or want to post their hex code?
It's not currently possible, as far as I'm aware, as Domoticz does not support the colour temperature setting - the only way is using a script direct to the bridge, then call this from Domoticz. Good explanation on the developer pages

http://www.developers.meethue.com/docum ... e-concepts
LJ80
Posts: 20
Joined: Wednesday 14 January 2015 21:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [122] Philips Hue support

Post by LJ80 »

iMiMx wrote:
LJ80 wrote:simple question:

It is very hard to select a normal warm white color with the hex code.
Or the light will be orange, or it will be very industrial white.

Does someone know or want to post their hex code?
It's not currently possible, as far as I'm aware, as Domoticz does not support the colour temperature setting - the only way is using a script direct to the bridge, then call this from Domoticz. Good explanation on the developer pages

http://www.developers.meethue.com/docum ... e-concepts
Okay too bad then, hope Gizmocuz will make this possible in the future.
Or someonelse with the know how.

Thanks for your answer.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests