Ok, I’m not a Zigbee expert but indeed what you propose seems good
A short post by @AlexTrovato that explains how to add a Zigbee feature: