Philips Hue plugin

Questions and comments specific to a particular plugin should go here.
leejk
Posts: 18
Joined: Sun Dec 04, 2016 4:32 pm

Re: Philips Hue plugin

Post by leejk » Sat Nov 23, 2019 2:59 am

Awesome. Functionally it seems ok.

User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Philips Hue plugin

Post by kgschlosser » Sat Nov 23, 2019 3:15 am

It's just a massive amount of code lumped into one file. and there is also a whole lot of repeat code in it which is adding to the size. makes it hard to know what is going on.
If you like the work I have been doing then feel free to Image

sethtmf
Posts: 4
Joined: Fri Aug 28, 2020 4:01 pm

Re: Philips Hue plugin

Post by sethtmf » Fri Aug 28, 2020 4:05 pm

Just wanted to say thanks for this great plugin.

I am having some trouble trying to change lights based on ambient light level of the motion sensor.

Is this plugin still actively worked on? I see the last comments were from last year.

Many thanks,

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

Re: Philips Hue plugin

Post by Aquila » Sat Aug 29, 2020 7:09 am

sethtmf wrote:
Fri Aug 28, 2020 4:05 pm
Just wanted to say thanks for this great plugin.

I am having some trouble trying to change lights based on ambient light level of the motion sensor.

Is this plugin still actively worked on? I see the last comments were from last year.

Many thanks,
What are you trying to do and how?

sethtmf
Posts: 4
Joined: Fri Aug 28, 2020 4:01 pm

Re: Philips Hue plugin

Post by sethtmf » Mon Aug 31, 2020 11:26 am

I am trying to read the ambient light level off the Philips Hue Indoor Motion Sensor

Once I have this data I will change the brightness of my monitors to match.

It may be that i'm using the plugin incorrectly:

I am trying to get the sensor status as per the following image:
Image

Then when I print:

print eg.plugins.PhilipsHue.getStatus (u'03 - Hue ambient light sensor 1')

I get the following output: It seems to be outputting the status of an IKEA bulb I have, not the light sensor.
{u'swversion': u'1.3.013', u'name': u'Color light 1', u'swupdate': {u'state': u'notupdatable', u'lastinstall': u'2020-08-27T17:24:30'}, u'uniqueid': u'14:b4:57:ff:fe:4a:b5:da-01', u'capabilities': {u'control': {u'colorgamuttype': u'other'}, u'streaming': {u'renderer': False, u'proxy': False}, u'certified': False}, u'productname': u'Color light', u'state': {u'on': False, u'hue': 14988, u'colormode': u'xy', u'effect': u'none', u'alert': u'select', u'xy': [0.4577, 0.40999999999999998], u'reachable': False, u'mode': u'homeautomation', u'bri': 77, u'sat': 141}, u'manufacturername': u'IKEA of Sweden', u'config': {u'function': u'decorative', u'direction': u'omnidirectional', u'archetype': u'classicbulb'}, u'type': u'Color light', u'modelid': u'TRADFRI bulb E27 CWS opal 600lm'}
Any idea where i'm going wrong?

Thanks again for all you support and making this great plugin.

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

Re: Philips Hue plugin

Post by Aquila » Tue Sep 01, 2020 8:08 am

sethtmf wrote:
Mon Aug 31, 2020 11:26 am
I am trying to read the ambient light level off the Philips Hue Indoor Motion Sensor

Once I have this data I will change the brightness of my monitors to match.

It may be that i'm using the plugin incorrectly:

I am trying to get the sensor status as per the following image:
Image

Then when I print:

print eg.plugins.PhilipsHue.getStatus (u'03 - Hue ambient light sensor 1')

I get the following output: It seems to be outputting the status of an IKEA bulb I have, not the light sensor.
{u'swversion': u'1.3.013', u'name': u'Color light 1', u'swupdate': {u'state': u'notupdatable', u'lastinstall': u'2020-08-27T17:24:30'}, u'uniqueid': u'14:b4:57:ff:fe:4a:b5:da-01', u'capabilities': {u'control': {u'colorgamuttype': u'other'}, u'streaming': {u'renderer': False, u'proxy': False}, u'certified': False}, u'productname': u'Color light', u'state': {u'on': False, u'hue': 14988, u'colormode': u'xy', u'effect': u'none', u'alert': u'select', u'xy': [0.4577, 0.40999999999999998], u'reachable': False, u'mode': u'homeautomation', u'bri': 77, u'sat': 141}, u'manufacturername': u'IKEA of Sweden', u'config': {u'function': u'decorative', u'direction': u'omnidirectional', u'archetype': u'classicbulb'}, u'type': u'Color light', u'modelid': u'TRADFRI bulb E27 CWS opal 600lm'}
Any idea where i'm going wrong?

Thanks again for all you support and making this great plugin.
You are using the function for getting the status of a light, you should use: getSensorStatus

sethtmf
Posts: 4
Joined: Fri Aug 28, 2020 4:01 pm

Re: Philips Hue plugin

Post by sethtmf » Thu Sep 03, 2020 12:04 pm

You are using the function for getting the status of a light, you should use: getSensorStatus
Thanks I am now getting the correct status reading.

Apologies for being slow here but I was expecting to get a reading of the various sensors, however I only get it's ID number and software version.

What do I need to get something like this?

Ambient light level: 56, Temperature: 24, etc. etc.

much appreciated,

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

Re: Philips Hue plugin

Post by Aquila » Fri Sep 04, 2020 2:01 pm

sethtmf wrote:
Thu Sep 03, 2020 12:04 pm
You are using the function for getting the status of a light, you should use: getSensorStatus
Thanks I am now getting the correct status reading.

Apologies for being slow here but I was expecting to get a reading of the various sensors, however I only get it's ID number and software version.

What do I need to get something like this?

Ambient light level: 56, Temperature: 24, etc. etc.

much appreciated,
Can you copy and paste the entire response?

If I run the same command for my tapswitch I get:

Code: Select all

{u'name': u'Stua', u'swupdate': {u'state': u'notupdatable', u'lastinstall': None}, u'uniqueid': u'00:00:00:00:00:42:4d:e0-f2', u'capabilities': {u'inputs': [{u'repeatintervals': [], u'events': [{u'eventtype': u'initial_press', u'buttonevent': 34}]}, {u'repeatintervals': [], u'events': [{u'eventtype': u'initial_press', u'buttonevent': 16}]}, {u'repeatintervals': [], u'events': [{u'eventtype': u'initial_press', u'buttonevent': 17}]}, {u'repeatintervals': [], u'events': [{u'eventtype': u'initial_press', u'buttonevent': 18}]}], u'primary': True, u'certified': True}, u'productname': u'Hue tap switch', u'state': {u'lastupdated': u'2020-09-04T05:12:32', u'buttonevent': 34}, u'diversityid': u'd8cde5d5-0eef-4b95-b0f0-71ddd2952af4', u'manufacturername': u'Signify Netherlands B.V.', u'type': u'ZGPSwitch', u'config': {u'on': True}, u'modelid': u'ZGPSWITCH'}

sethtmf
Posts: 4
Joined: Fri Aug 28, 2020 4:01 pm

Re: Philips Hue plugin

Post by sethtmf » Fri Sep 04, 2020 3:25 pm


Can you copy and paste the entire response?

If I run the same command for my tapswitch I get:

Code: Select all

{u'name': u'Stua', u'swupdate': {u'state': u'notupdatable', u'lastinstall': None}, u'uniqueid': u'00:00:00:00:00:42:4d:e0-f2', u'capabilities': {u'inputs': [{u'repeatintervals': [], u'events': [{u'eventtype': u'initial_press', u'buttonevent': 34}]}, {u'repeatintervals': [], u'events': [{u'eventtype': u'initial_press', u'buttonevent': 16}]}, {u'repeatintervals': [], u'events': [{u'eventtype': u'initial_press', u'buttonevent': 17}]}, {u'repeatintervals': [], u'events': [{u'eventtype': u'initial_press', u'buttonevent': 18}]}], u'primary': True, u'certified': True}, u'productname': u'Hue tap switch', u'state': {u'lastupdated': u'2020-09-04T05:12:32', u'buttonevent': 34}, u'diversityid': u'd8cde5d5-0eef-4b95-b0f0-71ddd2952af4', u'manufacturername': u'Signify Netherlands B.V.', u'type': u'ZGPSwitch', u'config': {u'on': True}, u'modelid': u'ZGPSWITCH'}
Ok so I was being an idiot!

When I extend the EventGhost window to see the log I assumed that was the whole line as it stops before the edge of the window. I went to copy and paste here and realised it is fact much larger and has all the data i need.

Image

The more you know!

Many thanks for you help.

SamWest
Posts: 9
Joined: Thu Dec 06, 2012 10:26 am

Re: Philips Hue plugin

Post by SamWest » Sun Sep 13, 2020 11:22 am

Hi,

I added some minor fixes for when the Hue Bridge isn't connectable. The connection timeout is now 1s (not the 30s default), and the errors are handled better. In my case, this was causing EG to block completely until the timeout finished. Code update attched.

Sam.
Attachments
__init__.py
(124.51 KiB) Downloaded 15 times

Post Reply