Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

🔎 Python library to scan local network for services and devices.

License

Notifications You must be signed in to change notification settings

home-assistant-libs/netdisco

Folders and files

NameName
Last commit message
Last commit date

Latest commit

477db5a Â· Oct 1, 2021
May 7, 2021
Oct 1, 2021
Jun 15, 2018
Apr 3, 2019
Jul 25, 2020
Dec 16, 2018
Jan 28, 2017
Jan 23, 2017
Jan 28, 2017
Sep 19, 2018
May 27, 2019
Aug 26, 2018
Aug 26, 2018
Dec 16, 2018
Dec 16, 2018
Oct 1, 2021
Mar 7, 2019

Repository files navigation

This library is deprecated. We will no longer release new versions, fix bugs or accept pull requests. If you are looking to make your Home Assistant integration discoverable, use the zeroconf and SSDP manifest options.

NetDisco

NetDisco is a Python 3 library to discover local devices and services. It allows to scan on demand or offer a service that will scan the network in the background in a set interval.

Current methods of scanning:

  • mDNS (includes Chromecast, Homekit)
  • uPnP
  • Plex Media Server using Good Day Mate protocol
  • Logitech Media Server discovery protocol
  • Daikin discovery protocol
  • Web OS discovery protocol

It is the library that powers the device discovery within Home Assistant.

We are no longer accepting PRs that implement custom discovery protocols. Only PRs that use mDNS or uPnP are supported. See this issue

Installation

Netdisco is available on PyPi. Install using pip3 install netdisco.

Example

From command-line:

python3 -m netdisco
# To see all raw data:
python3 -m netdisco dump

In your script:

from netdisco.discovery import NetworkDiscovery

netdis = NetworkDiscovery()

netdis.scan()

for dev in netdis.discover():
    print(dev, netdis.get_info(dev))

netdis.stop()

Will result in a list of discovered devices and their most important information:

DLNA ['http://192.168.1.1:8200/rootDesc.xml', 'http://192.168.1.150:32469/DeviceDescription.xml']
google_cast [('Living Room.local.', 8009)]
philips_hue ['http://192.168.1.2:80/description.xml']
belkin_wemo ['http://192.168.1.10:49153/setup.xml']