writeAttribute isn't working

It’s difficult to know without seeing code. One thing to note is that calling zigbee.writeAttribute(...) does not send the command on it’s own but instead builds the appropriate command and returns it. If you return commands from specific methods, they will get sent down to the hub, otherwise you have to explicitly send the hub command similar to what is done here. Although that example is sending a generic command instead of a write attribute, but you would just replace the zigbee.command call with a zigbee.writeAttribute call.