I'm trying to send a string to a Zigbee CC2530 based device. The information on the device states it communicates with "ZCL_CLUSTER_ID_GEN_MULTISTATE_VALUE_BASIC" and "ATTRID_IOV_BASIC_STATE_TEXT" (see below).
I've put together the he wattr command, guessing how to built the different parameters. I skipped the CMD parameter but don't know if it being missing screws up the command structure.
Any guidance or an example will be greatly appreciated.
Thanks
John
Error LOG:
My Reference Material:
Zigbee clusters
Zigbee cluster: ZCL_CLUSTER_ID_GEN_MULTISTATE_VALUE_BASIC
Zigbee attributes: ATTRID_IOV_BASIC_STATE_TEXT - UART data
You should use the "ZCL_DATATYPE_OCTET_STR" (0x41) or "ZCL_DATATYPE_CHAR_STR" (0x42) data types for this attribute.
Additional Info:
try:
he wattr 0x${device.deviceNetworkId} 1 0x0014 0x08 0x000E 0x42 {testString}
dev:40912024-10-26 21:58:31.759infofingerprint profileId:"0104", endpointId:"01", inClusters:"0000,0014", outClusters:"0000", model:"ptvo.switch", manufacturer:"ptvo.info", controllerType: "ZGB"
Device info:
dev:40912024-10-26 21:58:31.660traceZCL version:01
dev:40912024-10-26 21:58:31.657traceSoftware Build Id:2024-07-23
dev:40912024-10-26 21:58:31.654traceModel:ptvo.switch
dev:40912024-10-26 21:58:31.651traceManufacturer:ptvo.info
Error LOG:
My Latest Code:
// Hubitat driver for PTVO CC2530 Zigbee Board
import hubitat.device.HubAction
import hubitat.device.HubMultiAction
import hubitat.device.Protocol
metadata
{
definition(name: "Zigbee Raw Message", namespace: "johnrob", author: "johnr")
{
capability "Actuator"
//capability "Switch"
//capability "Initialize"
attribute "mystr", "String"
command "Str01"
command "sendCommand", ["string"] //allows arbitrary comm
}
preferences{
// input name: "logEnable", type: "bool", title: "Enable debug logging", defaultValue: true
// input name: "logInfo", type: "bool", title: "Enable Info logging", defaultValue: false
} // --- metadata ---
}
def parse(String description){
log.info "Raw Description#$description"
Map map = [:]
def event = zigbee.getEvent(description)
//if (event) sendEvent(event)
if (description?.startsWith('read attr -')){
def descMap = zigbee.parseDescriptionAsMap(description)
if (descMap.cluster == "000C" && descMap.attrId == "0055"){ // zigbee spec 0x000C= read analog cluster 0x0055 = present value
ZigbeeHexMap = descMap.value
log.info "Zigbee Msg#$ZigbeeHexMap"
float SensorValue = ConvertHexToFloat(ZigbeeHexMap)
def otherAttrs = descMap?.additionalAttrs
otherAttrs.each{
unitaddress = it.value
}
log.info ("$unitaddress")
def (units, address) = unitaddress.tokenize( ',' ) // <--- units and I2C address
} // --- if cluster ---
} // --- if "read attr" ---
} // --- parse ---
def Str01() {
string mystr = "wxyz"
def packed = hubitat.helper.HexUtils.byteArrayToHexString(mystr.getBytes())
"he wattr 0x${device.deviceNetworkId} 1 0x0014 0x08 0x000E 0x42 {4"+packed+"}"
}