Serial binding sending 'OFF' when it shouldn't

After migrating from serial v1 binding to OH3 I have problems that my switches that are controlled from RFLink over the serial binding only works occationally. I have noticed in the log file that whenever my pir sensors (also RFLink) turn off, the serial binding sends ‘OFF’ over the serial port. When this is sent, my theory is that since it is missing the newline argument, the next command sent over serial port to RFLink is not going to work. Anyone have a solution to this?

Things file:

Bridge serial:serialBridge:sensors [ serialPort="/dev/ttyACM0", baudRate=57600] {
Thing serialDevice nexaprotocol [patternMatch=".*"] {
Channels:

                    Type switch : RFLb_1_1        [onValue="10;NewKaku;1;1;ON;\n",offValue="10;NewKaku;1;1;OFF;\n" ]
                    Type switch : RFLb_1_2        [onValue="10;NewKaku;1;2;ON;\n",offValue="10;NewKaku;1;2;OFF;\n" ]
                    Type switch : RFLb_1_3        [onValue="10;NewKaku;1;3;ON;\n",offValue="10;NewKaku;1;3;OFF;\n" ]
                    Type switch : RFLb_2_1        [onValue="10;NewKaku;2;1;ON;\n",offValue="10;NewKaku;2;1;OFF;\n" ]
                    Type switch : RFLb_2_2        [onValue="10;NewKaku;2;2;ON;\n",offValue="10;NewKaku;2;2;OFF;\n" ]

    //20;04;EV1527;ID=00a451;SWITCH=0b;CMD=ON;
    Thing serialDevice pir1 [patternMatch=".*ID=00a451;.*"] {
            Channels:
                    Type switch : pir [stateTransformation="REGEX:.*?CMD=(.*?);.*"]
    }

items file:
//RFLink
Switch NEXA_1_1_RFL “Master Switch Nexa spoter” {channel=“serial:serialDevice:sensors:nexaprotocol:RFLb_1_1”}
Switch NEXA_1_2_RFL “Miriam Varmeovn” (gOppe, gVarme) {channel=“serial:serialDevice:sensors:nexaprotocol:RFLb_1_2”}
Switch NEXA_1_3_RFL “NEXA_1_3_RFL” {channel=“serial:serialDevice:sensors:nexaprotocol:RFLb_1_3”}
Switch NEXA_2_1_RFL “Forsterker Kjøkken” (gKjokken) {channel=“serial:serialDevice:sensors:nexaprotocol:RFLb_2_1”}
Switch NEXA_2_2_RFL “Skoskap Gang” (gGang) {channel=“serial:serialDevice:sensors:nexaprotocol:RFLb_2_2”}

//RFLink Alarm
Switch PIR_01_RFL_433 “433PIR_01_Stue” (gAlarm, gNede, gPIRSensors) {channel=“serial:serialDevice:sensors:pir1:pir”, expire=“45m,command=OFF”}

Have you tried using state for the expire rather than command:

{channel=“serial:serialDevice:sensors:pir1:pir”, expire=“45m,state=OFF”}
1 Like

That seems to solve the issue, thanks a lot!