OH3 Single Code Door Sensor

  • Platform information:
    • Hardware: Windows 10
    • OS: OH3
    • Java Runtime Environment: zulu11.45.27-ca-jdk11.0.10-win_x64
    • openHAB version:3.1.0

Hi, I am new to OH3 and would like some help.

I have a single code door sensor which when triggered stays on “Open”. I need to setup a timer for 5 seconds to turn the state back to Closed.
Any help would be appreciated.

UID: mqtt:topic:cd8e7d9541:6037c1e955
label: RF Bridge
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:cd8e7d9541
  - id: doorsensor1
    channelTypeUID: mqtt:contact
    label: D/W rf Sensor 1
    description: ""
      stateTopic: RFBridge/DoorSensor1
  - id: dwrfsensor2
    channelTypeUID: mqtt:contact
    label: D/W rf Sensor 2
    description: ""
      formatBeforePublish: "%s"
      stateTopic: tele/rfbridge/RESULT
      transformationPattern: JSONPATH:$.RfReceived.Data
      on: 89A229

You’d normally do that by applying an expire to your Item, setting state to CLOSED

It’s in the docs -

How to do in MainUI -

Thanks for your reply. It works but only if i do the following. Under DO i use update state, State UNDEF. Does not work if i use the following. DO send command, State Off of Closed.

What type of Item is involved here?
Let’s guess it is a Contact type?

Commands and states are two different things in openHAB.
You can’t send any commands to a Contact type, it’s not allowed.

So that leaves ypu able to send state updates.
But like other openHAB Item types, you cannot send just anything you like.
For a Contact type, usual states are OPEN and CLOSED.
OFF, off, Closed, bananas etc. are not allowed and will not work.