This is probably a very easy question to answer and I apologise for not fining the solution myself but I have been trolling through the documentation for several hours now with no light in sight.
All the examples provided for Zigbee devices are set up to communicate directly from one device to another, eg. switch to light bulb. However, in the real world of home automation this is not the way it appears to work. Home automation networks have a coordinator that not only establishes the network and handles security but also manages all the interactions between devices. Switches do not talk to light bulbs directly but simply send their commands tot he coordinator or hub which is then responsible for deciding what to do in response to the command.
My problem is that there does not appear to be any documentation, at least not that I have found so far, that explains how to address the command correctly to send it to the coordinator. The coordinator is always address 0 but what about the endpoint? In my situation, using a SmartThings hub, the endpoint does not seem to matter as long as the address is set to 0. Is this correct? Is this the best practice or am I missing something here?