This gets asked every couple months. Here’s the most recent thread about it: Switch operated fireplace -- Best option and price for a dry contact relay whether z-wave or zigbee
In general you will probably parallel the switch wires with the relay so you still have local control.