Philips Hue plugin

Questions and comments specific to a particular plugin should go here.
Aquila
Experienced User
Posts: 88
Joined: Wed Jan 28, 2015 2:49 am

Re: Philips Hue plugin

Post by Aquila » Sun Mar 15, 2015 7:11 pm

nikeb wrote:i m testing every single command and his combos and it s working great.

may i suggest to add an option command to set up the transition time for the commands?

would be awesome!

i can provide you the python code with the parameter that needs to be set.
Thanks for the testing, nice to know it works on other systems too. :)

As for the transitiontime, it should be easy to implement. The hard part is setting up the GUI to look nice.
Would you prefere it done like in the "Change light" function or as a slider or something else? Free input opens the door to errors in the user input, but gives full freedom.

nikeb
Posts: 9
Joined: Fri Dec 19, 2014 12:09 pm

Re: Philips Hue plugin

Post by nikeb » Mon Mar 16, 2015 1:23 am

mmmh. interesting.

How about a checkbox that enable/disable the transition,
and a box number with the value ?

Must be a help telling that the value it's in milliseconds (or something, i don't remember).

this would be applied to the on/off command (groups and light) and in the colorloop effect.

But of course this is just my opinion,. feel free to improve it or make it the way you prefer..

Aquila
Experienced User
Posts: 88
Joined: Wed Jan 28, 2015 2:49 am

Re: Philips Hue plugin

Post by Aquila » Mon Mar 16, 2015 10:44 pm

I have posted a new update to the plugin in the first post.

From the changelog:
0.3.2 by Aquila 2015-03-16
- New functions: "getStatusasCommand" and "getGroupStatusAsCommand", returns status as a string that can be used by "customCommand" and "customCommandGroup".
(Save the settings of a light fx to copy to another light or restore after an alert.)
- Added alert and effect settings to "Change light" and "Change group" commands.
- Transtiontime added as setting in this commands: TurnOn, toggleLight, toogleGroup, groupOn, groupOff, TurnOff, standardWhite, standardWhiteGroup
(NB! Using transtiontime to turn off light changes brightnes settings in the bridge.)

Is this a workable implementation of transtiontime? If you leave the field blank a transtiontime command will not be sent, and standard for the bridge (400 ms) will be used. Please note that using transtiontime to turn off a light will set the brightness to 0 in the prosess, this is a bug/behaviour in the Hue bridge that I can't controll.

Also added alert and effect settings to the change light and change group commands, as I for some reason skipped those when I first made that command.

And for my own use: the posibility to get the settings as a string that I can later use to restore the settings of a light. I use this to save the setting of a light before I flash a red light and then restore the settings to its pre-alert state. Please note that due to the Hue API at the moment "getGroupStatusAsCommand" will not return the alert status, this is a bug/behaviour in the bridge that i can't controll.

Aquila
Experienced User
Posts: 88
Joined: Wed Jan 28, 2015 2:49 am

Re: Philips Hue plugin

Post by Aquila » Mon Mar 16, 2015 11:25 pm

Just to show how to use the getStatusAsCommand function:
restore settings.JPG

OklahomaGreyBeard
Posts: 6
Joined: Sun Mar 29, 2015 12:35 pm

Re: Philips Hue plugin

Post by OklahomaGreyBeard » Sun Mar 29, 2015 12:44 pm

I'm not sure if it's a bug or the way I'm entering it. I have a group of lights 02-Wall Wash that I'm trying to use the custom command on and it says it sent but nothing happens. Even a simple command to turn them on at full brightness {"on":"true","bri":255,"hue":0,"sat":0} does nothing. Any ideas? other than that it's been perfect.

-GB

Aquila
Experienced User
Posts: 88
Joined: Wed Jan 28, 2015 2:49 am

Re: Philips Hue plugin

Post by Aquila » Sun Mar 29, 2015 1:47 pm

OklahomaGreyBeard wrote:I'm not sure if it's a bug or the way I'm entering it. I have a group of lights 02-Wall Wash that I'm trying to use the custom command on and it says it sent but nothing happens. Even a simple command to turn them on at full brightness {"on":"true","bri":255,"hue":0,"sat":0} does nothing. Any ideas? other than that it's been perfect.

-GB
Your command is invalid. Try: {'on':True,'bri':255,'hue':0,'sat':0}

There should not be a ' in front and behind the True command.

Aquila
Experienced User
Posts: 88
Joined: Wed Jan 28, 2015 2:49 am

Re: Philips Hue plugin

Post by Aquila » Sun Mar 29, 2015 4:40 pm

And I recommend using the "Change group" command for this actions. It has all the changes you need. :)

bernd
Posts: 10
Joined: Mon Mar 30, 2015 4:39 pm

Re: Philips Hue plugin

Post by bernd » Mon Mar 30, 2015 4:45 pm

Hello,

Thank you a lot for making this useful plugin. Until now I used the inconvenient way over EG -> Autoremote -> Tasker -> Autohue to control my light with an IR-Remote. This is also a possibility but I sometimes I have delays of several seconds and it’s also inconvenient to set up.
All is working great but I have a problem with understanding the status functions “get status”,” get as command”, “check if lights on” How can I use these functions in a sensible way? Must I always print this command also with a "Python command" to use it?
For example is it possible with the “get status commend” to save the current status, set a new colour for a pulse command and if the pulse commend is finished set the lights to the prior saved status ?

A suggestion for the future versions, a function to dim or to lighten, maybe 12,5 % or 20 % steps would be nice a nice feature.

BTW: Do you have a Bitcoin address, I would like to spend a little for your effort to produce this useful plugin.

Kind regards

Aquila
Experienced User
Posts: 88
Joined: Wed Jan 28, 2015 2:49 am

Re: Philips Hue plugin

Post by Aquila » Mon Mar 30, 2015 6:13 pm

bernd wrote:Hello,

Thank you a lot for making this useful plugin. Until now I used the inconvenient way over EG -> Autoremote -> Tasker -> Autohue to control my light with an IR-Remote. This is also a possibility but I sometimes I have delays of several seconds and it’s also inconvenient to set up.
All is working great but I have a problem with understanding the status functions “get status”,” get as command”, “check if lights on” How can I use these functions in a sensible way? Must I always print this command also with a "Python command" to use it?
For example is it possible with the “get status commend” to save the current status, set a new colour for a pulse command and if the pulse commend is finished set the lights to the prior saved status ?

A suggestion for the future versions, a function to dim or to lighten, maybe 12,5 % or 20 % steps would be nice a nice feature.

BTW: Do you have a Bitcoin address, I would like to spend a little for your effort to produce this useful plugin.

Kind regards
Thanks for your input. I made this plugin to use in my own house. So it is useful to get feedback on how it works for others.

"get status" returns av dictionary (Python type) and can be used in a python script. It is not automatically saved. See example belowe.
save status as a global variable.JPG
After this you can use this global variable any way you want. This function is useful if you know how to use Python and know the Hue API.

"Check if light is on" works in much the same way. But it returns True or False (Boolean). I use this to stop a Macro if the light is off. (I don't want warning flashes in my bedroom after I go to sleep.)
stop macro if light is off.JPG
If you want to restore the light status after flashing an alert. This is how to do it:
how to use get status as command.JPG
Note that you have to trigger some kind of event for each macro. If you don't have an event when the alert is supposed to end you can use the timer plugin.

I have noted the request for a function to Dim up/down a light or group. It will probably be in the next release. I have also noted that I maybe should make a function to save the status of a light internally, so that it is easier to use for people that don't understand Python.

I don't have a Bitcoin address. I would apreciate a donation to the Eventghost project, as they make my plugin possible. And I also would like to ask you to give all the feedback you have. :) How do you use the plugin? Does all function work as you like them to? What more functions would you like? Any changes?

bernd
Posts: 10
Joined: Mon Mar 30, 2015 4:39 pm

Re: Philips Hue plugin

Post by bernd » Wed Apr 01, 2015 5:13 pm

Hello Aquila,

Now I have a much better understanding of the function thank you for this detailed explanation.
Unfortunately my Python skills tends to be virtually zero but I will try to test it according to your instruction at the weekend. I have still one little question to the “get sensor status” what sensor can I use for this function or what sensor do you use?

I use the plugin with two Hue stripes, so far, in my flat, I plan to buy another starter set soon.
Mainly I use a universal IR-Remote to control the Hues (set scenes, set brightness, turn on/off) but I also use it for special events. For example when I start Kodi (XBMC) then a certain scene starts or when I get an email the hue blinks or when the sun is going down the lights turn on. Thanks to EG and this plugin the opportunities are unlimited to use the Hues.

I have played a little with the plugin and all functions are self-explanatory and works fine for me until the “modify scene” function. There is the following error message:

Image

What I have also noticed is when I create a new Scene I have to click first on the “test”-Button otherwise when I only click at “OK” or “apply” the new scene won’t be saved. Just for information.
As I say all other functions works fine :)

More functions, if that's what you're asking it would be nice to see one time a function which can interact with the music or video signal means that the light change the colour and brightness with the music or with the colour from the video signal. (Ambilight like) I don’t have programming knowledge but I know this is hard to realise. It’s just a thought, I am very happy with the current features.

It is very nice and unselfish from you to say I should donate to the EG-Project. I will do it.

Kind regards

Aquila
Experienced User
Posts: 88
Joined: Wed Jan 28, 2015 2:49 am

Re: Philips Hue plugin

Post by Aquila » Wed Apr 01, 2015 10:04 pm

I have posted a new version (0.3.3) in the first post, the changes are all based on the input from bernd. :) So if someone has any suggestions fire away, maybe I can fix it. :p

Changelog:
0.3.3 by Aquila 2015-04-01
- New functions: "dimUp", "dimDown", "dimGroupUp" and "dimGroupDown". Dims a light or a group. (NB! DimGroup* dims from current GROUP setting, individual light setting may be diffrent.)
- New functions: "saveStatus" and "recallStatus". Saves and recalls status of a light. (Use scenes for groups.)
- Fixed multiple bugs in "modifyScene"

Aquila
Experienced User
Posts: 88
Joined: Wed Jan 28, 2015 2:49 am

Re: Philips Hue plugin

Post by Aquila » Wed Apr 01, 2015 10:26 pm

bernd wrote:Hello Aquila,

Now I have a much better understanding of the function thank you for this detailed explanation.
Unfortunately my Python skills tends to be virtually zero but I will try to test it according to your instruction at the weekend. I have still one little question to the “get sensor status” what sensor can I use for this function or what sensor do you use?
I have myself not used this function. But you can get the last pushed button on the Hue Tap, that I have tested. So far there are not that any more sensors available in Norway, where I live, at least. To use this function would require some knowledge of python. The plugin will fire an event when a sensor changes state, that would be more useful for most. I use this to catch clicks on the Hue Tap.

If you want to save and restore settings, please try the new version. It has functions to handle this for you without any extra Python.
bernd wrote: I use the plugin with two Hue stripes, so far, in my flat, I plan to buy another starter set soon.
Mainly I use a universal IR-Remote to control the Hues (set scenes, set brightness, turn on/off) but I also use it for special events. For example when I start Kodi (XBMC) then a certain scene starts or when I get an email the hue blinks or when the sun is going down the lights turn on. Thanks to EG and this plugin the opportunities are unlimited to use the Hues.

I have played a little with the plugin and all functions are self-explanatory and works fine for me until the “modify scene” function. There is the following error message:

Image
The error you have a image of looks like it's from the "Create Scene" function. But I can't recreate it. It looks like maybe the plugin can't find the scene on the Hue Bridge. This could happen if the scene changes name since you created the action.

And I found several bugs in the "modify scene" function. I hope I fixed them all now. I don't use scenes my own setup, so it's harder to detect bugs. :p Please retest it. :)
bernd wrote: What I have also noticed is when I create a new Scene I have to click first on the “test”-Button otherwise when I only click at “OK” or “apply” the new scene won’t be saved. Just for information.
As I say all other functions works fine :)
Ahh, this is "working as intended". If you execute the action after configuring it, it will work the same way as if you push the "test" button. I have made it this way because then you can create a scene without using the computer/EG. You can create a scene for all lights, then show an alert and recall the scene after the alert. So in your e-mail example you can save a scene, show your alert and then recall the scene to get back the settings from before the e-mail.
bernd wrote: More functions, if that's what you're asking it would be nice to see one time a function which can interact with the music or video signal means that the light change the colour and brightness with the music or with the colour from the video signal. (Ambilight like) I don’t have programming knowledge but I know this is hard to realise. It’s just a thought, I am very happy with the current features.

It is very nice and unselfish from you to say I should donate to the EG-Project. I will do it.

Kind regards
Ohh, I think it's more than this plugin will ever be able to do alone. But if someone creates a plugin that fires events based on music or video it can be linked to this plugin. And those posibilitys is why I love EG. I can get Spotify to change my lighting, and someone else can use those same plugin for something completly different.

User avatar
yokel22
Experienced User
Posts: 265
Joined: Thu Feb 05, 2015 5:56 pm
Location: U.S. - Kansas city

Re: Philips Hue plugin

Post by yokel22 » Sat Apr 04, 2015 4:21 pm

Aquila,

This is really becoming a rather stellar plugin. If you have a PayPal address I'd like to make a donation(PM me if you'd prefer). Another suggestion. Add a ramp up/down to the hue value(0-65000), just like the current dim commands. Saturation values would be helpful too. General use would be to fine tune bulbs/groups from the Dpad or VOL/CHAN buttons. You could also use it to setup scenes from an IR remote.

Aquila
Experienced User
Posts: 88
Joined: Wed Jan 28, 2015 2:49 am

Re: Philips Hue plugin

Post by Aquila » Mon Apr 06, 2015 8:03 pm

yokel22 wrote:Aquila,

This is really becoming a rather stellar plugin. If you have a PayPal address I'd like to make a donation(PM me if you'd prefer). Another suggestion. Add a ramp up/down to the hue value(0-65000), just like the current dim commands. Saturation values would be helpful too. General use would be to fine tune bulbs/groups from the Dpad or VOL/CHAN buttons. You could also use it to setup scenes from an IR remote.
Thank you! My e-mail is on line 5 in the plugin. Any donations will go for more equitment to test the plugin on. But also note what I wrote in a previous message, I prefere a donation to EG-project.

Up and down for hue and saturation should be doable. Good suggestions. I have added it to my TO-DO-list. I guess I will have to make a option for how much big a step to change as for the dim function. And what do you think about blinking the light once when it reaches max or min? Could be useful when controling with a IR-remote.

User avatar
yokel22
Experienced User
Posts: 265
Joined: Thu Feb 05, 2015 5:56 pm
Location: U.S. - Kansas city

Re: Philips Hue plugin

Post by yokel22 » Wed Apr 08, 2015 5:29 pm

A pulse at max/min would be good. Having red at both ends of the hue value could be a bit confusing to the end user also. Maybe just have the hue values (0-60000). I was thinking small steps with a autorepeat macro.

Post Reply