My use case is a bit unusual: I needed a contact sensor to determine whether a driveway barrier is open or closed – partly to be able to tell whether the house is occupied or unoccupied (for tracking energy consumption), and partly to automatically turn on orientation lighting when the barrier opens. I wasn’t able to find an outdoor Zigbee or WiFi contact sensor (e.g. a door/window sensor) for outdoor use as a clean, hub-free solution. This describes the technical solution I ended up with. A Sonoff SNZB-04P door and window sensor SNZB-04P and an IP65 junction box.
The problem: I couldn’t find an outdoor alternative
In my search for a dedicated outdoor Zigbee door/window sensor, I didn’t find what I wanted. There was a solution from Yale – but it required Yale’s own hub/bridge to work, and is therefore not a pure Zigbee device you can pair directly with your own Zigbee controller (e.g. via Home Assistant with a Zigbee dongle).
I also looked at more classic, mechanical solutions: microswitches/limit switches, reed relays/magnetic contacts intended for gates, and inductive sensors. What they all had in common was that they required a control unit placed indoors, and therefore digging in cables all the way to the barrier. Since I would ideally have a low-voltage supply (12/24V), that meant yet another transformer in the installation.
That made the cable-based solutions far more complicated and costly than they first appeared.
It’s worth noting the difference in principle: a microswitch/limit switch is a mechanical contact that needs a physical push or the release of an arm/pin to change state. A reed contact works differently – it consists of a transmitter with a reed relay (a magnet-sensitive, glass-sealed contact) and a separate magnet, and changes state purely from the magnet’s proximity (typically under 10-20 mm), with no physical contact involved. The Sonoff SNZB-04P is exactly this type of reed contact.
The solution: an indoor sensor in an IP65 box

The solution instead was to take a perfectly ordinary, cheap indoor Zigbee door/window sensor – the Sonoff SNZB-04P – and wrap it in a weatherproof enclosure.
Components:
- Sensor: Sonoff SNZB-04P – Zigbee 3.0 door/window sensor, battery-powered (CR2477, stated battery life 5+ years)
- Enclosure: Schneider Electric Mureva junction box, IP65, 87×87 mm, white
Since the sensor is wireless and battery-powered, there’s no cable entry to deal with – the whole task comes down to protecting the electronics itself from moisture and weather.
According to Sonoff’s own datasheet, the SNZB-04P is officially rated for indoor use (IP20), but the operating temperature is given as -10°C to 60°C at 5-95% RH, non-condensing. It’s precisely the moisture (condensation/rain) the IP65 box needs to handle – the cold should be something the electronics themselves can cope with.
The sensor is mounted against the top of the box with double-sided tape plus duct tape as extra security. The box itself is screwed to the mounting spot on the post under the barrier, and the screw entries are sealed so the IP65 rating is maintained.
Experience so far
The solution hasn’t yet been tested through a full winter, so there’s no practical experience with low temperatures yet – only the datasheet’s specifications to go on.
