Write zigbee attribute

I am trying to change the autolock attribute on my Nimly lock but I can't get it to work.

(Door lock cluster 0x0101, attribute 0x0023)

I can read the attribute with

def cmd = [
	    "he rattr 0x${device.deviceNetworkId} 0x${device.endpointId} 0x0101 0x0023{}",

But i can't figure out how to change it. I have tried:

def cmd = [
            "he wattr 0x${device.deviceNetworkId} 0x${device.endpointId} 0x0101 0x0023 0x01{}",

Am I doing it wrong?

try return zigbee.writeAttribute(0x0101, 0x0023, 0x23, 0x01, [:],0)

1 Like

Thank you! This works!

Can you please explain what the added parts is for? 0x23 and [:],0

0x23 is the data type, which is required and missing from your wattr example
[:] are optional attributes, 0 is an intra command delay value tacked to the end, used when multiple commands are sent together.

Thank you for clearing that up for me! :smiley:

1 Like

Download the Hubitat app