Using serial input as a channel in rules

Hello dear community!

I use the Serial Binding in openhab 4. I get a value “OFF” or “ON” from an arduino. I output this value in the arduino as a serial print. The value arrives correctly and I can create a channel. Now I want to create a rule that reacts to this input signal but it does not. Which function do I have to use? If I set state from off to on, nothing is triggered.

I hope someone can give me a hint. Could it be that “OFF” is not equal to Off as a status?


Please post your rule

1 Like


UID: serial:serialBridge:acab564ab5
label: Serial Bridge
thingTypeUID: serial:serialBridge
baudRate: 9600
charset: UTF-8
dataBits: 8
serialPort: /dev/serial/by-id/usb-Arduino__www.arduino.cc__0042_950383030313512001A0-if00
stopBits: “1”
parity: N

configuration: {}

  • id: “1”
    itemName: Laser
    state: ON
    previousState: OFF
    type: core.ItemStateChangeTrigger
    conditions: []
  • inputs: {}
    id: “2”
    command: ON
    itemName: PigpioGerat_Motor2
    type: core.ItemCommandAction

Did you assign an item of type „switch“ to your channel?
If your device expects a string which has to be equal to “Off” then this would not work. Use a string item instead.
Could you please use code fences for any kind of code?