Skip to main content

Auto discovery of Hue bridges

Project description

The MIT License

Discovery of hue bridges per the Philips design guide.

Use discoverhue to find the IP addresses of all hue bridges on the LAN. If previously known bridge serial numbers are provided then the returned info will be filtered. Alternatively, serial numbers and last known IP addresses pairs may be provided. In this case, the provided addresses will be checked first and the discovery methods will only be executed if unmatched bridges remain.

Currently, discoverhue implements options one and two of the Hue Bridge Discovery Guide available with registration at MeetHue.

Installation

pip install discoverhue

Examples

Execute discovery and return a dictionary of all found bridges:

import discoverhue
found = discoverhue.find_bridges()
for bridge in found:
    print('    Bridge ID {br} at {ip}'.format(br=bridge, ip=found[bridge]))

Execute discovery and return a filtered list of bridges:

# using a list, matches will be removed from search_id
search_id = ['0017884e7dad', '001788102201']
found = discoverhue.find_bridges(search_id)

# using a set, matches will be removed from search_id
search_id = {'0017884e7dad', '001788102201'}
found = discoverhue.find_bridges(search_id)

# using a tuple, immutable so matches will not be removed
search_id = ('0017884e7dad', '001788102201')
found = discoverhue.find_bridges(search_id)

Execute discovery and return single IP address as string:

>>> found = discoverhue.find_bridges('001788102201')
>>> found.lower()
'http://192.168.0.1:80/'

Validate provided IP’s and execute discovery only if necessary:

>>> discoverhue.find_bridges({'0017884e7dad':'192.168.0.1',
                              '001788102201':'192.168.0.2'})
{'0017884e7dad': 'http://192.168.0.27:80/'}

Contributions

Welcome at https://github.com/Overboard/discoverhue

Status

Released.

SSDP Attribution

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

discoverhue-1.0.1.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

discoverhue-1.0.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file discoverhue-1.0.1.tar.gz.

File metadata

  • Download URL: discoverhue-1.0.1.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for discoverhue-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e87f1a1a262e4ce4e6688a8b71c49b3f8508ad88b645c0b8fc93eff75ae18e1c
MD5 ebb13aa9ecc05d534070cf4ebefd2eb0
BLAKE2b-256 abdea5b2c1853c0147325eb919c4be9ffb435af474a00cc1957342db084849d6

See more details on using hashes here.

File details

Details for the file discoverhue-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for discoverhue-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f6f4378fb64a574dbe4a848f6c5170e0ba03d2cf540d58403b33b592a5bf0344
MD5 754adfd27d449bbb40266b3ec693295f
BLAKE2b-256 4e33a9cac813887372d75b1b011406da64c941f534b25ed2a5e72d7730c05a7b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page