Does just opening the door of your Faraday cageâ metal enclosure boost the signal by much? How much? Is the opening facing your WiFi router at the other end? WiFi transmissions usually prefer line of sight directionality.
Be aware of the resonant wavelength of 2.4Ghz (the standard frequency the Tuya CB3S module uses), and penetration hole sizes approaching these dimensions of around 5 inches/11cm may actually form a waveguide that can attenuate signals. Sticking an antenna at the end of shielded coax cable of indeterminate length (800mm is fine) is standard practise, as long as the antenna itself is of correct resonant wavelength as a multiple/divisor of it, and your coax is properly grounded. At 433Mhz (apparently unused in your scenario but a possible security weakpoint where a passer-by with a 433Mhz controller could operate your gate - snip the black curly pigtail antenna off flush at the circuit board if you are not using the 433Mhz portion and measure it in case you need it in the future), it is a lot simpler, and the pigtail antenna may vary by quite a bit and still be good enough.
At 2.4Ghz WiFi frequencies, it is more critical, but as long as some signal improvement is achieved, you may be able to get away with it. Putting your device outside the metal box, on the side facing your WiFi device/router (the signals on those wires not being at radio frequencies) will be probably work better - using cables that are mains rated in thickness will result in negligible loss as you only have power connections wired to the board. Try it with temporary wire extensions (suitably insulated for safety reasons) but hanging free without putting it inside a plastic waterproof enclosure, and see how well it works. Same with an external 2 4Ghz antenna - just make sure there is proper grounding as this forms a critical part of the antenna functionality and effectiveness. This also give you room for orientation experiments to find the optimum way to point the antenna to get the best signal.
If pointing a stick antenna up on the outside of the metal enclosure works best, try pointing down at the bottom, and you may find it is just as good but less exposed to the weather for longer life, and you can use the grommets to pass the coax through.
A 2.4Ghz stick antenna rated for 3dB gain gives you double the signal. 6bB four times - it is exponential. No point in going for anything too expensive as the benefits of a bigger antenna donât necessarily improve with greater expense, as now you are picking up signal from other devices and interference from other devices too. Monitor your signal strength. The existing -84dBm is at the lower threshold of good transmission. If you can raise it to the -70âs then you should notice significant improvement in reliability.
Google the term âcantennaâ for some interesting insights. If you are going to experiment with rolling your own antenna, and you decide it works well enough, make sure to weatherproof the final result, not just for wind and rain, but spiders and nesting birds
Should this fail, consider dumping WiFi as your transmission method and get something that supports a transmission technology such as hardwired RS485 that will give you robust connectivity for up to a km, but you will have to run twisted pair cable back to your HomeAssistant box and have an adapter at that end. A gate controller supporting RS485 may cost a bit more, but be far more reliable. Consider rolling your own, with a RS485 relay board at the gate, and the smarts inside your home.
Another option is LoRa, similar to WiFi but rated for greater transmission distances. You may find gate controllers for LoRa hard to find or not on the market yet.
Curious to see how your experiments turn out.