RFXCOM Cheap PIR Sensor Binding in Openhab2

@all I have a new version because of some code review comments and I noted that if you changed the configuration ie reversed on/off for example that was overwritten if a new message came in.

If someone has time to test that would be great!

Can anyone recommend me cheap sensors from Aliexpress that work with RFXCOM?
It’s difficult to find the different models (jumpers, etc).

I have some of these: Free Shipping! External antenna Wireless PIR Sensor 315MHZ or 433MHz PIR Motion Sensor Detector For gsm pstn Home Security Alarm
http://s.aliexpress.com/nAVnqAbm?fromSns=Copy to Clipboard
(from AliExpress Android)

They have the PT2262 chip with jumpers or DIP switches.

Basically all the PT2262 will work. Those are the cheapest.

Don’t use those sensors for detecting permanent presence (for example pointing into your living room) because they will transmit on every detected move and will drain battery fast.

They usually only send ON commands and never OFF. Hence most are only called “alarm sensor”. Leaving the room or closing a door will not be transmitted to openhab. You would have to use the expire binding.

Good search terms for Ali: 433 MHz sensor

Thanks for the suggestion!
The battery point is interesting - are there any cheap sensors that solve this? I’m unsure what’s best - I assume if not on every move, there needs to be a particular time interval. Ideally a specific datetime - but this is not possible with cheap sensors (or even expensive sensors) anyway…

I moved to Z-Wave sensors, because they implement this. They will
still notice there is someone around and only send an OFF, when there
is no one anymore for a time you can set. It costs 10 times as much,
but is so worth it. I use a sensor for PIR, constant light updates and
temperature for over a year and still have 90% battery left. It’s
insane. I considered it worth the additional money.

Those 2 PIRs I showed you collect dust in the drawer. You can pick
them up if you live in Hamburg, Germany ;D

I’m in Austria, but thanks :slight_smile:

Which Z-Wave sensors are you talking about?
I assume it makes sense to have these features in rooms like living rooms, etc.
For a garage, shed, and similar - I assume the cheap ones are alright.
I’m not sure if there are cheap ones that let you set a timeout interval.

I absolutely agree. I’ve never seen one but I would advise you to stay away from this model and any model that looks similar as they almost all got the same electronics inside.
Also, I would not bother to try the one that are advertised as “Alarm” system, because an alarm system does not need motion cancel timeouts, only the ones for presence detection do. But yeah, I have no idea how to identify them either :smiley: Please tell me if you found some. I will tell you if I stumble over some as well.

I made photos for you if you are interested in what those look like on the inside:

You are referring to presence detection now, right?

I might use the ones that you linked above for garage, shed, basement, garden I think - as there is not too much constant motion.
Which sensors are you using for presence detection?

Yes I am. I use some of the Fibaro “Eyes” FGMS-001 (Fibar Group Motion Sensor 1) [Link to Manual] in all rooms where I need presence detection.

The amount of settings and battery lifetime (if you reduce the wake-up-to-download-settings interval) are awesome.

Ah right, I’m looking at them for a long time already :slight_smile:
What are you using them for? I.e. why do you need presence detection?

One is hanging outside for temperature and ambient light sensing, the other two are in the living and work room for temperature and presence sensing.

Both in the work and living room I collect (add) multiple indicators for presence to a presence-score for the room. For example in the work room I add the PIR and activity (mouse & keyboard movement) of both Windows PCs to a group in openHAB. All of these sensors cancel their ON state back to OFF after 10 minutes. This way I know if there is anyone in the room and control the lights there and it is totally fine if someone enters the room, sits on the PC and never moves anymore, because the PC shows clear activity and the lights will stay on.

The same happens in the living room with other indicators: PIR + SteamLink on + Kodi or Chromecast playing. Also in the living room the main media rack power outlet is turned off until someone enters the room after being not at home.

Both lights are controlled by the presence and the outside ambient light readings and have a linear dimming between two points, so the lights will gradually turn on if it gradually gets darker outside and vice versa. This way there is always a consistent lighting inside the room and the lights only support the natural light if it is needed.

As you can already see: Most of the sensing is done by those Fibaro motion sensors and I’m still not using the movement/vibration sensor that could react to taps, slamming doors or door sensor. Even the temperature sensing is a great bonus that I did not really need but happily use.

That’s a very advanced usecase, pretty cool! And some nice ideas. I like the light control based on ambient light.

Are there btw any 433mhz door/window sensors as well that can be used?

I am not using any door/window sensors, but they send signals the same way as the PIR sensors.

1 Like

I ordered the PIR sensors - however, mine look different - any idea how to get them working?
They don’t show up in Openhab

By the looks of it with missing code switch and the text “providing up to 1 million codes” (which is not possible with the PT2262 chipsets, this could be an EV1527 learning code chip.

You usually pair those by pressing pairing buttons on the receiver and the sender. As far as I know, there is no way to send these learning codes from openHAB or the RFXCOM itself (but please, have a google yourself). You might have luck with using a real remote to learn a code and then try to send something on the Thing that was created from your remote.

Learning code always have been harder (and way more secure) to use. I hope someone has got this figured out, because I haven’t and just returned the learning code devices I ordered 3 years ago. But times have changed and maybe the community already knows more than 3 years ago.

Does anyone know how to use rfxmngr to debug the messages?
I’m not sure but the above post sounds like I somehow need to pair the devices?

If I put the binding in debug mode I don’t see any messages if the PIR is triggered.

@pauli_anttila maybe a hint?

That PIR sensor is a sender, so it shouldn’t need any pairing/learning. I don’t know which protocol that PIR use, so you probably should enable “all” protocols from rfxcom controller and see if you see any new messages (change also rfxcom binding logging level to trace to see more information). Beware that rfxcom controller sensitivity might drop, when more protocols are enabled, so keep PIR pretty close to controller.

Pairing can be done from openHAB as well. When you put receiver on paring/learning mode, it just wait new id to pair/learn. So you can define random device id for your thing and when receiver in on learning mode, just send commands (ON or/and OFF) and receiver will pair to that random device id.

You are absolutely right and these are amazing news! :slight_smile: Thanks for the correction.

@pauli_anttila I got it working - somehow it seems that with the first try the enabled protocols did not get saved on my RFXTRX. I checked again and saw the mistake.

The sensors are recognized as:
2018-01-22 22:23:21.705 [DEBUG] [g.rfxcom.handler.RFXComBridgeHandler] - Message received: Raw data = 091300040729A901A170, Packet type = LIGHTING4, Seq number = 4, Sub type = PT2262, Device Id = 29338, Command = ON_9(9), Pulse = 417

What I don’t like with those sensors is that the protocol is pretty much open :confused: