How do you use discover_scenes.py to find hue groups & scenes?

How do you use the discover_scenes.py referenced here?

I get the error

Traceback (most recent call last):
  File "./discover_scenes.py", 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 discover_scenes.py - 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 light.room
with the attribute ```is_hue_group: true``` and I just replaced group.room with light.room 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:

./discover_scenes.py
usage: discover_scenes.py [-h] hue_conf
discover_scenes.py: error: too few arguments

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

./discover_scenes.py hue_conf
Traceback (most recent call last):
  File "./discover_scenes.py", line 42, in <module>
    discover()
  File "./discover_scenes.py", line 31, in discover
    bridge = phue.Bridge(config_file_path=args.conf)
  File "/usr/lib/python2.7/site-packages/phue.py", line 629, in __init__
    self.connect()
  File "/usr/lib/python2.7/site-packages/phue.py", line 752, in connect
    self.register_app()
  File "/usr/lib/python2.7/site-packages/phue.py", line 706, in register_app
    response = self.request('POST', '/api', registration_request)
  File "/usr/lib/python2.7/site-packages/phue.py", line 647, in request
    connection = httplib.HTTPConnection(self.ip, timeout=10)
  File "/usr/lib/python2.7/httplib.py", line 736, in __init__
    (self.host, self.port) = self._get_hostport(host, port)
  File "/usr/lib/python2.7/httplib.py", 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?

Regards