This case allows to use the Xiaomi Mi Door and Window Sensor 2 as a magnetic pulse sensor for BK-G4 gas meter. Use at your own risk.
Parts you will need
Assembly
Install the M4 nut insert by pushing it into the hole with a soldering iron. Carefully disassemble the Xiaomi sensor. You need the PCB and the internal frame, add CR2032 coin battery and from the oposite side add the printed insert. Make sure you orient the insert correctly otherwise you can damage the PCB! Insert the group into the hole in the case. The microswitch on the PCB must face down, metalic antenna (preferably) on the right. Attach the case to the gas meter and secure it with M4 screw.
Note
The cutout on the bottom side of the case was intended to allow pressing the button from outside. However, it does not fit perfectly and insetad it pushes the entire PCB a bit more towards the sensor hole.
The author marked this model as their own original creation.