RFXCOM Cheap PIR Sensor Binding in Openhab2

Did some tests to switch my devices on:

  • 50 - NO
  • 100 - NO
  • 250 - YES
  • 200 - YES
  • 250 - YES
  • 300 - YES
  • 400 - YES
  • 450 - YES
  • 500 - YES
  • 550 - YES
  • 600 - NO
  • 1000 - NO

Thanks for the tests!

With a total range of 0 - 65.535 for the pulse this is not really certain but could be ok for now, it would be great if some other people with devices could also do some tests.

The values I found via google range between 200 & 486, so most likely it will work okay if we choose 350 as default for sending.

However the next problem is that we should send the same command as the one we received, so a similar structure as I created for storing the pulse on discovery is still useful.

Although the rfxcom manual also mentions devices with a pulse timing of 188 & 1040 :frowning:

Then do
receiving < 250 = 188
250 < Receiving < 600 = 350
Receiving > 600 = 1040

My two cents in short.

When discovering an item I would try replicate that as closely as possible. So when sending an event it should fool all the listners to think that event was coming from original source.

If we have to remember and resend the pulse, then I don’t see the advantage of using ranges, it just lowers our accuracy when we can just parrot out the original. The reason for the tests is to see if we need to remember anything at all, or if we can just use one value that works with all receivers.

I also think it would be best to mimic the original pulse. Rounding is really okay, as we can see it may be way more than +/- 10 usec. But using ranges that are far off reality would only introduce problems.

I have some switchable sockets from the hardware store (typical ELRO-style sockets with red LED near corners and DIP switches) and they ignore my RFXCOM signals, if I am more than 50 usec off. Using the ranges would render them useless.

In any case, please fill the pulse length into a field so we can safely change it.

@martinvw Are you working on a test build?

I did some commits in my own branch https://github.com/martinvw/openhab2-addons/tree/feature/rfxcom-light4-ignore-pulse-on-incomming but it still requires some more work, I might be able to work on it tonight.

A new version with support for storing pulses, onCommand and offCommands. And there is a special channel for receiving and firing specific command id’s

org.openhab.binding.rfxcom-2.1.0-SNAPSHOT.jar.zip

I also created the pull-request:

2 Likes

I put the file (renamed to .jar) in “C:/openHAB2/addons” and started openhab, but the binding is nowhere to be seen.
I don’t see it when I do “bundle:list -s | grep rfxcom” or “feature:list -s | grep rfxcom” ( I don’t know which of the two I should use
). I checked the log files but no trace for rfxcom in there either.

Where can I see more about what’s going on? What am I doing wrong?

This time it is a real compressed jar, so unzip it and put the jar in the addons folder :slight_smile:

1 Like

Thanks Martin, it’s working perfectly!

Hi Martin!

Could you please direct me to some step-by-step explanation how to correctly uninstall or disable the built-in RFXCOM 2.0.0 binding and install your 2.1.0 version? After many unsuccessful attempts I finally made its working, but I’m not sure that everything was made correctly.

What I did:

  1. Deleted all things, items, bindings from config files.Now It’s only a startup stage, so God bless they doesn’t have so much definitions.
  2. Uninstalled the RFXCOM 2.0.0 binding using PaperUI
  3. Stopped OH2
  4. Copied the JAR file to /usr/share/openhab2/addons folder.
  5. Started OH2.
  6. After some dammits anf googling I finally logged in into Karaf console using: ssh openhab@localhost -p 8101 password is habopen
  7. Tried to start your 2.1.0 binding with: bundle:start org.openhab.binding.rfxcom

Here I have got an error, something like org.gnu import is missed. Found an advice to install the serial binding using Karaf console: feature:install openhab-transport-serial

Next I restarted again OH2 and RFXCOM binding (without any version number) appears in PaperUI. Unfortunately any auto or manual things discovery has no effect. I looked at openhab.log and found an exception with “Device not found(2)” text. Again after some dammits and unsuccessful attempts I found that the following line:
Bridge rfxcom:bridge:usb0 [ serialPort="/dev/ttyUSB0" ]
added manually to a .things file made my configuration alive. Huh!

At this stage my Raspberry Pi 3 configuration behaves exactly I want. So thank you so much, your RFXCOM 2.1.0 binding modification is really great. Maybe you will have a minute to answer me, are my steps to setup the custom binding was OK, or maybe something was not correct, or too tricky.

Ouch, that sounds like a painfull process. I would hope you can just remove it without removing your items first. Maybe the proper steps could be (untested):

  • remove original binding via karaf console (the benefit of doing it like this at the gnu.io is not removed)
  • put the binding in the addons folder.
  • possibly do a restart

This is most likely related to auto-discovery not working properly with the default drivers in debian based installs. Not related to the new version of binding.

Thank you for the answer! Probably you’re right, I thought it’s a new binding issue because the “out of box” OH2 installation hasn’t troubles with RFXCOM discovery. The only one issue with “original” OH2 setup is that only “generic USB RFXCOM” thing works in my configuration, not more specific “RFXCOM RFXtrx433E transmitter”. But I’m very happy that yesterday evening it finally started with your binding, because it’s CommandID modification is very-very useful for me. Thanks again for the hint of easier binding installation!

Can someone help me with my manual thing configuration for rfxcom and these lightning4 things?

If this is my thing (one of the lighting4 sockets), then what should I change in my thing configuration?

Bridge rfxcom:bridge:usb0 [ serialPort="COM3" ] {
    Thing lighting4 17733 [deviceId="17733", subType="AC"]
}

I also don’t know what to put as subType, should it be ‘lighting4’?

That should be subType = PT2262

This is what I have now:

home.things

Bridge rfxcom:bridge:238adf67 [ serialPort="COM3" ] {
    Thing lighting4 17733 [deviceId="17733", subType="PT2262"]
}

home.items

Switch Switch_Staanlamp "Staanlamp txt item" { rfxcom="<17733:Command" } 

home.sitemap

sitemap home label="Home"{
	Frame label="Lights" {
		Switch item=Switch_Staanlamp
	}
}

I can see the switch on http://openhab:8080/basicui/app?sitemap=home but nothing happens when switching it


I did only do some things with openHAB2 (my main system is (still) running OH 1.8 / 1.9)

But I know that this is a mix of old and new style, by defining a thing you should use a channel.

The items file should contain

Switch	Switch_Staanlamp	 { channel="rfxcom:lighting4:238adf67:17733:command" }

Based on [SOLVED] Need help with manual RFXCOM thing configuration and assuming it to be correct :slight_smile: