Class IpAddonFinder
java.lang.Object
org.openhab.core.config.discovery.addon.BaseAddonFinder
org.openhab.core.config.discovery.addon.ip.IpAddonFinder
- All Implemented Interfaces:
AddonFinder
This is a
IpAddonFinder
for finding suggested add-ons by sending IP packets to the
network and collecting responses.
This finder is intended to detect devices on the network which do not announce via UPnP
or mDNS. Some devices respond to queries to defined multicast addresses and ports and thus
can be detected by sending a single frame on the IP network.
Be aware of possible side effects of sending packets to unknown devices in the network! This is why the IP finder is not intended for large scale network scanning, e.g. using large port or IP ranges.
Configuration
The following parameters can be used to configure frames to be sent to the network:
discovery-parameter | values | comment |
type |
ipMulticast | no other options implemented |
destIp |
destination IP address | |
destPort |
destination port | |
listenPort |
port to use for listening to responses (optional) | privileged ports (<1024 ) not allowed |
request |
description of request frame as hex bytes separated by spaces (e.g. 0x01 0x02 ...) | dynamic replacement of variables $srcIp, $srcPort and $uuid, no others implemented yet |
requestPlain |
description of request frame as plaintext string | dynamic replacement of variables $srcIp, $srcPort and $uuid, no others implemented yet;
there are five XML special characters which need to be escaped:
|
timeoutMs |
timeout to wait for a answers |
dynamic replacement (in request* ) |
value |
$srcIp |
source IP address |
$srcPort |
source port | $uuid |
String returned by java.util.UUID.randomUUID() |
Packets are sent out on every available network interface.
There is currently only one match-property defined: response
.
It allows a regex match, but currently only ".*" is supported.
Limitations
The IpAddonFinder
is still under active development.
There are limitations:
- Currently every returned frame is considered as success, regex matching is not implemented.
- Frames are sent only on startup (or if an
AddonInfoProvider
callssetAddonCandidates(List)
), no background scanning.
- Author:
- Holger Friedrich - Initial contribution
- API note:
- The
IpAddonFinder
is still under active development, it has initially been developed to detect KNX installations and will be extended. Configuration parameters and supported features may still change. - Implementation note:
- On activation, a thread is spawned which handles the detection. Scan runs once, no continuous background scanning.
-
Field Summary
Fields inherited from class org.openhab.core.config.discovery.addon.BaseAddonFinder
addonCandidates
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAddonService
(AddonService featureService) void
The framework calls this method to scan through the candidate list ofAddonInfo
and return a subset of those that it suggests to be installed.protected void
removeAddonService
(AddonService featureService) void
setAddonCandidates
(List<AddonInfo> candidates) The framework calls this method to provide a list ofAddonInfo
elements which contain potential candidates that this finder can iterate over in order to detect which ones to return via thegetSuggestedAddons()
method.Methods inherited from class org.openhab.core.config.discovery.addon.BaseAddonFinder
propertyMatches, unsetAddonCandidates
-
Field Details
-
SERVICE_TYPE
- See Also:
-
SERVICE_NAME
- See Also:
-
-
Constructor Details
-
IpAddonFinder
public IpAddonFinder()
-
-
Method Details
-
deactivate
public void deactivate() -
setAddonCandidates
Description copied from interface:AddonFinder
The framework calls this method to provide a list ofAddonInfo
elements which contain potential candidates that this finder can iterate over in order to detect which ones to return via thegetSuggestedAddons()
method.- Specified by:
setAddonCandidates
in interfaceAddonFinder
- Overrides:
setAddonCandidates
in classBaseAddonFinder
- Parameters:
candidates
- a list of AddonInfo candidates.
-
addAddonService
-
removeAddonService
-
getSuggestedAddons
Description copied from interface:AddonFinder
The framework calls this method to scan through the candidate list ofAddonInfo
and return a subset of those that it suggests to be installed. -
getServiceName
- Specified by:
getServiceName
in classBaseAddonFinder
-