Philips Hue plugin

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

Re: Philips Hue plugin

Post by Aquila » Sun Oct 16, 2016 10:09 am

Thank you!

It seems some other app is updating the status of the button, but not changing anything, just the "last updated" timestamp. I could try to make a work around, but since I don't have this button myself you have to be my tester.

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

Re: Philips Hue plugin

Post by Aquila » Sun Oct 16, 2016 10:34 am

jjazdk wrote:
Aquila wrote:If you switch to "All results" for outptlevel in the config, and then make macros for the events of the buttons and use the "getSensorStatus" action for the apropriate button. I'd like to see what changes, and if its something unimportant I can set up the plugin to ignore this changes.
Here you go, I setup the macro to read sensorstatus for both buttons at every call, I hope that is okay:

11:35:08 PhilipsHue.XFDHueDim2Btn4000State.change
11:35:08 gettingsensorstatus
11:35:08 Philips Hue: Get sensor status: 03 - XFDHueDim2Btn1000State
11:35:08 Info: {u'name': u'XFDHueDim2Btn1000State', u'uniqueid': u'E524EE76-5069-40F8-BFC4-756C915A', u'config': {u'on': True, u'reachable': True}, u'swversion': u'1.0', u'state': {u'status': 0, u'lastupdated': u'2016-10-16T09:35:06'}, u'manufacturername': u'xfiredesigns', u'recycle': False, u'type': u'CLIPGenericStatus', u'modelid': u'ButtonState'}
11:35:08 Philips Hue: Get sensor status: 04 - XFDHueDim2Btn4000State
11:35:08 Info: {u'name': u'XFDHueDim2Btn4000State', u'uniqueid': u'17A36714-0665-4581-8348-8D22550A', u'config': {u'on': True, u'reachable': True}, u'swversion': u'1.0', u'state': {u'status': 0, u'lastupdated': u'2016-10-16T09:35:06'}, u'manufacturername': u'xfiredesigns', u'recycle': False, u'type': u'CLIPGenericStatus', u'modelid': u'ButtonState'}
11:35:18 PhilipsHue.XFDHueDim2Btn1000State.change
11:35:18 gettingsensorstatus
11:35:18 Philips Hue: Get sensor status: 03 - XFDHueDim2Btn1000State
11:35:18 Info: {u'name': u'XFDHueDim2Btn1000State', u'uniqueid': u'E524EE76-5069-40F8-BFC4-756C915A', u'config': {u'on': True, u'reachable': True}, u'swversion': u'1.0', u'state': {u'status': 0, u'lastupdated': u'2016-10-16T09:35:16'}, u'manufacturername': u'xfiredesigns', u'recycle': False, u'type': u'CLIPGenericStatus', u'modelid': u'ButtonState'}
11:35:18 Philips Hue: Get sensor status: 04 - XFDHueDim2Btn4000State
11:35:18 Info: {u'name': u'XFDHueDim2Btn4000State', u'uniqueid': u'17A36714-0665-4581-8348-8D22550A', u'config': {u'on': True, u'reachable': True}, u'swversion': u'1.0', u'state': {u'status': 0, u'lastupdated': u'2016-10-16T09:35:16'}, u'manufacturername': u'xfiredesigns', u'recycle': False, u'type': u'CLIPGenericStatus', u'modelid': u'ButtonState'}
11:35:18 PhilipsHue.XFDHueDim2Btn4000State.change
11:35:18 gettingsensorstatus
11:35:18 Philips Hue: Get sensor status: 03 - XFDHueDim2Btn1000State
11:35:18 Info: {u'name': u'XFDHueDim2Btn1000State', u'uniqueid': u'E524EE76-5069-40F8-BFC4-756C915A', u'config': {u'on': True, u'reachable': True}, u'swversion': u'1.0', u'state': {u'status': 0, u'lastupdated': u'2016-10-16T09:35:16'}, u'manufacturername': u'xfiredesigns', u'recycle': False, u'type': u'CLIPGenericStatus', u'modelid': u'ButtonState'}
11:35:18 Philips Hue: Get sensor status: 04 - XFDHueDim2Btn4000State
11:35:18 Info: {u'name': u'XFDHueDim2Btn4000State', u'uniqueid': u'17A36714-0665-4581-8348-8D22550A', u'config': {u'on': True, u'reachable': True}, u'swversion': u'1.0', u'state': {u'status': 0, u'lastupdated': u'2016-10-16T09:35:16'}, u'manufacturername': u'xfiredesigns', u'recycle': False, u'type': u'CLIPGenericStatus', u'modelid': u'ButtonState'}
11:35:29 PhilipsHue.XFDHueDim2Btn1000State.change
11:35:29 gettingsensorstatus
11:35:29 Philips Hue: Get sensor status: 03 - XFDHueDim2Btn1000State
11:35:29 Info: {u'name': u'XFDHueDim2Btn1000State', u'uniqueid': u'E524EE76-5069-40F8-BFC4-756C915A', u'config': {u'on': True, u'reachable': True}, u'swversion': u'1.0', u'state': {u'status': 0, u'lastupdated': u'2016-10-16T09:35:26'}, u'manufacturername': u'xfiredesigns', u'recycle': False, u'type': u'CLIPGenericStatus', u'modelid': u'ButtonState'}
11:35:29 Philips Hue: Get sensor status: 04 - XFDHueDim2Btn4000State
11:35:29 Info: {u'name': u'XFDHueDim2Btn4000State', u'uniqueid': u'17A36714-0665-4581-8348-8D22550A', u'config': {u'on': True, u'reachable': True}, u'swversion': u'1.0', u'state': {u'status': 0, u'lastupdated': u'2016-10-16T09:35:26'}, u'manufacturername': u'xfiredesigns', u'recycle': False, u'type': u'CLIPGenericStatus', u'modelid': u'ButtonState'}
11:35:29 PhilipsHue.XFDHueDim2Btn4000State.change
11:35:29 gettingsensorstatus
11:35:29 Philips Hue: Get sensor status: 03 - XFDHueDim2Btn1000State
11:35:29 Info: {u'name': u'XFDHueDim2Btn1000State', u'uniqueid': u'E524EE76-5069-40F8-BFC4-756C915A', u'config': {u'on': True, u'reachable': True}, u'swversion': u'1.0', u'state': {u'status': 0, u'lastupdated': u'2016-10-16T09:35:26'}, u'manufacturername': u'xfiredesigns', u'recycle': False, u'type': u'CLIPGenericStatus', u'modelid': u'ButtonState'}
11:35:29 Philips Hue: Get sensor status: 04 - XFDHueDim2Btn4000State
11:35:29 Info: {u'name': u'XFDHueDim2Btn4000State', u'uniqueid': u'17A36714-0665-4581-8348-8D22550A', u'config': {u'on': True, u'reachable': True}, u'swversion': u'1.0', u'state': {u'status': 0, u'lastupdated': u'2016-10-16T09:35:26'}, u'manufacturername': u'xfiredesigns', u'recycle': False, u'type': u'CLIPGenericStatus', u'modelid': u'ButtonState'}
I have test version for you. I can't test it fully at my place, since I don't have the same switch. I hope it works. It should also give you events when buttons are really pushed.
__init__.py
Test version
(123.6 KiB) Downloaded 140 times

jjazdk
Posts: 7
Joined: Wed Sep 02, 2015 8:21 pm

Re: Philips Hue plugin

Post by jjazdk » Sun Oct 16, 2016 7:50 pm

Aquila wrote:I have test version for you. I can't test it fully at my place, since I don't have the same switch. I hope it works. It should also give you events when buttons are really pushed.
__init__.py
It sort of works :-) The state.change every 10 seconds is gone, but...

Upon pressing a button on the dimmer switch, the plug-in outputs a very angry log in red characters :-)

Log:
21:47:09 ---> Welcome to EventGhost <---
21:47:10 Autostart
21:47:10 Plugin: X10: Generic X10
21:47:11 Plugin: Task Create/Switch Events
21:47:11 Plugin: JRiver Media Center Event Plugin
21:47:11 Plugin: Philips Hue
21:47:11 PhilipsHue is started, and connecting to: 192.168.1.90...
21:47:11 Connected!
21:47:11 Plugin: Timer
21:47:11 Main.OnInit
21:47:24 Keyerror: Probably none-colored light.
21:47:24 Keyerror: Probably none-colored light.
21:47:24 Keyerror: Probably none-colored light.
21:47:24 PhilipsHue.12.changed {'bri': 250}
21:47:24 Exception in thread Thread-5:
21:47:24 Traceback (most recent call last):
21:47:24 File "threading.pyc", line 532, in __bootstrap_inner
21:47:24 File "threading.pyc", line 484, in run
21:47:24 File "C:\Program Files (x86)\EventGhost\plugins\PhilipsHue\__init__.py", line 369, in catchEvents
21:47:24 self.TriggerEvent(old_sensors['name'] + '.status_' + self.sensors['state']['status'])
21:47:24 TypeError: coercing to Unicode: need string or buffer, int found
21:47:24
21:48:15 System.Idle
21:48:24 System.UnIdle

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

Re: Philips Hue plugin

Post by Aquila » Sun Oct 16, 2016 9:25 pm

jjazdk wrote:It sort of works :-) The state.change every 10 seconds is gone, but...

Upon pressing a button on the dimmer switch, the plug-in outputs a very angry log in red characters :-)

Log:
21:47:09 ---> Welcome to EventGhost <---
21:47:10 Autostart
21:47:10 Plugin: X10: Generic X10
21:47:11 Plugin: Task Create/Switch Events
21:47:11 Plugin: JRiver Media Center Event Plugin
21:47:11 Plugin: Philips Hue
21:47:11 PhilipsHue is started, and connecting to: 192.168.1.90...
21:47:11 Connected!
21:47:11 Plugin: Timer
21:47:11 Main.OnInit
21:47:24 Keyerror: Probably none-colored light.
21:47:24 Keyerror: Probably none-colored light.
21:47:24 Keyerror: Probably none-colored light.
21:47:24 PhilipsHue.12.changed {'bri': 250}
21:47:24 Exception in thread Thread-5:
21:47:24 Traceback (most recent call last):
21:47:24 File "threading.pyc", line 532, in __bootstrap_inner
21:47:24 File "threading.pyc", line 484, in run
21:47:24 File "C:\Program Files (x86)\EventGhost\plugins\PhilipsHue\__init__.py", line 369, in catchEvents
21:47:24 self.TriggerEvent(old_sensors['name'] + '.status_' + self.sensors['state']['status'])
21:47:24 TypeError: coercing to Unicode: need string or buffer, int found
21:47:24
21:48:15 System.Idle
21:48:24 System.UnIdle


Thanks! Looks like I forgot a string conversion. I have added the string conversion, hope this one fixes the problem!
[attachment=0]__init__.py[/attachment]
Attachments
__init__.py
Test version 2
(123.6 KiB) Downloaded 137 times

jjazdk
Posts: 7
Joined: Wed Sep 02, 2015 8:21 pm

Re: Philips Hue plugin

Post by jjazdk » Mon Oct 17, 2016 9:32 pm

Aquila wrote:Thanks! Looks like I forgot a string conversion. I have added the string conversion, hope this one fixes the problem!
__init__.py
This looks promising!

Upon pressing button4 (it switches off my kitchen lights), I get this log:
23:26:33 PhilipsHue.12.off
23:26:33 PhilipsHue.9.off
23:26:33 PhilipsHue.8.off
23:26:33 PhilipsHue.Hue dimmer switch 1.button4002
23:26:33 PhilipsHue.XFDHueDim2Btn4000State.status_1
23:26:35 PhilipsHue.XFDHueDim2Btn4000State.status_0

Pressing button4 again (when the lights are already off), yields this log:
23:27:37 PhilipsHue.Hue dimmer switch 1.button4002
23:27:37 PhilipsHue.XFDHueDim2Btn4000State.status_1
23:27:39 PhilipsHue.XFDHueDim2Btn4000State.status_0

Pressing button1 (switch on kitchen lights), I get this log:
23:27:52 PhilipsHue.12.on
23:27:52 PhilipsHue.9.on
23:27:52 PhilipsHue.8.on
23:27:52 PhilipsHue.XFDHueDim2Btn1000State.status_1
23:27:52 PhilipsHue.Hue dimmer switch 1.button1002
23:27:59 PhilipsHue.XFDHueDim2Btn1000State.status_0

Pressing button1 once more (with the lights already on), gives this:
23:29:43 PhilipsHue.Hue dimmer switch 1.button1000
23:29:45 PhilipsHue.XFDHueDim2Btn1000State.status_1
23:29:45 PhilipsHue.Hue dimmer switch 1.button1002
23:29:47 PhilipsHue.XFDHueDim2Btn1000State.status_0

Long-pressing button1 (switches kitchen, hall and livingroom lights to movei mode), gives a rather long log:
23:30:38 Keyerror: Probably none-colored light.
23:30:38 Keyerror: Probably none-colored light.
23:30:38 Keyerror: Probably none-colored light.
23:30:38 PhilipsHue.12.changed {'bri': 2}
23:30:38 Keyerror: Probably none-colored light.
23:30:38 Keyerror: Probably none-colored light.
23:30:38 Keyerror: Probably none-colored light.
23:30:38 PhilipsHue.1.changed {'bri': 1}
23:30:38 Keyerror: Probably none-colored light.
23:30:38 Keyerror: Probably none-colored light.
23:30:38 Keyerror: Probably none-colored light.
23:30:38 PhilipsHue.3.changed {'bri': 1}
23:30:38 Keyerror: Probably none-colored light.
23:30:38 Keyerror: Probably none-colored light.
23:30:38 Keyerror: Probably none-colored light.
23:30:38 PhilipsHue.2.changed {'bri': 2}
23:30:38 Keyerror: Probably none-colored light.
23:30:38 Keyerror: Probably none-colored light.
23:30:38 Keyerror: Probably none-colored light.
23:30:38 PhilipsHue.4.changed {'bri': 1}
23:30:38 Keyerror: Probably none-colored light.
23:30:38 Keyerror: Probably none-colored light.
23:30:38 Keyerror: Probably none-colored light.
23:30:38 PhilipsHue.7.changed {'bri': 2}
23:30:38 PhilipsHue.6.changed {'bri': 1}
23:30:38 PhilipsHue.9.changed {'bri': 1}
23:30:38 PhilipsHue.8.changed {'bri': 1}
23:30:38 PhilipsHue.Hue dimmer switch 1.button1001
23:30:40 PhilipsHue.Hue dimmer switch 1.button1003
23:30:55 Keyerror: Probably none-colored light.
23:30:55 Keyerror: Probably none-colored light.
23:30:55 Keyerror: Probably none-colored light.
23:30:55 Keyerror: Probably none-colored light.
23:30:55 Keyerror: Probably none-colored light.
23:30:55 Keyerror: Probably none-colored light.
23:30:59 PhilipsHue.3.changed {'hue': 12596, 'sat': 224}
23:30:59 PhilipsHue.2.changed {'hue': 12596, 'sat': 224}
23:31:08 PhilipsHue.1.changed {'hue': 12596, 'sat': 224}

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

Re: Philips Hue plugin

Post by Aquila » Tue Oct 18, 2016 7:54 am

That seems to be a correct response.

The "Keyerror" is due to that I suddenly realized that the "non-colored" lights don't have a hue and sat setting. A temporary fix was to catch the error, I will in a future version handle this differently.

It seems like you have a "fake" button imitating the real button, I guess thats the iPad app.

jjazdk
Posts: 7
Joined: Wed Sep 02, 2015 8:21 pm

Re: Philips Hue plugin

Post by jjazdk » Tue Oct 18, 2016 4:33 pm

Aquila wrote:It seems like you have a "fake" button imitating the real button, I guess thats the iPad app.
Well... The iPad was turned off, when I did these logs, so.. :-)

skribb
Experienced User
Posts: 209
Joined: Thu Feb 12, 2015 7:22 pm
Location: Win7 64bit

Re: Philips Hue plugin

Post by skribb » Sat Oct 22, 2016 11:13 am

Can't wait to try this out.

Will buy Hue gen3 ASAP to replace my LIFX gen1!
Automation is life.

Win7 64bit
EG: v0.5.0-rc4

skribb
Experienced User
Posts: 209
Joined: Thu Feb 12, 2015 7:22 pm
Location: Win7 64bit

Re: Philips Hue plugin

Post by skribb » Thu Oct 27, 2016 5:56 pm

Just got a Hue gen3 starter kit and playing around with your plugin now.

Working pretty well so far! Just wondering, I can't seem to make a cold white. How do I change the Kelvin to 4500?
Using "change to white" makes it lime green and setting the "saturation" to 0 +" brightness" 254 on "change light" makes it warm white.
Automation is life.

Win7 64bit
EG: v0.5.0-rc4

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

Re: Philips Hue plugin

Post by Aquila » Thu Oct 27, 2016 6:03 pm

skribb wrote:Just got a Hue gen3 starter kit and playing around with your plugin now.

Working pretty well so far! Just wondering, I can't seem to make a cold white. How do I change the Kelvin to 4500?
Using "change to white" makes it lime green and setting the "saturation" to 0 +" brightness" 254 on "change light" makes it warm white.
This seems to be dependent on the bulb you use. The best way is to play with the settings in the original app untill you have the desired white. Then get the settings via my plugin and use this. I get cold white on my bulbs with sat:0 and bri:254. The "change to white" gives me varm white (the same as the bulb defaults to).

skribb
Experienced User
Posts: 209
Joined: Thu Feb 12, 2015 7:22 pm
Location: Win7 64bit

Re: Philips Hue plugin

Post by skribb » Thu Oct 27, 2016 7:03 pm

Aquila wrote:
skribb wrote:Just got a Hue gen3 starter kit and playing around with your plugin now.

Working pretty well so far! Just wondering, I can't seem to make a cold white. How do I change the Kelvin to 4500?
Using "change to white" makes it lime green and setting the "saturation" to 0 +" brightness" 254 on "change light" makes it warm white.
This seems to be dependent on the bulb you use. The best way is to play with the settings in the original app untill you have the desired white. Then get the settings via my plugin and use this. I get cold white on my bulbs with sat:0 and bri:254. The "change to white" gives me varm white (the same as the bulb defaults to).
Oh I see, interesting. What version of Hue do you have? Is it Generation 1, 2 or 3?

Is it "get status as command"?
Automation is life.

Win7 64bit
EG: v0.5.0-rc4

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

Re: Philips Hue plugin

Post by Aquila » Thu Oct 27, 2016 7:36 pm

skribb wrote:Oh I see, interesting. What version of Hue do you have? Is it Generation 1, 2 or 3?

Is it "get status as command"?
Hue bridge is gen 2 (there is no gen 3 bridge), most bulbs are gen 1 and some are gen 2.
I have not gotten my hands on gen 3 bulb yet. I have to have use for the bulb to buy one, they are quite expensive. :p

Use the "Get status" command, remember to set "output level" to "all" in the config.

skribb
Experienced User
Posts: 209
Joined: Thu Feb 12, 2015 7:22 pm
Location: Win7 64bit

Re: Philips Hue plugin

Post by skribb » Fri Oct 28, 2016 2:51 pm

Aquila wrote:
skribb wrote:Oh I see, interesting. What version of Hue do you have? Is it Generation 1, 2 or 3?

Is it "get status as command"?
Hue bridge is gen 2 (there is no gen 3 bridge), most bulbs are gen 1 and some are gen 2.
I have not gotten my hands on gen 3 bulb yet. I have to have use for the bulb to buy one, they are quite expensive. :p

Use the "Get status" command, remember to set "output level" to "all" in the config.
Thanks :D

EDIT: now THIS is cool white! It's slightly less bright than the "default white" but it is almost snow white in brilliance.

02:59:31 Info: {'on': True, 'hue': 41310, 'effect': u'none', 'alert': u'select', 'bri': 254, 'sat': 69}
Automation is life.

Win7 64bit
EG: v0.5.0-rc4

Search&Destroy
Posts: 20
Joined: Wed Aug 19, 2009 10:40 am

Re: Philips Hue plugin

Post by Search&Destroy » Wed Nov 02, 2016 3:38 am

Is the Pulse command a special Hue Bridge command like colorloop?
Because I would like to change the intensity (from lowest brightness up to highest) and change time (like 10 sec, or 60 sec).

Ahh and btw.:
When I want to set brightness to 100% I have to add the Dim Up command (with 100 at "Dim up in %" field) three times to reach realy 100%.
Is this a Bug?

Daywalker815
Posts: 1
Joined: Thu Dec 22, 2016 12:12 pm

Re: Philips Hue plugin

Post by Daywalker815 » Thu Dec 22, 2016 12:18 pm

Hi,

i hope you don't mind, i added SaveGroupStatus and RecallGroupStatus to the plugin

Greetings
DW
Attachments
__init__.py
(127.35 KiB) Downloaded 145 times

Post Reply