The package name of this class is hubitat.helper. So, to use in an app or driver, you would reference it with hubitat.helper.NetworkUtils.
Performs an ICMP ping and returns the results.
PingData ping(String IPAddress)PingData ping(String IPAddress, Integer count)PingData ping(String IPAddress, Integer count, Integer timeout)IPAddress - The IPv4 address to pingcount - The number of ping requests to send (defaults to 3, maximum is 5)timeout - The timeout in seconds (defaults to 3, maximum is 30)PingData - An object (or null if the address is not a valid IPv4 address) containing the following properties:
Double rttAvg - Average Round Trip TimeDouble rttMin - Minimum Round Trip TimeDouble rttMax - Maximum Round Trip TimeInteger packetsTransmitted - Ping requests sentInteger packetsReceived - Responses receivedInteger packetLoss - Responses lostDetermines whether a string is a valid HTTP or HTTPS URL. (Since 2.5.0)
boolean isValidHttpURL(String urlStr)urlStr - The URL text to check.true if the string parses as an HTTP or HTTPS URL, false otherwise.
Retrieve the other hubs known on the local network. (Since 2.4.4)
Map<String, String> getLocalHubsByIP()None
A Map with hub IP addresses (String) as keys and hub names (String) as values
Browse for mDNS services and return their advertised addresses and records. (Since 2.5.1)
List<Map> getMDNSServiceResults(String mdnsServiceType, Integer timeoutMs = 5000)mdnsServiceType - MDNS service typetimeoutMs - Optional; defaults to 5000. Requested browse time in milliseconds, clamped from 500 through 15000Service maps with:
type: String normalized service type.name: String service name.qualifiedName: String fully qualified service name.server: String server host name.port: Integer service port.priority: Integer service priority.weight: Integer service weight.ip4Addresses: List of IPv4 address Strings.ip6Addresses: List of IPv6 address Strings.textRecords: map keyed by advertised property name (String), with String property values.Retrieve the mDNS service types registered on the hub. (Since 2.4.2)
List<String> getRegisteredMDNSServiceTypes()None
A List of mDNS service type names (String)
Returns the latest ONVIF network video transmitter discovery results. (Since 2.5.1)
List<Map> getONVIFScanResults()None
A List of Maps, one for each responding camera host
Returns whether ONVIF discovery is currently running. (Since 2.5.1)
boolean isONVIFDiscoveryRunning()None
true while an ONVIF discovery scan is running, false otherwise.
Restarts ONVIF discovery unless an ONVIF discovery scan is already running. (Since 2.5.1)
void restartONVIFDiscovery()None
none
Returns the latest RTSP port scan results. (Since 2.5.1)
List<Map> getRTSPScanResults()None
Maps with:
host: String host name or IPv4 address.port: Integer TCP port.open: Boolean TCP connection result.rtspConfirmed: Boolean RTSP OPTIONS response result.statusLine: nullable String first response line.Returns whether RTSP discovery is currently running. (Since 2.5.1)
boolean isRTSPDiscoveryRunning()None
true while an RTSP discovery scan is running, false otherwise.
Restarts RTSP discovery unless an RTSP discovery scan is already running. (Since 2.5.1)
void restartRTSPDiscovery()None
none
Compress text with gzip using UTF-8 encoding. (Since 2.4.1)
byte[] gzipCompress(String data)data - Text to compressCompressed bytes
Gzip-compress text and encode the bytes as Base64. (Since 2.4.1)
String gzipCompressAndBase64Encode(String data)data - Text to compressBase64 text
Decompress gzip bytes. (Since 2.4.1)
byte[] gzipDecompress(byte[] data)data - Compressed bytesDecompressed bytes
Base64-decode and gzip-decompress text. (Since 2.4.1)
byte[] base64DecodeAndGzipDecompress(String data)data - Base64-encoded compressed bytesDecompressed bytes
Calculate an MD5 digest for text. (Since 2.4.2)
String calculateMD5Hash(String data)data - Text to hashThe digest as a lowercase hexadecimal String, or an empty string if the input is blank