As far as the physical installation is concerned, it looks like there could be some moisture in the area, because of the switch housings, and if any moisture were to run down the wire into the wire into the Sonoff there would obviously be quite a big bang. As the Sonoff has no earth connection then moisture wouldn’t immediately cause an earth leakage situation, which could be dangerous.
I’d be tempted to put the Sonoff in a waterproof box, althoughthe DHT sensors would obviously need to be mounted externally.
Actually, I’d probably not use a Sonoff because of the limited number of pins available and the difficulty in accessing the pins easily.
I did something similar where I put an RFID reader on the outside and added the ability to release the gate using Blynk (or other methods such as a 433MHz button). I had 12v available as part of the existing gate release system, so I didn’t need a mains adapter, I just needed to step the 12v down to 5v.
More about that project here:
I’ve been thinking of adding a sensor to my system to detect when the gate isn’t properly closed, and I’d had it in my mind that this would be a microswitch, but a magnetically operated reed switch is a much neater idea.
Pete.