How do you use to find hue groups & scenes?

How do you use the referenced here?

I get the error

Traceback (most recent call last):
  File "./", line 17, in <module>
    import phue
ImportError: No module named phue

Hopefully this helps someone since this info isn’t on the Philips Hue component page. The light.hue_activate_scene service didn’t work with just the discovery component.

The hue groups showed up as switches in the frontend (not using default view) when I added this to configuration.yaml

  platform: hue
  host: x.x.x.x
  allow_unreachable: true```

That allowed the ```light.hue_activate_scene``` service. The Hue group and scene names in the Hue app that I had been trying then started working (and I didn't need - never did figure that out, hehe). But I couldn't figure out a way to turn them on and off in automations. I think you can just trigger scenes stored on the Hue bridge.

After adding ```allow_hue_groups: true``` the Hue groups show up as
with the attribute ```is_hue_group: true``` and I just replaced with in all of my automations.
1 Like

I have installed the phue phython module via:

sudo pip install phue

but now I need to give the script a config file:

usage: [-h] hue_conf error: too few arguments

and if I give a blank config file i get the following:

./ hue_conf
Traceback (most recent call last):
  File "./", line 42, in <module>
  File "./", line 31, in discover
    bridge = phue.Bridge(config_file_path=args.conf)
  File "/usr/lib/python2.7/site-packages/", line 629, in __init__
  File "/usr/lib/python2.7/site-packages/", line 752, in connect
  File "/usr/lib/python2.7/site-packages/", line 706, in register_app
    response = self.request('POST', '/api', registration_request)
  File "/usr/lib/python2.7/site-packages/", line 647, in request
    connection = httplib.HTTPConnection(self.ip, timeout=10)
  File "/usr/lib/python2.7/", line 736, in __init__
    (, self.port) = self._get_hostport(host, port)
  File "/usr/lib/python2.7/", line 768, in _get_hostport
    i = host.rfind(':')
AttributeError: 'NoneType' object has no attribute 'rfind'

but not sure what this config file should look like… any tips?


I couldn’t get the script to work either but I just used the phue module as follows. Be sure to press the button on the hue hub before you run this.

import phue

b = Bridge('')

May I know the exact steps you took to discover your Hue groups and scenes? I’ve been trying to do this and I have no clue how to use (which seems like doesn’t actually work anyway, according to these posts?)

I attempted to follow your post by doing the following.

pip install phue

(Successfully installed phue-1.1)

Pressed the button on the Hue bridge (which has a static IP).

import phue

Then ran a .py script with the exact lines you posted, and my Hub’s static IP in place of

Got the following instead

NameError: name 'Bridge' is not defined

I’m kinda new to running Python scripts and all, so any help would be appreciated.