Openhab 2.5 things file

Hi all

I’m very new to openhab but got my head around paper UI, but have decided to start a fresh.

I have binding-mqtt - 2.5.0 installed and working with mqtt fx

Rather than use the paper UI I would like to edit the home.thing file
I wondered if someone could post an example of the code for a sonoff mini running Tasmota v7.1.2 Betty. then I can reverse engineer the code and get a better understanding.

below is the switch details

Hostname lts_garage_lights
IP Address 192.168.0.203
Gateway 192.168.0.1
Subnet Mask 255.255.255.0
DNS Server 192.168.0.1
MAC Address 84:0D:8E:75:C8:7D

MQTT Host 192.168.0.4
MQTT Port 1883
MQTT User mqtt
MQTT Client DVES_75C87D
MQTT Topic lts_garage_lights
MQTT Group Topic tasmotas/cmnd/
MQTT Full Topic lts_garage_lights/cmnd/
MQTT Fallback Topic cmnd/DVES_75C87D_fb/

Thanks in advance

S

Here’s an example of my Things file but most will recommend to set up your Thing via PaperUI and use files for items.

Thing:

Bridge mqtt:broker:pibroker "pibroker" [ host="10.0.1.34", port=1883, secure=false, username="openhab", password="xxxxxxx" ]
{
    // Sonoffs
    Thing topic sonoff11 "Living Room Light" @ "Living Room" {
    Channels:
        Type switch : power       "Power"         [ stateTopic="stat/sonoff11/POWER", commandTopic="cmnd/sonoff11/POWER" ]
        Type number : temperature "Temperature"   [ stateTopic="tele/sonoff11/SENSOR", transformationPattern="JSONPATH:$.SI7021.Temperature" ]
        Type number : humidity    "Humidity"      [ stateTopic="tele/sonoff11/SENSOR", transformationPattern="JSONPATH:$.SI7021.Humidity" ]
    }

    Thing topic sonoff2 "Couch Light" @ "Couch Light" {
    Channels:
        Type switch : power        "Power"         [ stateTopic="stat/sonoff2/POWER", commandTopic="cmnd/sonoff2/POWER" ]
    }
}

Items:

Switch LivingRoom_Light "Living Room Light" <light>  ["Lighting"] { channel="mqtt:topic:pibroker:sonoff11:power" }
Number LivingRoom_Light_Temp "Temperature [%.1f °F]"      <temp>             { channel="mqtt:topic:pibroker:sonoff11:temperature" }
Number LivingRoom_Light_Humidity    "Humidity [%.1f %%]"    <humidity>       { channel="mqtt:topic:pibroker:sonoff11:humidity" }

Switch CouchLight "Couch Light" <light>  ["Lighting"]  { channel="mqtt:topic:pibroker:sonoff2:power" }

Hope this helps.

I advise against that
Things file are delicate things and mistakes are easy
Creating things with the paperUI is easy, self explanatory, help for values is provided and the syntax will ALWAYS be correct

Thanks was exactly what I was looking for

I understand what your advising however I’m very used to Visual Studio Code
and is my preferred method of working