can ESPEasy be used as MQTT Gateway for RFLink ?
Moderators: grovkillen, Stuntteam, TD-er
can ESPEasy be used as MQTT Gateway for RFLink ?
Hi,
I have a working ser2net interface on NodeMCU with ESP easy 2.0.0.dev12 to RFlink.
Now I would like to use it with MQTT, with every line coming from the serial interface published to a specific topic, (or with a topic per devices), and a topic subscribed by the ESP where every message will be sent to the serial line.
Is it possible? What would be needed ? rules ?
Thanks.
I have a working ser2net interface on NodeMCU with ESP easy 2.0.0.dev12 to RFlink.
Now I would like to use it with MQTT, with every line coming from the serial interface published to a specific topic, (or with a topic per devices), and a topic subscribed by the ESP where every message will be sent to the serial line.
Is it possible? What would be needed ? rules ?
Thanks.
Re: can ESPEasy be used as MQTT Gateway for RFLink ?
I fail to see an important point here: Why?
Why choose a very limited platform like the ESP8266 for a very complex task like this when there are others who are only slightly more expensive but much more equipped for a task like this...
Why choose a very limited platform like the ESP8266 for a very complex task like this when there are others who are only slightly more expensive but much more equipped for a task like this...
Re: can ESPEasy be used as MQTT Gateway for RFLink ?
Hi Lisa,
would that be such a complex task ? I guess my request is not that clear.
What I'm talking about is just a dumb Gateway, message coming from MQTT specific topic being send as is on the serial line to the RFlink and Vice-Versa. Of course the MQTT server is running somewhere else.
ESP Easy already provide both features (MQTT feeding and Serial Line gateway with ser2net), what I just miss is something to make both working together.
would that be such a complex task ? I guess my request is not that clear.
What I'm talking about is just a dumb Gateway, message coming from MQTT specific topic being send as is on the serial line to the RFlink and Vice-Versa. Of course the MQTT server is running somewhere else.
ESP Easy already provide both features (MQTT feeding and Serial Line gateway with ser2net), what I just miss is something to make both working together.
Re: can ESPEasy be used as MQTT Gateway for RFLink ?
Mmmmh, I just realized that I just decribed "how" I want to do it but did not described "what" I want to do !
So what I want to do is to connect RFLink to OpenHab2, where no specific binding exist for RFLink, but where managing messages with regexes and mqtt layer will implementation extensive, by formating messages for specific remote devices not too much complicated.
So "complex" task will remain on OpenHab2 and MQTT server side, and I'm fine with that, where the "simple" task remain on the ESP side, by just making a serial2mqtt gateway.
So what I want to do is to connect RFLink to OpenHab2, where no specific binding exist for RFLink, but where managing messages with regexes and mqtt layer will implementation extensive, by formating messages for specific remote devices not too much complicated.
So "complex" task will remain on OpenHab2 and MQTT server side, and I'm fine with that, where the "simple" task remain on the ESP side, by just making a serial2mqtt gateway.
Re: can ESPEasy be used as MQTT Gateway for RFLink ?
Hi,
I'm using this bridge https://github.com/enc-X/mqtt-rflink-bridge almost year without any problems.
I'm using this bridge https://github.com/enc-X/mqtt-rflink-bridge almost year without any problems.
Re: can ESPEasy be used as MQTT Gateway for RFLink ?
Mmmmh, thanks for the hint, I had a look and it looks very like what I wanted to do.
It even transform to json message I didn't asked for
It even transform to json message I didn't asked for

Re: can ESPEasy be used as MQTT Gateway for RFLink ?
FWIW, I have now implemented an RFLink to MQTT bridge plugin for ESPEasy. It can be found as P197 in the ESPEasyPluginPlayground on GitHub: https://github.com/letscontrolit/ESPEas ... Bridge.ino
It basically combines ESPEasy's ser2net serial bridge plugin with the mqtt-rflink-bridge (which I was using previously, too). The plugin simply listenes to the serial port (TX/RX pins) and sends all output received from RFLink to the first configured MQTT controller. Either the raw message from RFLink or the parsed contents in JSON format can be sent.
It also listens to a configurable MQTT topic for commands to be sent to the RFLink over serial.
Additionally, ESPEasy commands "rflinksend" and "rflinkreceive" are implemented to either submit something to the RFLink or process a string as if it was received by the RFLink.
Local rules processing is basically taken from the serial gateway plugin, so I suppose it should work identical for my plugin than with the serial gateway plugin. However, I have never tested this part of the bridge plugin, as I'm interested in sending the parsed JSON to my MQTT controller (to be picked up by OpenHAB).
It basically combines ESPEasy's ser2net serial bridge plugin with the mqtt-rflink-bridge (which I was using previously, too). The plugin simply listenes to the serial port (TX/RX pins) and sends all output received from RFLink to the first configured MQTT controller. Either the raw message from RFLink or the parsed contents in JSON format can be sent.
It also listens to a configurable MQTT topic for commands to be sent to the RFLink over serial.
Additionally, ESPEasy commands "rflinksend" and "rflinkreceive" are implemented to either submit something to the RFLink or process a string as if it was received by the RFLink.
Local rules processing is basically taken from the serial gateway plugin, so I suppose it should work identical for my plugin than with the serial gateway plugin. However, I have never tested this part of the bridge plugin, as I'm interested in sending the parsed JSON to my MQTT controller (to be picked up by OpenHAB).
-
- Normal user
- Posts: 13
- Joined: 10 Jan 2017, 11:07
Re: can ESPEasy be used as MQTT Gateway for RFLink ?
Yes, i use Robotdyn Mega+esp8266 on board and RFLink shield, it receives RF and post to MQTT.
Here is rules:

Here is rules:
Settings:seb82 wrote: ↑05 Sep 2018, 11:04 This is working for me with "RFLink" selected for event processing and this rule:
Or if you select "Generic" for event processing:Code: Select all
On !RFLink#* do Publish test,%eventvalue% endon
I had to put a "RX Receive Timeout" of 10 ms or it would strip off a few characters.Code: Select all
On !Serial#* do Publish test,%eventvalue% endon

- Attachments
-
- 1234F481-C45C-426F-A847-807E915C1CAE.jpeg (1.11 MiB) Viewed 12820 times
Re: can ESPEasy be used as MQTT Gateway for RFLink ?
Hi @martiniman
I'm interested in this solution using MQTT
I have the Robotdyn Mega+esp8266 on board and RFLink shield
I use it with Home Assistant and it's possible in an easy way to configure it.
Now I'm trying also OpenHab and there in no binding to use over TCP.
So on the same installation I'm using with HA, I added an OpenHab MQTT controller which has as Controller Subscibe and as Controller Publish
Controller lwl topic is set to @ and LWT Connect Message and LWT Disconnect Message are empty.
My UnitName is called Pippo.
Using now the rule
In Ser2Net I've choosen RFLink as Event processing.
I use MQTTBox to check messages, I have subscribed to Pippo/# but I don't see any message.
What's wrong in my config?
Thanks
I'm interested in this solution using MQTT
I have the Robotdyn Mega+esp8266 on board and RFLink shield
I use it with Home Assistant and it's possible in an easy way to configure it.
Now I'm trying also OpenHab and there in no binding to use over TCP.
So on the same installation I'm using with HA, I added an OpenHab MQTT controller which has
Code: Select all
/%sysname%/#
Code: Select all
/%sysname%/%tskname%/%valname%
Controller lwl topic is set to @ and LWT Connect Message and LWT Disconnect Message are empty.
My UnitName is called Pippo.
Using now the rule
Code: Select all
On !RFLink#* do
Publish test,%eventvalue%
endon
I use MQTTBox to check messages, I have subscribed to Pippo/# but I don't see any message.
What's wrong in my config?
Thanks
-
- Normal user
- Posts: 13
- Joined: 10 Jan 2017, 11:07
Re: can ESPEasy be used as MQTT Gateway for RFLink ?
Hi!
Here you post to topic "test", you need to change your rules to something like this:woody4165 wrote: ↑15 Nov 2018, 15:46 My UnitName is called Pippo.
Using now the ruleWhat's wrong in my config?Code: Select all
On !RFLink#* do Publish test,%eventvalue% endon
Thanks
Code: Select all
On !RFLink#* do
Publish Pippo,%eventvalue%
endon
or
On !RFLink#* do
Publish /%sysname%,%eventvalue%
endon
Re: can ESPEasy be used as MQTT Gateway for RFLink ?
Hi
I'm using rflink with an esp12.
I added a domoticz controller, and added the above rule. (enabled rflink event)
It works!
But: for each rflink event, I get 2 mqtt posts (one is empty):
2019-01-22 09:54:32 Topic: test Qos: 0 !RFLink#
2019-01-22 09:54:19 Topic: test Qos: 0 !RFLink#1527;ID=0a65f0;SWITCH=01;CMD=ON;
Do you know any workaround?
Also, how do you transmit something to rflink from mqtt?
Thanks
I'm using rflink with an esp12.
I added a domoticz controller, and added the above rule. (enabled rflink event)
It works!
But: for each rflink event, I get 2 mqtt posts (one is empty):
2019-01-22 09:54:32 Topic: test Qos: 0 !RFLink#
2019-01-22 09:54:19 Topic: test Qos: 0 !RFLink#1527;ID=0a65f0;SWITCH=01;CMD=ON;
Do you know any workaround?
Also, how do you transmit something to rflink from mqtt?
Thanks
Re: can ESPEasy be used as MQTT Gateway for RFLink ?
Maybe someone can help me out.
I also use RF-Link on a Robotdyn ATmega2560+ESP8266. My plan is to use ESP-Easy as the Serial to MQTT bridge for RF-Link.
I've tested all units with the code I found here ( see below (1) - it is in russian, but this is the only tutorial I found which is well structured and logical and actually works):
- esp8266 part (works)
- Arduino Mega part (works)
- Inter-Connection between both (works) - I can use the onboard led through the web-interface (esp) -> serial (arduino).
But with RF-Link and ESP-Easy I can not get it to work.
I created a device in ESP-Easy with ‘Communication - Serial Server’ and the following attributes:
When I connect to tcp/5333 I can not see any output. Further I tried to forward it to a mqtt-server with the following rule:
Result: nothing
I can not get to the point, that ESP-Easy reads the values from serial.
This is the dip-switch combinations I tried (serial3 and mode independent from each other):
USB <-> ATmega2560<-> ESP8266 ON ON ON ON OFF OFF OFF To RXD3/TXD3
USB <-> ATmega2560<-> ESP8266 ON ON ON ON OFF OFF OFF To RXD0/TXD0
With the 1st combination I can connect to Serial of the Arduino and see the output.
Maybe @martiniman , @reinhold or someone else has an idea?
Should I see something in the ESP-Easy Web-UI? In the Logs or in the device column?
Thank you very much for any help
(1): http://www.sysengineering.ru/blog/%D1%8 ... 1-esp8266/
I also use RF-Link on a Robotdyn ATmega2560+ESP8266. My plan is to use ESP-Easy as the Serial to MQTT bridge for RF-Link.
I've tested all units with the code I found here ( see below (1) - it is in russian, but this is the only tutorial I found which is well structured and logical and actually works):
- esp8266 part (works)
- Arduino Mega part (works)
- Inter-Connection between both (works) - I can use the onboard led through the web-interface (esp) -> serial (arduino).
But with RF-Link and ESP-Easy I can not get it to work.
I created a device in ESP-Easy with ‘Communication - Serial Server’ and the following attributes:
Code: Select all
a. Name: RFLINK
b. Enabled: checked
c. TCP Port: 5333
d. Baud Rate: 57600
e. Data bits: 8
f. Parity: No Parity
g. Stop bits: 1
h. Reset target after boot: - none –
i. RX receive timeout: 0
j. Event processing: RFLINK
Code: Select all
On !RFLink#* do
Publish test,%eventvalue%
endon

I can not get to the point, that ESP-Easy reads the values from serial.
This is the dip-switch combinations I tried (serial3 and mode independent from each other):
USB <-> ATmega2560<-> ESP8266 ON ON ON ON OFF OFF OFF To RXD3/TXD3
USB <-> ATmega2560<-> ESP8266 ON ON ON ON OFF OFF OFF To RXD0/TXD0
With the 1st combination I can connect to Serial of the Arduino and see the output.
Maybe @martiniman , @reinhold or someone else has an idea?
Should I see something in the ESP-Easy Web-UI? In the Logs or in the device column?
Thank you very much for any help
(1): http://www.sysengineering.ru/blog/%D1%8 ... 1-esp8266/
Who is online
Users browsing this forum: No registered users and 8 guests