Controlling RF from OpenHab

Hello everyone!
I’m new to smart home and OpenHab.
I have raspberry with OpenHab installed.

I’m planning to buy some cheap chinese RF 433/315MHz sensors, switches and other devices. Some examples:
http://www.aliexpress.com/item/Original-Broadlink-1-Gang-TC2-UK-Standard-Smart-Home-Remote-Control-Wifi-wireless-Wall-light-switch/32522116842.html?ws_ab_test=searchweb201556_1%2Csearchweb201644_1_10001_10002_10005_301_10006_10003_10004_62_61%2Csearchweb201560_6%2Csearchweb1451318400_6149&spm=2114.031010208.3.54.RTi4hv
http://www.aliexpress.com/item/1-Pcs-KERUI-High-Quality-433-MHZ-Wireless-Home-Security-Door-Window-Sensor-Detector-with-Battery/32477080744.html?spm=2114.13010208.99999999.279.Lgvsf5

As I understand for that setup I need to buy some RF receiver/tranceiver and connect it to raspberry.
I also see that exists Raspberry Pi RC Switch Binding which could control RF switches with transmitter connected to Raspberry.
This could help me with switches, but what can I do with sensors and other RF devices?

Could you help me to find good solution for my setup?
Which devices (transmitter/receiver) could I by for managing RF devices from OpenHab? And which bindings to use?
Or maybe I’m worng about RF and exists another way for cheap wireless smart home… pls help

I can’t answer the wireless part of the question but I can say the following. Cheap means lots of work. Expensive means less work.

So if you want to use a bunch of RF433 devices the work you need to do is to research each device, figure out what messages it sends and receives (for each device) and, assuming the OH binding you are referring to can talk to the RF433 transceiver you wire up to the Pi’s GPIO pins can talk configure OH to talk to each device. The problem is that RF433 tells you how to send a message between devices but it doesn’t tell you what those messages look like. Though the messages might be in the manual or something.

It can be done but you will have to put in a lot of work to figure out a lot of these details on your own. If you are unable or unwilling to do that, I’m afraid you will need to look to more expensive offerings like zwave.

Agree with above. The tricky thing with 433mhz units is that while they are on the same frequency, there can be very different protocols ( they use, which means you need to get the transceiver to decode and encode accordingly. (have a look at http://tinkerman.eldiariblau.net/decoding-433mhz-rf-data-from-wireless-switches/ )

For just receiving the signal, it can even be done by using RTL-SDR that utilizes a DVB-T stick and some programming, but it is indeed lots of work. I use this method to get power usage reading from a Efergy sensor.

Another way to do it is to build your own sensors and controllers using ESP8266 Wifi Modules, and communicate to Openhab via MQTT protocol. This still requires some programming but you dont need to deal with many protocols.

James,

As Rick noted working directly with the RF stuff seems quite challenging. I think a reasonable way to do it might be with some of the suggestions from http://www.mysensors.org & a MQTT gateway. In that method the sensor & relay nodes would communicate to the MQTT gateway which then can be integrated into openhab.
I have ordered a few bits with the links on mysensors.org and will see how they go. The MQTT process looks really powerful. I am keen to learn more about it. For switching mains power I think I will stick with the zwave gear that is certified accordingly.

Regards,
George

Hi all, hi Jokerit.

I’m working on a solution similar to what you described.
In particular, I’m implementing the following solution, based on OpenHAB 2:

  • I developed a new Binding, able to read events from the serial port and to send commands too.
  • The binding module acts as a bridge towards real sensors/actuators
  • sensors/actuators, via RF 433mhz, interacts with a cheap arduino nano, connected via serial port (USB) to the raspberry OpenHAB server.

In general, a cheap RF sensor sends data via 433mhz with a pack of data; for example, I bought a magnetic door sensor sending a 4 bytes data pack, where the first part of the pack is an ID (customizable acting on internal switches) and the second part of the pack is a static xFF value.
The pack is sent multiple times over the air for a single event.

You may say: “You could avoid to use Arduino to connect the RF circuit to Raspberry!”.
True, but I preferred this solution for 2 reasons:

  1. Separation of responsabilities
  2. By connecting Arduino to my development station, I can debug the TXRX circuit in a more efficient way.

In the developed binding, adding a new sensor consists of registering a new Item in OpenHAB, with its ID as attribute. Depending on the sensor type, I provided other attributes: temperature, door status, humidity, and so on…

Actually, I’m waiting to receive the RF modules from China, so I tested the whole architecture by wiring sensors on the Arduino side and sending ID+data to OpenHAB via USB. At the moment, this mock is working.

I see a lot of post readers discouraging the interaction with this type of sensors… I’ll appreciate all contribution and suggestions to that solution.
Of course, Z-wave and ZigBee sensors are more stable and secure in trasmissions, but they costs 10 times more than RF sensors… I’m playing, so I can’t pay 50 euros for each sensor…

Regards,
Alexxn

I want to be clear that my cautioning people away from using random rf devices has more to go with the poster that the devices. For the most part one can usually tell whether the poster has the skills necessary to do the work required to build a device, inspect and analyze the message traffic, and configure OH appropriately. I will caution those who do not demonstrate those skills away from tgese devices.

Hi!

Did you continue working on this? Did you make a more detailed description somewhere?

I’m wondering the same!

RFLink might also be an option with 433Mhz devices.
See at: http://www.nemcon.nl/blog2/
They have a long list of devices supposed to work.
I’m using this as a gateway for a weather sensor to openhab2.
The gateway is connected via USB serial, read by a python script and propagating the measurements via MQTT to openhab2.
A supplier for the components for the gateway is here: https://www.nodo-shop.nl/en/
I’m not affiliated in any way to above, just a customer.

This is what I did…

1 Like