I damaged the zigbee chip, but the ability to control the relay remains. The relay changes state when a high signal is applied to a certain contact

I didn’t find any relevant information on the documentation page(gpio switch). The most appropriate thing is to create 4 momentary switch.
But how to properly combine them into a stateful switch? Or are there more elegant solutions?