@Derekj welcome to OH!
It sounds like you’re getting tripped up on the item creation. Is that right? Here’s a simplified walkthrough to complete that phase. The instructions below avoid using PaperUI and just rely on the older text-based configuration. These instructions also assume you are using the method 5iver has created in his post here: OpenHab2 and Linear NGD00Z-4 Garage Door Controller
- In your openhab/conf/items folder, create a text file and name it whatever you like. It must have a suffix of *.items. I’ll suggest garage.items for this example.
- In your garage.items file, create the items as shown in the example from 5iver.
- Remember to change the channel of your item to match your own setup (so change the 55555 and node id)
garage.items
Group gGarageDoorOpener "Garge Door Openers" <garagedoor>
Switch GarageAttached_Door "Garage Door (Attached) [MAP(garagedoor.map):%s]" <garagedoor> (gGarageDoorOpener)
Number GarageAttached_Door_Position "Garage Door (Attached) [MAP(garagedoor.map):%s]" <garagedoor> (gGarageDoorOpener) {channel="zwave:device:55555:node5:barrier_state"}
- Next, expose these items in your UI by putting them in a sitemap, so it might look something like this. If you’re not already using sitemaps, they are saved in openhabroot/conf/sitemaps
default.sitemap
Switch item=GarageAttached_Door label="Garage Door"
Text item=GarageAttached_Door_Position
- Create the following *.map file in openhabroot/conf/transform. File name MUST be garagedoor.map (to match the mapping reference in your items file above).
garagedoor.map
0=CLOSED
ON=CLOSED
252=CLOSING
253=STOPPED
254=OPENING
255=OPEN
OFF=OPEN
-=Unknown
NULL=Unknown
- Lastly, create the rules by going to the openhabroot/conf/rules folder. Inside, create a filename ending in *.rules. Let’s use garage.rules
garage.rules
// put this import at the top of your rule file
import org.eclipse.smarthome.model.script.ScriptServiceUtil
rule "Update garage door state"
when
Member of gGarageDoorOpener received update
then
val actionItem = ScriptServiceUtil.getItemRegistry.getItem(if (triggeringItem.name.contains("_Position")) triggeringItem.name.replace("_Position","") else (triggeringItem.name + "_Position"))
logDebug("Rules", "Garage door event: [{}] was updated to {} ({}): action item [{}], current state {} ({})", triggeringItem.name, triggeringItem.state, transform("MAP", "garagedoor.map", triggeringItem.state.toString), actionItem.name, actionItem.state, transform("MAP", "garagedoor.map", actionItem.state.toString))
switch (triggeringItem.state.toString) {
case "255",//open
case "254",//opening
case "253",//stopped
case "252" : {//closing
if (actionItem.state != OFF) {
actionItem.postUpdate(OFF)
logDebug("Rules", "Garage door event: updated switch [{}] to OFF (OPEN) after barrier_state update", actionItem.name)
}
}
case "0" : {//closed
if (actionItem.state != ON) {
actionItem.postUpdate(ON)
logDebug("Rules", "Garage door event: updated switch [{}] to ON (CLOSED) after barrier_state update", actionItem.name)
}
}
case "ON" : {
if (actionItem.state != 0) {
actionItem.sendCommand(0)
logDebug("Rules", "Garage door event: updated barrier_state [{}] to 0 (CLOSED) after switch state update", actionItem.name)
}
}
case "OFF" : {
if (actionItem.state != 255) {
actionItem.sendCommand(255)
logDebug("Rules", "Garage door event: updated barrier_state [{}] to 255 (OPEN) after switch state update", actionItem.name)
}
}
}
The item names are just based on the example from 5iver. I suggest using the exact same item names to start, but once you get it going and start understanding how everything relates, you can change the item names to whatever you want.