Ok, first things first, the DW2-Wi-Wi door sensor is as it says, WiFi, not RF or Bluetooth (though it does use BT to setup with the eWeLink APP in the first place).
I looked here on Amazon and read someone saying the device was almost impossible to pair – mine paired with the Sonoff eWeLink APP pretty much immediately – I think that user must’ve used the wrong pairing method. The correct method with this device is Bluetooth.
Someone else commented on battery life, which is supposed to be 3 months, the user said they got much less than that – but didn’t specify what kind of AAA batteries they used. I’ve had this issue with ESP8266 and AAA batteries (see my CRICKETS article) – Kodak for example don’t last any time at all so I simply stopped using them ages ago. I generally use GPExtra AAA batteries from Amazon and elsewhere as they are cheap and seem to last. If I need long life I go for Energizer Ultimate Lithium AAA.
So, just what chip DO Sonoff use for this door sensor? NOT an ESP32 – but something else: OPL1000.
I’m not familiar with that chip – but there you have it -opened up.
Once I had the device talking to eWeLink, I went to my Node-Red installation and looked up my node-red-contrib-ewelink nodes which work fine as well, unce the device has been paired into the eWeLink APP – from there, the Node-Red nodes no longer need your phone switched on.
I’ve been messing with this all day and the battery indicator in the Sonoff APP still says full and my nodes report 100 (assume 100%) – clearly it would take weeks or months to test battery life so I’ll leave this sensor and it’s magnet on a door somewhere.
In my original article I left sensors on doors on the UK home we no longer own (and I left them on the doors… dohhh!)
Importantly the sensor reports both ON and OFF state (open and closed) as well as WiFi signal level and battery level. I also got the firmware details: 1000.2.1195 – a later version than the first DW2-WiFi I received a while ago… see the original blog entry which also covered other Sonoff products.
For the above Node-Red nodes, the first eWeLink node (eWeLink Devices) needs nothing more than your free eWeLink account credentials (ie a sequence of numbers and letters with a period part way through) and the second (eWeLink Event Listener) needs the same code and a device ID which can be picked up from the output of the first node.
The FUNCTION node is how I get out useful info.
As for the gap needed – my hand is pretty normal size. Judge for yourself. Of course if you don’t want to use Node-Red, the Sonoff eWeLink APP is ok. For the record, I’m not finding the node-red-contrib-ewelink node (eWeLink event listener) 100% reliable – I AM finding the APP 100% reliable. For the APP with my WiFi turned off and Bluetooth turned off – which means the round trip has to be via Sonoff servers, I’m finding less than 0.5 seconds response time to be typical for screen response. With my phone in my pocket, audio notifications maybe 1-20 seconds (and I JUST realised I can customise notifications on a per-app basis – how did I miss out on that until now!)
msg.payload = "Device " + msg.payload.deviceid + "=" + msg.payload.params.switch + global.get("handyDate"); return msg;