RFLink binding

Tags: #<Tag:0x00007f2fae3306f0> #<Tag:0x00007f2fae330510> #<Tag:0x00007f2fae3303d0>

@pauli_anttila @Speeder A few weeks ago I stumbled over the RFLink project at:


http://www.nemcon.nl/blog2/

Technically, it’s quite similar to RFXCom. There are differences in the supported devices though. The list of supported brands/devices is yet very very long. And: The dev team is absolutely willing to support new/unsupported devices which RFXCom was not (at least in my case) :frowning:
The dev team is also willing to support other home automation projects (OpenHAB?) than it supports already.

Like RFXCom, RFLink writes received decoded 433MHz packets to usb-serial or sends serial writes to 433MHz. Probably RFXCom binding can be made compatible/aware of the strings RFLink is sending/receiving via serial?

Hi @curlyel, thanks for the link the RFLink project is very interesting !
The USB protocol is totally different from the RFXcom. Thus supporting the RFLink means to develop a new binding. But as it is a standard ASCII serial link, it should be handled with the Openhab serial binding and a transformation (REGEX or with a rule).

Anybody working on a binding for this very nice product (RFLink) ?
Nice (cheaper) alternative for RFXcom.

-ben

yes, I am also interested in a RFLink binding…
(supported Devices: http://www.nemcon.nl/blog2/2015/07/devlist)

Is there any progress?

Hello,

I started a RFLink binding here : Github repo
At the moment, I only tested with an energy device.
As I’m very new to OpenHAB development, feel free to give advices or to contribute :wink:

Great. It is possible to load the binding with Openhab 1.8?

Hopefully it will !

Very nice!
How can we help with getting the binding fully functional?
Anything you need?

Stuntteam (RFLink developers)

1 Like

@Stuntteam: Excellent! I’m very happy that you became aware of this thread.
I just considered to give you a notice about it. But I just wanted to try out the new RFLink binding myself before asking you for the right help you can provide. Unfortunately, I didn’t had the time to do it yet…

Although, I had a quick look at @cyrilcc’s repo. I guess, some help of implementing the other protocols/devices which are not yet covered could help much.

I’m looking forward to see the RFLink binding becoming another awesome extension of openHAB!

Thank you for your interest :slight_smile:
My implementation is used in a PoC/Demo which doesn’t need more development at the moment, so I’m not sure to get more time to work on it anymore.
Anyway, you can fork the repo or contribute. :wink:
I think that it needs first a code review from openHAB experts, and the development of discovery service.
Adding devices is quite easy, but I think that it requires to have real devices to perform some tests in real conditions.

I’m quite surprised not to see a more complete binding for this project. The number of supported items is huge to say the least and the overall cost of the controller hardware is low, especially if home made. And when looking at other Smarthome open source projects, let’s mention Jeedom for instance from where I’m coming, the support is pretty good yet.

Is there an official will to support it later or is an effort as a side project is welcome?

Hi,

I decided not to wait for the binding and coded everything in python and openhab (RPI3 and OH2 as platform):

  • Made a python script that reads/writes data from RFLINK (USB) to/from MQTT (also on RPI3) ;
    This merely a s/w gateway that reads data from rflink and sends it (unmodified) to MQTT and vice versa ;
  • In openhab2 I defined two items : rflinkTX and rflinkRX
String rfLinkRx "rfRx: [%s]" {mqtt="<[mybroker:rflink/rx:state:default]"}
String rfLinkTx "[%s]" {mqtt=">[mybroker:rflink/tx:command:*:default]"}
  • In a rule I parse the incoming string and take action :
rule "rfLinkRX"
    when
        Item rfLinkRx received update
    then
        //parse data here...
        //pushover("rfLink: " + rfLink.state) //test 
    end
  • For sending commands also a rule is created (per item):
rule "Lamp1Button"     // lamp on/off button
    when
        Item lamp1Button changed
    then
        rfLinkTx.sendCommand("10;Kaku;00004b;2;" + lamp1Button.state)
    end 

I know this is not as convienent as having a binding but it is a ‘good’ workaround to get the gateway going.

-ben

Made a python script that reads/writes data from RFLINK (USB) to/from MQTT (also on RPI3) ;
This merely a s/w gateway that reads data from rflink and sends it (unmodified) to MQTT and vice versa ;

Could you post this script?

Sure:

#!/usr/bin/env python

import serial
import paho.mqtt.client as mqtt

serialdev = '/dev/ttyUSB0'
broker = 'localhost'

ser = serial.Serial(
        port=serialdev,
        baudrate = 57600,
        parity=serial.PARITY_NONE,
        stopbits=serial.STOPBITS_ONE,
        bytesize=serial.EIGHTBITS,
        timeout=None
)

ser.flushInput()
ser.flushOutput()

def on_connect(client, userdata, flags, rc):
        client.subscribe("rflink/tx",0)

def on_message(client, userdata, message):
        ser.write( str(message.payload.decode("utf-8"))+"\r\n")

client = mqtt.Client()
client.connect(broker, 1883)
client.on_connect = on_connect
client.on_message = on_message
client.loop_start()

while True:
        x=ser.readline()
        x = x.strip("\r\n")
        client.publish("rflink/rx", x, 0)

Probably there is room for improvement but for me it does the job!
To load this at boot time, I used the script as shown at http://tinyurl.com/j482qn9

Cu, Ben

Here is my Homie based rflink to mqtt bridge: https://github.com/enc-X/mqtt-rflink-bridge
It is one day old, I’ve just starded testing. Communication works well - I can recevie in OH messages and send to RF. Only some advanced features (like debug, device creation) have problem because of MQTT message size limit.

Hello,

Is it possible to use an nanoCUL with the CC1101 for RFLink?

I don’t think so, CC1101 have SPI interface, RFLink use simple data in / out line.

Hello,

Is it possible te receive the raw data fron an rflink device in Openhab?
I tried to receive the data from an rflink-arduiono on USB0 with the follow item:

String MySerialDevice “MySerialDevice [%s]” { serial="/dev/ttyUSB0@57600" }

In this rule i put it in the logging:

rule rflinktest

when
    Item CurrTime changed
then
     var rflinktest = MySerialDevice.state// as StringListType	
	logInfo("rflinkcom0","MySerialDevice " + rflinktest)

end

I get data, but not the same like in the “minicom”.

Data in openhab-logging:

2016-12-23 10:36:56.075 [DEBUG] [binding.serial.internal.SerialDevice] - Received message ‘��h`�’ on serial port /dev/ttyUSB0

data in minicom:
20;03;Baldr;ID=6a03;TEMP=00a6;HUM=39;BAT=OK;

I have a problem with the RFLink-Binding in Exclypse IDE in creating the binding-jar-file.
I do it like in the description(In Eclipse IDE, right click on the pom.xml file, then “Run As”, and “Maven Install”) and egt the follow error:

[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: org.openhab.binding.rflink 2.0.0.qualifier
[ERROR] Missing requirement: org.openhab.binding.rflink 2.0.0.qualifier requires ‘package gnu.io 0.0.0’ but it could not be found
[ERROR]
[ERROR] See http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[ERROR] Cannot resolve dependencies of MavenProject: org.openhab.binding:org.openhab.binding.rflink:2.0.0-SNAPSHOT @ C:\Users\vogel.C05500NBVOGEL2\git\org.openhab.binding.rflink\pom.xml: See log for details -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException

How can i solve this error? I tried this with the binding i downloaded form github without any changes.

BR Rene