Cheap 433MHz door sensor (with open and close)

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

JelteV
Posts: 19
Joined: Wednesday 04 January 2017 19:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Cheap 433MHz door sensor (with open and close)

Post 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
IMG_4198.JPG (32.29 KiB) Viewed 18684 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.
Last edited by JelteV on Monday 04 September 2017 9:39, edited 1 time in total.
aleph0
Posts: 85
Joined: Thursday 12 May 2016 15:47
Target OS: Linux
Domoticz version: 11838
Location: South of France
Contact:

Re: Cheap 433MHz door sensor (with open and close)

Post by aleph0 »

Thanks you very much for this info :) I've been looking for something like that for a long time :)
Rolo
Posts: 52
Joined: Sunday 27 December 2015 19:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: The Netherlands
Contact:

Re: Cheap 433MHz door sensor (with open and close)

Post by Rolo »

Can you tell wich type of battery is used in this switch?
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Cheap 433MHz door sensor (with open and close)

Post by sincze »

Nice find. Even open/close. Well design looks also okay. Next stop will be their motion sensors right??
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
SweetPants

Re: Cheap 433MHz door sensor (with open and close)

Post 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)
Jem101
Posts: 66
Joined: Saturday 02 May 2015 21:26
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Bexleyheath, SE London, UK
Contact:

Re: Cheap 433MHz door sensor (with open and close)

Post 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.
I firmly believe in having an open mind - although not so open that your brain falls out!

- sometimes attributed to Carl Sagan, but the original quote is much older than that
SweetPants

Re: Cheap 433MHz door sensor (with open and close)

Post 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
Jem101
Posts: 66
Joined: Saturday 02 May 2015 21:26
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Bexleyheath, SE London, UK
Contact:

Re: Cheap 433MHz door sensor (with open and close)

Post by Jem101 »

SweetPants wrote: Sunday 10 September 2017 13:44 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
Ah I didn't know that - I stand corrected!
I firmly believe in having an open mind - although not so open that your brain falls out!

- sometimes attributed to Carl Sagan, but the original quote is much older than that
DzJan
Posts: 4
Joined: Wednesday 04 October 2017 21:57
Target OS: NAS (Synology & others)
Domoticz version: 3.8153
Contact:

Re: Cheap 433MHz door sensor (with open and close)

Post 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.
Synology NAS DS411+
Mega 2560 PRO, Mini RFLink R47
BartSr
Posts: 347
Joined: Sunday 03 July 2016 16:16
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.3
Location: Netherlands
Contact:

Re: Cheap 433MHz door sensor (with open and close)

Post 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
Raspberry pi 3b
Arduino
KAKU
RfxCom
Zwave
OTGW
Chinese sensors temp (Dallas),movement
Tasmota
Esp8266 espeasy
MQTT
Milifax
Posts: 69
Joined: Friday 23 June 2017 9:27
Target OS: Linux
Domoticz version: 2024.4
Location: The Netherlands
Contact:

Re: Cheap 433MHz door sensor (with open and close)

Post by Milifax »

BartSr wrote: Thursday 12 October 2017 7:48 Maybe this might be helpfull.
I found this instruction which clearly explains how to.
https://www.youtube.com/watch?v=Oq-hN-RJ2sA
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
BartSr
Posts: 347
Joined: Sunday 03 July 2016 16:16
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.3
Location: Netherlands
Contact:

Re: Cheap 433MHz door sensor (with open and close)

Post 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
Raspberry pi 3b
Arduino
KAKU
RfxCom
Zwave
OTGW
Chinese sensors temp (Dallas),movement
Tasmota
Esp8266 espeasy
MQTT
BartSr
Posts: 347
Joined: Sunday 03 July 2016 16:16
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.3
Location: Netherlands
Contact:

Re: Cheap 433MHz door sensor (with open and close)

Post 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?
Raspberry pi 3b
Arduino
KAKU
RfxCom
Zwave
OTGW
Chinese sensors temp (Dallas),movement
Tasmota
Esp8266 espeasy
MQTT
MarnixO
Posts: 18
Joined: Sunday 24 September 2017 12:02
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10199
Location: Destelbergen Belgium
Contact:

Re: Cheap 433MHz door sensor (with open and close)

Post 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 ?
miremi
Posts: 26
Joined: Sunday 08 November 2015 10:08
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Cheap 433MHz door sensor (with open and close)

Post by miremi »

If i follow link from the first post item is not available anymore.
Ubuntu 16.04.3, Core i5 8GB RAM 120GB SSD, RFlink, ESPeasy, Z-Stick Gen5, 8 FIbaro, 17 Neo Coolcam
BartSr
Posts: 347
Joined: Sunday 03 July 2016 16:16
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.3
Location: Netherlands
Contact:

Re: Cheap 433MHz door sensor (with open and close)

Post 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
Raspberry pi 3b
Arduino
KAKU
RfxCom
Zwave
OTGW
Chinese sensors temp (Dallas),movement
Tasmota
Esp8266 espeasy
MQTT
miremi
Posts: 26
Joined: Sunday 08 November 2015 10:08
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Cheap 433MHz door sensor (with open and close)

Post by miremi »

BartSr wrote: Saturday 28 October 2017 12:24 Similar (or maybe slightly differrent) type are availbale on other chinese web-shops.
e.g. https://www.banggood.com/GS-WDS07-Wirel ... mds=search
Thank you
Ubuntu 16.04.3, Core i5 8GB RAM 120GB SSD, RFlink, ESPeasy, Z-Stick Gen5, 8 FIbaro, 17 Neo Coolcam
Jordy
Posts: 11
Joined: Tuesday 21 February 2017 10:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Cheap 433MHz door sensor (with open and close)

Post 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.
JelteV
Posts: 19
Joined: Wednesday 04 January 2017 19:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Cheap 433MHz door sensor (with open and close)

Post by JelteV »

You have to create a virtual doorsensor. For some reason they are always on..
Just follow the steps in the fp.
bassie127
Posts: 15
Joined: Tuesday 22 March 2016 10:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Cheap 433MHz door sensor (with open and close)

Post 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'.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests