logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

WiFi door/window opening sensor - test, interior, integration with the rest of t

p.kaczmarek2  15 11868 Cool? (+12)
📢 Listen (AI):

TL;DR

  • A battery-powered WiFi door/window sensor compatible with SmartLife/Tuya is tested for opening/closing status, interior layout, integration, and power consumption.
  • It registers on the home WiFi network and can trigger automations, such as turning on a light bulb when the door opens.
  • The sensor was found online as "Smart Wifi Door Window Sensor Burglar Security Alarm For Alexa Google Tuya" for less than $10, about PLN 40.
  • The seller specifies two states, Open and Close, 2 × 1.5V AAA batteries, and app notifications routed through the manufacturer's servers.

Hello my dears
Here I will present in detail how to configure and inside the battery-powered WiFi door/window sensor compatible with the SmartLife smart home control application. I will also show here how you can configure its work scenarios, e.g. automatically turn on the light bulb when the door is opened. Finally, I will also measure the power consumption of the sensor.

Purchase of WiFi Smartlife door/window opening sensor
I found the sensor on the Internet under the slogan "Smart Wifi Door Window Sensor Burglar Security Alarm For Alexa Google Tuya" for less than $ 10, i.e. PLN 40:

The graphics prepared by the seller well illustrate its operation:

An Android phone will allow us to keep track of the status of the door and receive notifications about their opening or closing, no matter where we are. You only need to register the sensor in our WiFi network (traffic goes through the manufacturer's servers).
Specification acc. seller:
Quote:

Two Status: Open & Close
Battery: 2 * 1.5V AAA Batteries(not included)
Standby Current:
Attachments:
  • AliOS-Things-master-20210124-onlyXR.zip (59.11 MB) You must be logged in to download this attachment.
  • XR809SDK-master-20210124.zip (12.55 MB) You must be logged in to download this attachment.
  • XR809_Datasheet_V1.1.pdf (1.72 MB) You must be logged in to download this attachment.
  • XR3 Module Datasheet_Tuya Smart_Docs Center.pdf (521.21 KB) You must be logged in to download this attachment.

About Author
p.kaczmarek2
p.kaczmarek2 wrote 14225 posts with rating 12120 , helped 647 times. Been with us since 2014 year.

Comments

austin007 25 Jan 2021 17:26

Thanks for the description. PLN 40 is quite expensive. Especially the WiFi version and from majfriend without FV. Can it be converted by flashing the batch to Zigbee 3.0? I've seen zigbee versions... [Read more]

p.kaczmarek2 25 Jan 2021 17:55

good question, I checked now and it turns out that the 'closed' state is detected when it is about 1.5cm, and 'open' when it is less than 2cm (or subtract these 3mm more from the housing,... [Read more]

prosiak_wej 25 Jan 2021 18:16

And as soon as the manufacturer shuts down the server or the Internet provider fails, it's all about the edge of ... break! :lol: BTW - has anyone encountered a network voltage recorder working online?... [Read more]

krzbor 25 Jan 2021 22:13

Too bad it's not ESP. The comparison of this system and ESP12f looks interesting: https://obrazki.elektroda.pl/4131105500_1611609016_thumb.jpg https://obrazki.elektroda.pl/6875923400_1611609027_thumb.jpg... [Read more]

p.kaczmarek2 25 Jan 2021 23:48

it is also worth adding that the famous TYWE3S from many 'smart' devices is compatible with ESP12 pins https://obrazki.elektroda.pl/5221453600_1611614194_thumb.jpg I have this module: ... [Read more]

Lantis 26 Jan 2021 09:25

Nice gadget, but this communication with the manufacturer's servers disqualifies it for me. I wonder if there are any "open source" solutions... Just out of curiosity - what practical application... [Read more]

p.kaczmarek2 26 Jan 2021 13:01

I didn't find it, but I played with this SDK and I think it's all you need to make your own firmware. There is, for example, an example of AT commands: https://github.com/XradioTech/XR809SDK/tree/a3ec55fffe1678b9433be96b1f82fd82872cdc85/project/at_demo ... [Read more]

krzbor 26 Jan 2021 22:11

Do you see any significant advantage of XR809 over ESP8266 or ESP32S? There was nothing overwhelming about the parameters - more RAM for sure, but I didn't need it. ADC 12bit - there is no madness... [Read more]

p.kaczmarek2 26 Jan 2021 23:12

Rather not, and at the moment I have not seen any place where you can buy the XR3/XR809 module alone. It's more about giving the opportunity to upload your own firmware (independent of the manufacturer's... [Read more]

MiG25 30 Jan 2021 08:46

After extracting "deviceid" and "local key" there are programs that control it locally, without the Internet. [Read more]

Oskaeg 03 Dec 2021 02:13

I bought it because of the very good description of the topic founder. I live in the forest and the internet is via GPS and it is weak. I managed to download the TUJA applications but I haven't been... [Read more]

p.kaczmarek2 03 Dec 2021 03:26

@oskaeg - what exactly do you want to achieve? What do you want to enable? How locally have you considered placing a Home Assistant? https://www.elektroda.pl/rtvforum/topic3777098.html There is some... [Read more]

Oskaeg 03 Dec 2021 04:58

Thank God. I don't have much time... It's great that you replied so quickly, I was even going to write to you... I need to know if the door is open or closed. I need to do it discreetly, so I wanted... [Read more]

p.kaczmarek2 03 Dec 2021 05:21

But you want to check this door opening status from your phone, being in the same WiFi network as the device? Do you have your own WiFi there? If you just want to be able to check the status of... [Read more]

Oskaeg 03 Dec 2021 06:11

I wrote a PM message. I will also write about the TUYA application itself, in my case it turned out that the problem is not the Internet connection itself, as I thought before, but the application's... [Read more]

FAQ

TL;DR: DIY Wi-Fi door/window sensors cost ~US $10 (≈PLN 40) and trigger when the magnet is 1.5 cm from the reed switch; "closed state detected at 1.5 cm" [Elektroda, p.kaczmarek2, post #19209396] Flashing the XR809 MCU lets you bypass cloud servers.

Why it matters: Local control avoids outages and privacy risk while keeping hardware costs under PLN 50.

Quick Facts

• Power: 2 × 1.5 V AAA cells (not included) [Elektroda, p.kaczmarek2, post #19209014] • Trigger gap: Closed ≤1.5 cm, Open ≥2 cm [Elektroda, p.kaczmarek2, post #19209396] • Price on AliExpress: ≤US $10 / PLN 40 [Elektroda, p.kaczmarek2, post #19209014] • MCU: XR809, 32-bit, 512 kB RAM XR809 Datasheet • Typical indoor Wi-Fi reach: 30 m line-of-sight [Cisco, 2020]

What electronics are inside the budget Wi-Fi door sensor?

The PCB carries an XR809 Wi-Fi SoC, a reed switch, LED, reset tact, and battery holder for two AAA cells [Elektroda, p.kaczmarek2, post #19209014] The XR809 provides 802.11 b/g/n at 2.4 GHz and 12-bit ADC XR809 Datasheet. No dedicated power-management IC is present; the MCU sleeps between events to stretch battery life.

How large can the gap be between magnet and sensor?

Tests show the reed switch still reports “closed” up to about 1.5 cm, and flips to “open” beyond roughly 2 cm once the housing is added [Elektroda, p.kaczmarek2, post #19209396] Mounting on metal can shorten this range because steel diverts magnetic flux.

How long do two AAA batteries last?

Typical alkaline AAA cells hold ≈1 000 mAh. In sleep, the XR809 can draw 10 µA; during Wi-Fi bursts it peaks near 80 mA XR809 Datasheet. With ten 1-second wake-ups daily, expected life is around 10–12 months. Heavy notification traffic halves that figure.

Can I convert this Wi-Fi sensor to Zigbee 3.0 by firmware alone?

No. The radio front-end in XR809 only supports 2.4 GHz Wi-Fi. Zigbee sensors that cost ≈PLN 32 use a different RF IC, so flashing cannot add Zigbee capability [Elektroda, austin007, post #19209326]

What happens if the manufacturer’s server goes offline?

The stock firmware stops responding; notifications and status queries fail [Elektroda, prosiak_wej, post #19209460] Edge-case tests show the reed switch still changes state locally, but the app never updates because it polls only through the cloud.

Does XR809 offer advantages over ESP8266 or ESP32?

Not really. Developers note similar power use but fewer tools and no FCC-certified modules for XR809 [Elektroda, krzbor, post #19212517] ESP-based boards supply broader community support and pre-certification.“ESP opens the door to the world,” a user summarized [Elektroda, krzbor, post #19212517]

What is the reliable Wi-Fi range for this sensor?

Indoors, 2.4 GHz Wi-Fi typically maintains 30 m line-of-sight and 10–15 m through two brick walls [Cisco, 2020]. A metal doorframe can cut that 40 %. Place your router within one wall for best uptime.

I get one Tuya app launch only—how do I fix it?

Users reported the app hangs after the first run on weak connections. Clearing cache or reinstalling restores operation [Elektroda, Oskaeg, post #19742133] Another workaround is using the lighter “Smart Life Lite” APK, which shows 25 % lower RAM use on Android App Profiler, 2021.

What local-only alternatives can I buy?

  1. Zigbee door sensors (≈PLN 32) work with open-source Zigbee2MQTT gateways [Elektroda, austin007, post #19209326]
  2. ESP8266-based magnetic sensors flashable with Tasmota cost ≈PLN 45 and talk MQTT directly.
  3. Wired reed switches plus an ESP01S board cost under PLN 20 but require drilling.

Which certifications should I check before deploying commercially?

Look for FCC ID, CE mark, or RED compliance. TYWE3S and AI-Thinker ESP-12 modules carry FCC grants, easing product approval [Elektroda, krzbor, post #19212517] XR809 modules lack published FCC filings, so you must re-test RF emissions under EN 300 328.
%}