Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/home-assistant-libs/netdisco
:mag_right: Python library to scan local network for services and devices.
https://github.com/home-assistant-libs/netdisco
discovery home-assistant home-automation internet-of-things mdns python upnp
Last synced: about 1 month ago
JSON representation
:mag_right: Python library to scan local network for services and devices.
- Host: GitHub
- URL: https://github.com/home-assistant-libs/netdisco
- Owner: home-assistant-libs
- License: other
- Archived: true
- Created: 2015-01-04T06:07:06.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-10-01T16:17:51.000Z (about 3 years ago)
- Last Synced: 2024-09-26T15:41:59.491Z (about 1 month ago)
- Topics: discovery, home-assistant, home-automation, internet-of-things, mdns, python, upnp
- Language: Python
- Homepage:
- Size: 291 KB
- Stars: 266
- Watchers: 40
- Forks: 147
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
## 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](https://developers.home-assistant.io/docs/en/next/creating_integration_manifest.html#zeroconf).
# 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 protocolIt is the library that powers the device discovery within [Home Assistant](https://home-assistant.io/).
### We are no longer accepting PRs that implement custom discovery protocols. Only PRs that use mDNS or uPnP are supported. See [this issue](https://github.com/home-assistant/netdisco/issues/230)
## Installation
Netdisco is available on PyPi. Install using `pip3 install netdisco`.
## Example
From command-line:
```bash
python3 -m netdisco
# To see all raw data:
python3 -m netdisco dump
```In your script:
```python
from netdisco.discovery import NetworkDiscoverynetdis = 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']
```