Serial buttons

Hello everyone, after an excursus on the possibility of adopting wifi systems and broker mqtt, which I do not exclude a priori, I’m back on my feet, that is, integrate radiofrequency sensors with openhab on raspberry. I already have an arduino nano that through the usb port and an RF receiver can read the sensors by writing on serial monitors signals like these:

13: 47: 01.376 -> Code: 310986, period duration: 463us.
13: 47: 02.801 -> Code: 310968, period duration: 561us.
13: 47: 03.034 -> Code: 310968, period duration: 462us.
13: 47: 03.266 -> Code: 310968, period duration: 463us.

How do I make them into items within openhab?

How do I say that when the serial port reads a value in the string 310968, it is a sesnore and its status is active?

How do I bring this information into the system bus?

I tried to take a look at MySensor, but it does not solve the problem, that is, it formats the data, but in the end that the string is
13: 47: 03.266 -> Code: 310968, period duration: 463us.
rather than
Sensor: 310968 Status: active
or else we say that nothing changes.

What I did not understand is how to create an object that can then be used in a trigger.

Could you help me please?

Thanks bye!

Read the docs for the Serial Binding. This is low level stuff and therefore it can be pretty challenging to get working.

But once you do get it working, you can follow the docs and examples in the docs to create Items and filter on the incoming data to set them as you desire.

Hello and thanks for the reply.
I had read the document, but frankly I can not understand how to put into practice quaanto learned.
Let’s say that I modify the sketch arduino to let me communicate only the code of the active device, be it the button of a remote control or a PIR or a door opening sensor, so they all work the same way, if there is a contact send me a code .
I present this code to the serial.

I create only one ITEM that reads the codes from the usb port?
String RFGateway “RF Sensor” (Bell) {serial = “/ dev / ttyUSBo @ 115200”}

That’s one way to do it. Or you can create one Item for each and use the REGEX to filter for just those messages that the Item represents.

I don’t use this binding but I do know it can be a challenge to get it to work. Most everyone uses either MySensors or MQTT to communicate between Arduino/ESPs and OH.

I tried with mqtt but my nodemcu does not work with the rcswitch library, I have to do some other test to understand if I can start it, for the moment I’m organizing with the “plan b”.
I have to study a bit of regex.

For the moment I thank you, I’ll be sure to bother you soon!
Thanks bye!