RFLink binding

Update: Finally got it to work by chaning the things file to:

Bridge rflink:bridge:usb0 [ serialPort="/dev/ttyUSB0", baudRate=57600, disableDiscovery=true ] {
    switch      AB400D-60-2   	[ deviceId="AB400D-60-2" ]
	rain 		Oregon			[ deviceId="Oregon Rain-2A5F" ]
}

**

Hi,

I have installed the RFLINK binding (and serial binding), but cannot make it work. In PAPER UI, the RFLINK USB transciever shows “UNINITIALIZED - HANDLER_CONFIGURATION_PENDING”.

Any suggestion what is wrong?

/Ole

Running openHAB 2.3.0

Things file:

Bridge rflink:bridge:usb0 [ serialPort="/dev/ttyUSB0", baudRate=57600 ] {
    switch      AB400D-60-2   	[ deviceId="AB400D-60-2" ]
	rain 		Oregon			[ deviceId="Oregon Rain-2A5F" ]
}

items file:

/* RF433mHz devices */
Switch Light_GF_Living_Table        "Lys stuebord"     		<light>		(GF_Living, Lights) 	{ channel="rflink:switch:usb0:AB400D-60-2:command"}	/* "11111","01000" */
Number rain_out        				"RainOregon [%d %%]" 	<rain>		(Weather)				{ channel="rflink:rain:usb0:Oregon:rainRate"}

Great!
What was the change?
You added “disableDiscovery=true” as well?

/Peter

Correct.

/Ole

But only the switches though…not the rain sensor which i have added also. From the log it seems the formatting is wrong, but i have tried both formats: “Oregon Rain-2A5F” & “OregonRain-2A5F”.

Any idea why?

/Ole

.thing

Bridge rflink:bridge:usb0 [ serialPort="/dev/ttyUSB0", baudRate=57600, disableDiscovery=true ] {
    switch      AB400D-60-2   	[ deviceId="AB400D-60-2" ]
	switch      AB400D-60-3   	[ deviceId="AB400D-60-3" ]
	switch      AB400D-60-4   	[ deviceId="AB400D-60-4" ]
	rain 		Oregon			[ deviceId="OregonRain-2A5F" ]
}

.item

/* RF433mHz devices */
Switch Light_GF_Corridor_L  	 	"Lille lys Akvarie" <light>		(GF_Corridor, Lights)	{ channel="rflink:switch:usb0:AB400D-60-4:command" }	/* "11111","00010" */
Switch Light_GF_Corridor_F	       	"Lys Akvarie"		<light>		(GF_Corridor, Lights)	{ channel="rflink:switch:usb0:AB400D-60-3:command" }	/* "11111","00100" */
Switch Light_GF_Living_Table        "Lys stuebord"     	<light>		(GF_Living, Lights) 	{ channel="rflink:switch:usb0:AB400D-60-2:command" }	/* "11111","01000" */
Number oregonRainRate				"Oregon Rain rate [%.2f mm]"	(Weather)				{ channel="rflink:rain:usb0:Oregon:rainRate" }
Number oregonRain				    "Oregon Rain total[%.2f mm]"	(Weather)				{ channel="rflink:rain:usb0:Oregon:rainTotal" }

log:

2018-07-27 11:06:53.932 [DEBUG] [link.connector.RfLinkSerialConnector] - <<< 20;07;Oregon Rain;ID=2A5F;RAINRATE=0000;RAIN=4f63;BAT=LOW;
2018-07-27 11:06:53.936 [DEBUG] [g.rflink.handler.RfLinkBridgeHandler] - Message received: Raw data = 20;07;Oregon Rain;ID=2A5F;RAINRATE=0000;RAIN=4f63;BAT=LOW;, Seq number = 7, Device name = OregonRain, Device ID = 2A5F, Rain Total = 2032.300048828125, Rain Rate = 0.0, running against 5 listeners
2018-07-27 11:06:53.939 [DEBUG] [scovery.RfLinkDeviceDiscoveryService] - Received: bridge: rflink:bridge:usb0 message: Raw data = 20;07;Oregon Rain;ID=2A5F;RAINRATE=0000;RAIN=4f63;BAT=LOW;, Seq number = 7, Device name = OregonRain, Device ID = 2A5F, Rain Total = 2032.300048828125, Rain Rate = 0.0
2018-07-27 11:06:53.943 [DEBUG] [binding.rflink.handler.RfLinkHandler] - Message fom bridge rflink:bridge:usb0 from device [OregonRain-2A5F], attempting to match AB400D-60-2
2018-07-27 11:06:53.946 [DEBUG] [binding.rflink.handler.RfLinkHandler] - Message fom bridge rflink:bridge:usb0 from device [OregonRain-2A5F], attempting to match AB400D-60-3
2018-07-27 11:06:53.948 [DEBUG] [binding.rflink.handler.RfLinkHandler] - Message fom bridge rflink:bridge:usb0 from device [OregonRain-2A5F], attempting to match AB400D-60-4
2018-07-27 11:06:53.951 [DEBUG] [binding.rflink.handler.RfLinkHandler] - Message fom bridge rflink:bridge:usb0 from device [OregonRain-2A5F], attempting to match OregonRain-2A5F
2018-07-27 11:07:46.878 [DEBUG] [g.rflink.handler.RfLinkBridgeHandler] - Checking RFLink transceiver connection, thing status = ONLINE

Thanks for the link.

I managed to configure my RFLink device on OpenHAB 2.3.
No need to restart OpenHAB : the RFLink plugin appeared in the Bindings a few minutes later.

I miss the “discovery service” functionnality : there is NO auto mapping for RTS virtual remote controlers configured in the RFLink device.
I will try to add this :slight_smile:

I didn’t try the new openhab binding, still using my own fork of RFLinkGateway (rflink <-> mqtt).
If some of you are also using it, I’ve modified a lot of things the last few days in order to improve what can be done: JSON formatting, multiple processing functions for each kind of value received (fine tuning on how things and handled).
Feel free to test and share your thoughts.

I am running Openhab 2.3 in Docker and it shows:

2018-10-03 19:51:52.427 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/openhab/addons/org.openhab.binding.rflink-2.2.0.jar

org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.rflink [253]

Unresolved requirement: Import-Package: gnu.io

From the documentation: GitHub - cyrilcc/org.openhab.binding.rflink: RFLink binding for OpenHAB 2.0

This binding depends on the following plugins

  • org.openhab.io.transport.serial

From the openHAB shell, just type

feature:install openhab-transport-serial

Or if you are developing your plugin with Eclipse IDE, select Run / Run Configurations… then select openHAB_Runtime click on the plug-ins tab, and check org.openhab.io.transport.serial in the target platform section.

The error message “Unresolved requirement: Import-Package: gnu.io” is a good indicator to know if you miss this dependency.

1 Like

Hi chaps, I’m a bit of a noob to all this but I have my RFLink 433 happily delivering data into my RPi2b. I have the following appearing in my logs from my WH1080 Weather Station;

2018-10-27 19:16:03.297 [DEBUG] [g.rflink.handler.RfLinkBridgeHandler] - Message received: Raw data = 20;25;DKW2012;ID=002b;TEMP=0025;HUM=99;WINSP=0062;WINGS=0087;RAIN=0000;WINDIR=0001;BAT=OK;, Seq number = 37, Device name = DKW2012, Device ID = 002b, temperature = 3.700000047683716, humidity = 99, humidity status = UNKNOWN, low battery status = OFF, running against 3 listeners

The trouble is I am now confused as to what to do next. Should I pursue the Binding route, go with MQTT or try Node-Red. I’ve had a go at all of them but each seems to require levels of knowledge that I don’t yet possess. Any advise on which is the simplest solution would be appreciated.

Cheers

Chris

Very easy,

There is an RFLink node that you can install in Node-Red that splits the values. Then you can feed them into openHAB via openHAB2 nodes or MQTT

Thanks Vincent. I am making progress now with Node-Red :slightly_smiling_face:

@Chris_Griffin
Easy isn’t it?

@Chris_Griffin @vzorglub I am also using node-red to feed values, very happy with the implementation.
(however I would still like official/native integration in open-hab, all is centralized and so on)

1 Like

@dakipro @vzorglub
I agree it would be good to have a properly integrated binding but this has at least introduced me to Node-Red which I may otherwise not have looked into. :slight_smile:
I do have a couple of issues with the RFLink Node that I find I would like to resolve.

The version 0.1.0 of “node-red-contrib-rflink” gives incorrect values for negative temperatures. It seems that this may have been resolved by a guy called Fab33 but how do I update to his version?

Also, the WINGS (wind gust) output needs to be /10 to get correct reading. I’m using a function to do this and convert to m/sec as the node output seems to be in ft/sec.

Have you guys found this?

the WINGS & WINSP seems to be buggy in the RfLink OGSi plugin : the base data is parsed as an Hexa value, but then it must be divided by 10 to get a decimal value, according to the official RfLink documentation :
http://www.rflink.nl/blog2/protref

WINSP=9999 => Wind speed in km. p/h (hexadecimal) needs division by 10

And I can confirm by looking at the Java code that this is NOT the case… these values are handled as integers…
Will try to fix that soon and create a pull request.

He fixed it: :smile:

                case "TEMP": result.temp = parseInt(value[1], 16);
                  if ((result.temp & 0x8000) > 0) {  // temperature is an signed int16
                    result.temp = result.temp - 0x10000;
                  }
                  result.temp = result.temp / 10;
                  break;

But that was not committed to the npm node :frowning_face:
So:

  1. Stop node-red
  2. Go to ~/.node-red/node-modules/node-red-contrib-rf-link
  3. then edit rflink.js (use nano or vim)
  4. replace
case "TEMP": result.temp = parseInt(value[1], 16) / 10; break;

by

case "TEMP": result.temp = parseInt(value[1], 16);
    if ((result.temp & 0x8000) > 0) {  // temperature is an signed int16
        result.temp = result.temp - 0x10000;
    }
    result.temp = result.temp / 10;
    break;
  1. And then replace:
case "WINGS": result.wings = parseInt(value[1], 16); break;

by

case "WINGS": result.wings = parseInt(value[1], 16) / 10; break;

6)Save
7) and then restart node-red

1 Like

Thanks for the advice Vincent. I’ll take a look at that tomorrow.

We should have negative temperatures this week so I’ll keep an eye on it.
I have just made the changes myself

Done. Bit of a job getting to node_red install directory on openhabian but now sorted. Thanks.

We had a couple of days below 0c last week and was reading 3200degC! Not sure when we’ll get down that low again though. Peaked at 18degC today.

Hi there,

I’ve recently built an RFLINK in order to replace an RFXCOM - as the former supports receiving of Blinds1 protocol along with others.

I’ve been using @dmartinpro’s MQTT Gateway and I think I’ve spotted a bug. I spent sometime working out why my blinds weren’t responding to the message being sent over MQTT to serial and via RFLINK.

I believe there’s a mismatch between the SWITCH_ID reported from the RFLINK and that which gets sent as the topic via MQTT, see here for the logs:

2018-11-07 08:18:55,152 - RFLinkGW.SerialProcessing - prepare_output - DEBUG - Received message:['20', '4D', 'BrelMotor', 'ID=950a7a', 'SWITCH=71', 'CMD=UP']
2018-11-07 08:18:55,153 - RFLinkGW.SerialProcessing - prepare_output - DEBUG - Switch recognized in the data, including it in CMD if present
2018-11-07 08:18:55,154 - RFLinkGW.SerialProcessing - prepare_output - DEBUG - Switch index in data : 4;SWITCH;SWITCH=71
2018-11-07 08:18:55,155 - RFLinkGW.SerialProcessing - run - DEBUG - Sending to Q:{'device_id': '950a7a', 'payload': '{"CMD": "UP"}', 'param': '113/message', 'qos': 1, 'action': 'NCC', 'family': 'BrelMotor', 'timestamp': 1541578735.1554432, 'topic': ''}
2018-11-07 08:18:55,842 - RFLinkGW.MQTTClient - publish - DEBUG - Sending:{'topic': '', 'payload': '{"CMD": "UP"}', 'param': '113/message', 'family': 'BrelMotor', 'action': 'NCC', 'qos': 1, 'timestamp': 1541578735.1554432, 'device_id': '950a7a'} to rflink/BrelMotor/950a7a/R/113/message

The SWITCH=71 becomes param 113/message .

If I send a command to rflink/BrelMotor/950a7a/W/113 noting happens.

I I send a command to rflink/BrelMotor/950a7a/W/71 then it works as expected.

[EDIT]: Issue opened on git hub - Switch ID Mismatch #8

Cheers
James