Page 1 of 3
Cheap 433MHz door sensor (with open and close)
Posted: Sunday 03 September 2017 20:12
by JelteV
Hi,
So I don't know if this is special or not but I found these cheap Door sensor that look great, are really cheap (<€ 5,-) and send an
open and close signal.
https://www.aliexpress.com/item/433MHz- ... 91010.html

- IMG_4198.JPG (32.29 KiB) Viewed 19099 times
I thought I would share how to set them up in Domoticz.
So first this sensor has to be picked up by Domoticz. If you have an RFXCOM you need to enable the Lightning 4 mode.
As soon as this is enabled your sensor will show up in your list of (unused) devices as 2 devices with the same ID.
One device will be triggered when the door is opened, one will be triggered when the door is closed.
You need to find out which device is triggered when. You can find out by triggering each event. First move the contact away from the base, this will simulate opening the door. The "last seen" time of that device will change.
Rename that device. Let's call it "Front door open (event)".
Now move the contact back to the base. If you did it correct "last seen" time of the other device will change.
Rename that device. Let's call that "Front door close (event)".
And add them both as switches in Domoticz.
Both devices will be always on, you can't switch them off. To know the state of the door we need to add a new dummy switch.
Add a new dummy door contact and call it "Front door (Virtual)".
To know the state of the door we need to add 2 small scripts.
One when the door is opened and one when closed.
Here they are:
- Spoiler: show
-
Door open :
Code: Select all
return {
active = true, -- set to false to disable this script
on = {
devices = {
'Front door open (event)',
},
},
-- in case of a timer event or security event, device == nil
execute = function(domoticz, device)
if (device.changed) then
domoticz.devices('Front door (Virtual)').open()
end
end
}
Door close :
Code: Select all
return {
active = true, -- set to false to disable this script
on = {
devices = {
'Front door close (event)'
},
},
-- in case of a timer event or security event, device == nil
execute = function(domoticz, device)
if (device.changed) then
domoticz.devices('Front door (Virtual)').close()
end
end
}
There you have it.
A working 433MHz door contact in Domoticz with an open and close for less then € 5,-!
Now you always know the state of your door or window.
Re: Cheap 433MHz door sensor (with open and close)
Posted: Monday 04 September 2017 3:39
by aleph0
Thanks you very much for this info

I've been looking for something like that for a long time

Re: Cheap 433MHz door sensor (with open and close)
Posted: Sunday 10 September 2017 9:10
by Rolo
Can you tell wich type of battery is used in this switch?
Re: Cheap 433MHz door sensor (with open and close)
Posted: Sunday 10 September 2017 11:31
by sincze
Nice find. Even open/close. Well design looks also okay. Next stop will be their motion sensors right??
Re: Cheap 433MHz door sensor (with open and close)
Posted: Sunday 10 September 2017 11:32
by SweetPants
Rolo wrote: ↑Sunday 10 September 2017 9:10
Can you tell wich type of battery is used in this switch?
If you follow the link in the first post it says:
Power Supply:DC 12V(12V 23A battery)
Re: Cheap 433MHz door sensor (with open and close)
Posted: Sunday 10 September 2017 13:00
by Jem101
SweetPants wrote: ↑Sunday 10 September 2017 11:32
Rolo wrote: ↑Sunday 10 September 2017 9:10
Can you tell wich type of battery is used in this switch?
If you follow the link in the first post it says:
Power Supply:DC 12V(12V 23A battery)
Yes it does say that but it must be a misprint somewhere - a battery that can supply 23A at 12 V is a car battery! I suspect, looking at the other similar products, that it'll be something like a CR2032 button-type cell.
Re: Cheap 433MHz door sensor (with open and close)
Posted: Sunday 10 September 2017 13:44
by SweetPants
23 A is the battery type
http://www.toolstation.nl/shop/p92000?c ... gIvJ_D_BwE
very common type is chinese sensors. They are a little expensive in use
Re: Cheap 433MHz door sensor (with open and close)
Posted: Sunday 10 September 2017 14:19
by Jem101
Ah I didn't know that - I stand corrected!
Re: Cheap 433MHz door sensor (with open and close)
Posted: Wednesday 04 October 2017 22:13
by DzJan
Confirmed, the mentioned solution here is the best one found sofar.
A method using master/slave does do the open/close toggle but it is not logging the state in the switch' log.
Tips:
- When successful implemented, set the devices "Front door open (event)" and "Front door close (event)" as hidden via Setup -> More options -> Plans -> Roomplan. Select the line $Hidden Devices and Add the two devices.
Re: Cheap 433MHz door sensor (with open and close)
Posted: Thursday 12 October 2017 7:48
by BartSr
Maybe this might be helpfull.
I found this instruction which clearly explains how to.
https://www.youtube.com/watch?v=Oq-hN-RJ2sA
Re: Cheap 433MHz door sensor (with open and close)
Posted: Thursday 12 October 2017 11:08
by Milifax
My advice: don't use the master/slave option. It will save you a lot of trouble if you skip that part. Just add then as on or off devices.
See my struggle in a previous post:
viewtopic.php?f=59&t=18654
Re: Cheap 433MHz door sensor (with open and close)
Posted: Friday 13 October 2017 10:51
by BartSr
@Milifax: Thanks for pointing me to the unwanted side effect.
I just started with Domoticz and have (not yet) experience with the scripts which drove you crazy using this solution.
-Bart
Re: Cheap 433MHz door sensor (with open and close)
Posted: Friday 13 October 2017 11:20
by BartSr
In addition: Is it normal that it takes (variable) 2 - 5 seconds before a change of the status is reflected in the GUI?
Re: Cheap 433MHz door sensor (with open and close)
Posted: Saturday 28 October 2017 10:01
by MarnixO
Hi all
i have received the door sensors yesterday
With 1.5 volt battery included
they are recognized like a X10 security sensor by rfxcom
it has 3 states Alarm, Motion and Normal
the state normal can be trigered by the dashboard but not by actuating the sensor itself
so i wrote a dzvents script to change the state of the dummy doorsensor
json output:
{
ActTime: 1509176885,
ServerTime: "2017-10-28 09:48:05",
Sunrise: "08:31",
Sunset: "18:25",
result: [
{
AddjMulti: 1,
AddjMulti2: 1,
AddjValue: 0,
AddjValue2: 0,
BatteryLevel: 0,
CustomImage: 0,
Data: "Motion",
Description: "",
Favorite: 0,
HardwareID: 3,
HardwareName: "RFX",
HardwareType: "RFXCOM - RFXtrx433 USB 433.92MHz Transceiver",
HardwareTypeVal: 1,
HaveDimmer: false,
HaveGroupCmd: false,
HaveTimeout: false,
ID: "618000",
LastUpdate: "2017-10-28 09:29:07",
MaxDimLevel: 0,
Name: "deursensor 103",
Notifications: "false",
PlanID: "1",
PlanIDs: [
1
],
Protected: false,
ShowNotifications: true,
SignalLevel: 7,
Status: "Motion",
StrParam1: "",
StrParam2: "",
SubType: "X10 security",
SwitchType: "Security",
SwitchTypeVal: 0,
Timers: "false",
Type: "Security",
TypeImg: "security",
Unit: 0,
Used: 1,
XOffset: "0",
YOffset: "0",
idx: "103"
}
],
status: "OK",
title: "Devices"
}
Is there also an other way ?
Re: Cheap 433MHz door sensor (with open and close)
Posted: Saturday 28 October 2017 11:54
by miremi
If i follow link from the first post item is not available anymore.
Re: Cheap 433MHz door sensor (with open and close)
Posted: Saturday 28 October 2017 12:24
by BartSr
Similar (or maybe slightly differrent) type are availbale on other chinese web-shops.
e.g.
https://www.banggood.com/GS-WDS07-Wirel ... mds=search
Re: Cheap 433MHz door sensor (with open and close)
Posted: Saturday 28 October 2017 19:36
by miremi
Re: Cheap 433MHz door sensor (with open and close)
Posted: Wednesday 01 November 2017 21:34
by Jordy
These sensor are giving my quite a headache. Trying to figure them out via lua scripts. But as said, the status of the sensor stays ON. I'm not quite sure why it's like this.
I've followed the video linked above and once added, the dashboard shows the status correctly (Open or Closed, configured as Door Contact). But if you check the logs, it's always ON. I guess internally it's keeping the correct value. I just wonder why I can't get that internal value. It seems a bit vague to use a virtual sensor just to track the open & close status of the sensor.
The ones I ordered are:
https://aliexpress.com/item/5pcs-lot-43 ... 22065.html
I guess I'll also implement a virtual sensor just to track the state.
Re: Cheap 433MHz door sensor (with open and close)
Posted: Wednesday 15 November 2017 22:24
by JelteV
You have to create a virtual doorsensor. For some reason they are always on..
Just follow the steps in the fp.
Re: Cheap 433MHz door sensor (with open and close)
Posted: Saturday 25 November 2017 20:56
by bassie127
JelteV wrote: ↑Sunday 03 September 2017 20:12
Hi,
...
To know the state of the door we need to add 2 small scripts.
One when the door is opened and one when closed.
Here they are:
- Spoiler: show
-
Door open :
Code: Select all
return {
active = true, -- set to false to disable this script
on = {
devices = {
'Front door open (event)',
},
},
-- in case of a timer event or security event, device == nil
execute = function(domoticz, device)
if (device.changed) then
domoticz.devices('Front door (Virtual)').open()
end
end
}
Door close :
Code: Select all
return {
active = true, -- set to false to disable this script
on = {
devices = {
'Front door close (event)'
},
},
-- in case of a timer event or security event, device == nil
execute = function(domoticz, device)
if (device.changed) then
domoticz.devices('Front door (Virtual)').close()
end
end
}
There you have it.
A working 433MHz door contact in Domoticz with an open and close for less then € 5,-!
Now you always know the state of your door or window.
Sorry, but can you tell me where and how to add these scripts?
I tried to place them in the /opt/domoticz/script/lua directory, but then I got the error 'No commandArray returned'.