The package name of this class is zigbee. So, to use in an app or driver you, would reference it with zigbee, e.g., zigbee.on().
Return ZHA cluster information.
ZigbeeCluster clusterLookup(int value)ZigbeeCluster clusterLookup(String value) value - the integer value to lookup value or the hex string value to lookup
ZigbeeCluster - Cluster entry, null if no matching entry found.
def zbc = zigbee.clusterLookup(0x0006)
def zbc = zigbee.clusterLookup("0x0006")
def zbc = zigbee.clusterLookup("0006")
zbc == ON_OFF_CLUSTER
zbc.clusterEnum == ON_OFF_CLUSTER
zbc.clusterLabel == On/Off
zbc.clusterInt == 6
Generates a Zigbee command string based on the specified parameters.
List<String> command(Integer cluster, Integer command, Map additionalParams, int delay = STANDARD_DELAY_INT, String... payload)List<String> command(Integer cluster, Integer command, String... payload)cluster - The Zigbee cluster IDcommand - The Zigbee command IDadditionalParams - Optional Map specifying additional parameters, any of:
destEndpoint - Destination endpoint for messagemfgCode - Manufacturer specific codedelay - Optional milliseconds of delay after commandpayload - Optional hex string in little-endian format of appropriate width for data typeA Zigbee command string (suitable for use in a HubMultiAction, returning from a command method implementation, etc.) based on the parameters provided. For example, zigbee.command(0x0006, 0x01) would return a string similar to "he cmd 0x${device.deviceNetworkId} 0x${device.endpointId} 0x0006 1 {}" (where the variables have been substituted with their actual values). This itself would be similar to zigbee.on().
// turn on:
zigbee.command(0x0006, 0x01)
// set level to max (0xFE) with 2-second (0x0002) transition time:
zigbee.command(0x0008, 0x04, "FE", "0200")
// turn off endpoint 2:
zigbee.command(0x006, 0x00, [destEndpoint: 2])
Generate the on command for the on/off Zigbee cluster
Signature
List<String> on()List<String> on(int delay)Parameters
delay - the number of milliseconds to delay after sending the command; if omitted then the standard delay of 2000ms is used.
Returns
List<String> - a list of Zigbee commands to be sent to the device
Example
def cmds = zigbee.on(200)
Generate the off command for the on/off Zigbee cluster
List<String> off()List<String> off(int delay) delay - the number of milliseconds to delay after sending the command; if omitted then the standard delay of 2000ms is used.
List<String> - a list of Zigbee commands to be sent to the device
def cmds = zigbee.off(500)
Generate the on command for the on/off ZigBee cluster for a group
List<String> groupOn(Integer groupID)
List<String> groupOn(Integer groupID, int delay)
delay - the number of milliseconds to delay after sending the command; if omitted then the standard delay of 2000ms is used.
List - a list of Zigbee commands to be sent to the group
def cmds = zigbee.groupOn(0x0202, 200)
Generate the off command for the on/off ZigBee cluster for a group
List<String> groupOff(Integer groupID)List<String> groupOff(Integer groupID, int delay) delay - the number of milliseconds to delay after sending the command; if omitted then the standard delay of 2000ms is used.
List<String> - a list of Zigbee commands to be sent to the group
def cmds = zigbee.groupOff(0x0156, 300)
Parse a Zigbee message into a Map. This method currently handles messages that start with “catchall” or “read attr”.
Map parseDescriptionAsMap(String description)
description - the Zigbee message to parse.
Map - a Map of key/value pairs that have been parsed from the Zigbee message.
def msgMap = zigbee.parseDescriptionAsMap("catchall: 0104 0008 0A 01 0140 00 1A67 00 00 0000 0B 01 0400")
Generates a Zigbee read attribute command.
List<String> readAttribute(Integer cluster, Integer attributeId, Map additionalParams = [:], int delay = STANDARD_DELAY_INT)List<String> readAttribute(Integer cluster, List<Integer> attributeIds, Map additionalParams = [:], int delay = STANDARD_DELAY_INT)cluster - Zigbee cluster IDattributeId or attributeIDs - Attribute ID or list of attribute IDs (can be used if reading multiple attributes from same cluster)additionalParams - as specified for zigbee.command(), plus profileId (Integer or hex String) to append the profile fielddelay - the number of milliseconds to delay after sending the command; if omitted then the standard delay of 2000ms is used.List of Zigbee commands formatted based on the specified parameters.
zigbee.readAttribute(0x0006, 0x0000) // fetch on/off state
zigbee.readAttribute(0x0008, 0x0000, [destEndpoint: 2], 0) // fetch level for endpoint 2
Generates a Zigbee write attribute command.
List writeAttribute(Integer cluster, Integer attributeId, Integer dataType, Integer value, Map additionalParams = [:], int delay = STANDARD_DELAY_INT)cluster - Zigbee cluster IDattributeId - Attribute IDdataType - The Zigbee data type (ultimately the numeric value per the ZCL specification, though com.hubitat.zcl.DataType offers easy-to-use equivalents like UINT8, BOOLEAN, or INT24)additionalParams - as specified for zigbee.command()delay - the number of milliseconds to delay after sending the command; if omitted then the standard delay of 2000ms is used.List of Zigbee commands formatted based on the specified parameters.
// where MFR_CUSTOM_CLUSTER is a manufacturer custom cluster and MFR_MFG_CODE is
// the manufacturing code, both defined elsewhere: writes 0x01 to attribute 0x05 of
// unsigned 8-bit integer type on endpoint 2 with no delay after
zigbee.writeAttribute(MFR_CUSTOM_CLUSTER, 0x05, com.hubitat.zigbee.DataType.UINT8,
0x01, [destEndpoint: 2, mfgCode: MFR_MFG_CODE], 0)
List writeAttribute(Integer cluster, Integer attributeId, Integer dataType, Integer value, Map additionalParams = [:], int delay = STANDARD_DELAY_INT)Generates commands to bind and configure reporting for the On/Off cluster.
List<String> onOffConfig()List<String> onOffConfig(Integer minRefreshInterval, Integer maxRefreshInterval)List<String> onOffConfig(String alternateEndpointId)List<String> onOffConfig(String alternateEndpointId, Integer minRefreshInterval, Integer maxRefreshInterval)minRefreshInterval - The minimum reporting interval, in seconds.maxRefreshInterval - The maximum reporting interval, in seconds.alternateEndpointId - Optional; an endpoint ID to use instead of the device's endpoint. If null or empty, the device's endpoint is used.List<String> - a list of Zigbee commands to be sent to the device
Generates a command to read the On/Off cluster attribute.
List<String> onOffRefresh(int delay = STANDARD_DELAY_INT)delay - Optional; the number of milliseconds to delay after sending the command (defaults to 2000); a non-positive value omits the delay.List<String> - a list of Zigbee commands to be sent to the device
Generates commands to bind and configure reporting for the Level Control cluster.
List<String> levelConfig()None
List<String> - a list of Zigbee commands to be sent to the device
Generates a command to read the Level Control cluster attribute.
List<String> levelRefresh(int delay = STANDARD_DELAY_INT)delay - Optional; the number of milliseconds to delay after sending the command (defaults to 2000); a non-positive value omits the delay.List<String> - a list of Zigbee commands to be sent to the device
Generates commands to bind and configure reporting for color temperature.
List<String> colorTemperatureConfig()None
List<String> - a list of Zigbee commands to be sent to the device
Generates a command to read the color temperature attribute.
List<String> colorTemperatureRefresh(int delay = STANDARD_DELAY_INT)delay - Optional; the number of milliseconds to delay after sending the command (defaults to 2000); a non-positive value omits the delay.List<String> - a list of Zigbee commands to be sent to the device
Generates commands to bind and configure reporting for temperature.
List<String> temperatureConfig()List<String> temperatureConfig(Integer minRefreshInterval, Integer maxRefreshInterval)minRefreshInterval - The minimum reporting interval, in seconds.maxRefreshInterval - The maximum reporting interval, in seconds.List<String> - a list of Zigbee commands to be sent to the device
Generates commands to bind and configure reporting for battery attributes.
List<String> batteryConfig()None
List<String> - a list of Zigbee commands to be sent to the device
Generates a command to read the electrical active power attribute.
List<String> electricMeasurementPowerRefresh(int delay = STANDARD_DELAY_INT)delay - Optional; the number of milliseconds to delay after sending the command (defaults to 2000); a non-positive value omits the delay.List<String> - a list of Zigbee commands to be sent to the device
Generates a command to read the two specified attributes.
List<String> refreshData(String attr1, String attr2)attr1 - The first attribute ID.attr2 - The second attribute ID.List<String> - a list of Zigbee commands to be sent to the device
Generates the commands to bind and configure reporting for one cluster attribute.
List<String> configureReporting(Integer clusterId, Integer attributeId, Integer dataType, Integer minReportTime, Integer maxReportTime, Integer reportableChange = null, Map additionalParams = [:], int delay = STANDARD_DELAY_INT)clusterId - The Zigbee cluster IDattributeId - The attribute ID within the clusterdataType - The Zigbee ZCL data type IDminReportTime - The minimum reporting interval, in secondsmaxReportTime - The maximum reporting interval, in secondsreportableChange - Optional; the amount of change that triggers a report, in the units of dataType. Ignored for discrete data types.additionalParams - Optional Map specifying additional parameters, any of:
mfgCode - Manufacturer specific code (Integer or hex String)destEndpoint - Destination endpoint for message (Integer)delay - Optional; the number of milliseconds to delay after sending the command (defaults to 2000); a non-positive value omits the delay.List<String> - a list of Zigbee commands to be sent to the device
Generates a command to read the reporting configuration of one cluster attribute. (Since 2.2.4)
List<String> reportingConfiguration(Integer clusterId, Integer attributeId, Map additionalParams = [:], int delay = STANDARD_DELAY_INT)clusterId - The Zigbee cluster IDattributeId - The attribute ID within the clusteradditionalParams - Optional Map specifying additional parameters, any of:
profileId - Profile ID to add (Integer or hex String)mfgCode - Manufacturer specific code (Integer or hex String)destEndpoint - Destination endpoint for message (Integer)delay - Optional; the number of milliseconds to delay after sending the command (defaults to 2000); a non-positive value omits the delay.List<String> - a list of Zigbee commands to be sent to the device
Generates the commands to write the IAS Zone enrollment attribute and send the enroll response.
List<String> enrollResponse(int delay = STANDARD_DELAY_INT, Map additionalParams = [:])delay - Optional; the number of milliseconds to delay between commands (defaults to 2000); a non-positive value omits the delays.additionalParams - Optional Map specifying additional parameters, any of:
destEndpoint - Destination endpoint for message (Integer)useZigbee3Ack - If true, use the Zigbee 3 acknowledgement command; otherwise the legacy raw response is used (Boolean)List<String> - a list of Zigbee commands to be sent to the device
Generates a command to set the level (0 to 100).
List<String> setLevel(BigDecimal level)List<String> setLevel(BigDecimal level, BigDecimal rate)List<String> setLevel(Integer level, BigDecimal transition = 0xFFFF, int delay = STANDARD_DELAY_INT)List<String> setLevel(Integer level, Integer rate)level - The target level, from 0 to 100rate - The transition ratetransition - Optional; the transition time in deciseconds (defaults to 0xFFFF).delay - Optional; the number of milliseconds to delay after sending the command (defaults to 2000); a non-positive value omits the delay.List<String> - a list of Zigbee commands to be sent to the device
Generates a command to set the level (0 to 100) of a Zigbee group.
List<String> setGroupLevel(Integer groupID, BigDecimal level)List<String> setGroupLevel(Integer groupID, BigDecimal level, BigDecimal rate)List<String> setGroupLevel(Integer groupID, Integer level, BigDecimal transition = STANDARD_TRANSITION, int delay = STANDARD_DELAY_INT)groupID - The Zigbee group IDlevel - The target level, from 0 to 100rate - The transition ratetransition - Optional; the transition time in deciseconds (defaults to 16).delay - Optional; the number of milliseconds to delay after sending the command (defaults to 2000); a non-positive value omits the delay.List<String> - a list of Zigbee commands to be sent to the device
Generates a command to set the color temperature.
List<String> setColorTemperature(BigDecimal value, int delay = STANDARD_DELAY_INT, int transition = STANDARD_TRANSITION)List<String> setColorTemperature(Integer value, int delay = STANDARD_DELAY_INT, int transition = STANDARD_TRANSITION)List<String> setColorTemperature(String value, int delay = STANDARD_DELAY_INT, int transition = STANDARD_TRANSITION)value - The color temperature, in kelvindelay - Optional; the number of milliseconds to delay after sending the command (defaults to 2000); a non-positive value omits the delay.transition - Optional; the transition time in deciseconds (defaults to 16).List<String> - a list of Zigbee commands to be sent to the device
Generates a command to set the color temperature of a Zigbee group.
List<String> setGroupColorTemperature(Integer groupID, BigDecimal value, int delay = STANDARD_DELAY_INT, int transition = STANDARD_TRANSITION)List<String> setGroupColorTemperature(Integer groupID, Integer value, int delay = STANDARD_DELAY_INT, int transition = STANDARD_TRANSITION)List<String> setGroupColorTemperature(Integer groupID, String value, int delay = STANDARD_DELAY_INT, int transition = STANDARD_TRANSITION)groupID - The Zigbee group IDvalue - The color temperature, in kelvindelay - Optional; the number of milliseconds to delay after sending the command (defaults to 2000); a non-positive value omits the delay.transition - Optional; the transition time in deciseconds (defaults to 16).List<String> - a list of Zigbee commands to be sent to the device
Generates a command to set the color hue.
List<String> setHue(Integer value, int delay = STANDARD_DELAY_INT, int transition = STANDARD_TRANSITION)value - The hue, as a percentage (0 to 100)delay - Optional; the number of milliseconds to delay after sending the command (defaults to 2000); a non-positive value omits the delay.transition - Optional; the transition time in deciseconds (defaults to 16).List<String> - a list of Zigbee commands to be sent to the device
Generates a command to set the color saturation.
List<String> setSaturation(Integer value, int delay = STANDARD_DELAY_INT, int transition = STANDARD_TRANSITION)value - The saturation, as a percentage (0 to 100)delay - Optional; the number of milliseconds to delay after sending the command (defaults to 2000); a non-positive value omits the delay.transition - Optional; the transition time in deciseconds (defaults to 16).List<String> - a list of Zigbee commands to be sent to the device
Generates a command to set the color from hue and saturation.
List<String> setColor(Map value, int delay = STANDARD_DELAY_INT)value - A Map with these keys:
hue - required; the hue percentage (0 to 100)saturation - required; the saturation percentage (0 to 100)transition - optional; the transition time in deciseconds (defaults to the standard transition of 16)delay - Optional; the number of milliseconds to delay after sending the command (defaults to 2000); a non-positive value omits the delay.List<String> - a list of Zigbee commands to be sent to the device
Generates a command to set the color from normalized XY coordinates. (Since 2.0.6)
List<String> setColorXY(Map value, int delay = STANDARD_DELAY_INT)value - A Map with these keys:
x - required; the x coordinatey - required; the y coordinatetransition - optional; the transition time in deciseconds (defaults to the standard transition of 16)delay - Optional; the number of milliseconds to delay after sending the command (defaults to 2000); a non-positive value omits the delay.List<String> - a list of Zigbee commands to be sent to the device
Starts the Zigbee over-the-air (OTA) firmware update flow for the device. (Since 2.2.7)
List<String> updateFirmware(Map options = null)options - Optional Map, any of:
manufacturer - the manufacturer code (Integer); defaults to 0xFFFFtype - the image type (Integer); defaults to 0xFFFFList<String> - a list of Zigbee commands to be sent to the device
Converts a supported Zigbee description into an event Map (e.g., for use with sendEvent()).
Map getEvent(String description)description - The catchall or read-attribute description textA Map with name and value (and, for temperature events, unit and descriptionText); an empty Map if the description is not recognized.
Recognizes supported on/off reports and converts them to a typed switch Map.
Map getKnownDescription(String description)description - Zigbee catchall or read-attribute descriptionA Map with name ("switch"), value ("on" or "off"), and type ("switch"); an empty Map if the description is not recognized.
Parses a Zigbee description into a SmartShield object.
SmartShield parse(String description)description - The Zigbee description text to decodeThe decoded object, or null if the description is not supported
Parses an IAS Zone status description.
ZoneStatus parseZoneStatus(String description)description - The Zigbee description text to decodeThe decoded zone status (ZoneStatus), or null if the description is not supported
Parses an IAS Zone status-change description. (Since 2.2.7)
Map parseZoneStatusChange(String description)description - Status text beginning with zone status; other prefixes return nullA map with sourceEndpoint, extendedStatus, zoneId, and delay (all String), and alarm1Set, alarm2Set, tamperSet, batterySet, supervisionReportsSet, restoreReportsSet, troubleSet, acSet, testSet, and batteryDefectSet (all Boolean). Malformed matching text can throw parse or indexing exceptions.
Formats an integer as an uppercase hexadecimal String with a minimum width.
String convertToHexString(Integer value, Integer width)value - The integer to formatwidth - The minimum number of hexadecimal digitsString - The hexadecimal String
Parses a hexadecimal String as an integer.
Integer convertHexToInt(String value)value - The hexadecimal String to parseInteger - The integer value
Decodes each pair of hexadecimal digits in a String as a character.
String hex2String(String arg)arg - The hexadecimal String to decodeString - The decoded String
Swaps the two bytes of a four-digit hexadecimal value. (Since 2.0.5)
String swapOctets(String bytes)bytes - The four-digit hexadecimal StringString - The swapped hexadecimal String
Returns the ZigbeeCluster enum class. (Since 2.0.4)
Class<ZigbeeCluster> getCluster()None
The ZigbeeCluster enum class