I have created blueprint with your solution: https://community.home-assistant.io/t/zigbee-button/883162