Part 3 - Configuration - Things, Items

The article will guide you through the basic setup of OpenHAB 3 on our model example of a smart house. We will explain what Things and Items mean - basic building units in OpenHAB. We will show some tips for bulk editing in Mian UI and how to "clicking" your house or apartment in this environment. An integral part is the setup of the link with MQTT commands, which is the basic communication protocol in our Pi-Home application project.

What we'll need

Raspberry Pi 4 B with case (optional DIN holder)

SSD disk (or better quality microSD card but this is not as reliable as SSD disc in production


In the previous guide, we installed OpenHAB 3 and added some useful extensions for basic functionality. In this guide, we start with the home configuration. The basic model can be found under Settings-> Model. Use Add location to create the structure of your home. E.g. ground floor, first floor, garden. And add rooms to individual locations. Floor and rooms are Group types see example below:

PiHome - Vytvoření modelu domu

We have also created three sections for individual rooms: General, Sensors and Heating. Their Name are always GBxxx, GSxxx and GHxxx, where xxx is the label of the respective room in the house (see Pi-Home - Model house). We insert the lights, sockets, sensors, roller shutters, PIR and everything else into the rooms. Individual elements are called Items and they can be created in bulk - see next steps.

MQTT and connections with "Items" (lights, sockets, blinds, sensors etc.)

We have to decide how to connect our items with MQTT commnads to communicat with Arduino. In order to set the reaction to MQTT messages, we have to link the Items element to some Thing type of MQTT Binding. In this case, to communicate with Arduino, we use the Generic MQTT Thing type. Easier than creating lots of Thing for each light is to create one Thing for, say, all the lights and then under this Thing create as many Channels as we have lights. In Channels we set the pattern of the MQTT message (topic) to which the Channel will be respond. Items can be created in bulk from Channels . Are you already lost in this? :D Don't worry, when you click it will be clearer to you. Let's do it!

Go to the Settings->Thing tab and add a new item using the blue + icon at the bottom right. Select
and fill values based on example picture below:

OpenHAB MQTT Things

Click on the new added Lights Thing and switch to the Channels panel in the middle. Choose Add new Channel. Select On/Off Switch and set the MQTT topic to which the Channel will respond at the bottom.

OpenHAB MQTT Channel

OpenHAB Channel

You can create more Channels either by further clicking (boring), or faster, simply edit text, by copying and editing the new Channel in the Code tab which you will find on the far right. Note the coding of lights as Lxxx, where L=Light and xxx is the marking of the room in the house see. Pi-Home - Model House

OpenHAB Bulk Import

Our Code for Thing lights looks like code below. Feel free to copy and edit it

UID: mqtt:topic:pihome:lightsthing
label: Lights Thing
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:pihome
  - id: L011
    channelTypeUID: mqtt:switch
    label: Light Outside South
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L011_off
      on: L011_on
  - id: L012
    channelTypeUID: mqtt:switch
    label: Light Outside East
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L012_off
      on: L012_on
  - id: L013
    channelTypeUID: mqtt:switch
    label: Light Outside North
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L013_off
      on: L013_on
  - id: L014
    channelTypeUID: mqtt:switch
    label: Light Outside West
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L014_off
      on: L014_on
  - id: L021
    channelTypeUID: mqtt:switch
    label: Light Garage
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L021_off
      on: L021_on
  - id: L022
    channelTypeUID: mqtt:switch
    label: Light Garage Desk
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L022_off
      on: L022_on
  - id: L031
    channelTypeUID: mqtt:switch
    label: Light Pool
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L031_off
      on: L031_on
  - id: L041
    channelTypeUID: mqtt:switch
    label: Light Gate
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L041_off
      on: L041_on
  - id: L042
    channelTypeUID: mqtt:switch
    label: Light Garden
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L042_off
      on: L042_on
  - id: L043
    channelTypeUID: mqtt:switch
    label: Light Christmas
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L043_off
      on: L043_on
  - id: L111
    channelTypeUID: mqtt:switch
    label: Light Vestibule
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L111_off
      on: L111_on
  - id: L112
    channelTypeUID: mqtt:switch
    label: Light Stairs GF
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L112_off
      on: L112_on
  - id: L121
    channelTypeUID: mqtt:switch
    label: Light Toilet
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L121_off
      on: L121_on
  - id: L122
    channelTypeUID: mqtt:switch
    label: Light Toilet Mirror
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L122_off
      on: L122_on
  - id: L131
    channelTypeUID: mqtt:switch
    label: Light Office
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L131_off
      on: L131_on
  - id: L141
    channelTypeUID: mqtt:switch
    label: Light Technical
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L141_off
      on: L141_on
  - id: L151
    channelTypeUID: mqtt:switch
    label: Light Livin Room Center
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L151_off
      on: L151_on
  - id: L152
    channelTypeUID: mqtt:switch
    label: Light Living Room TV
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L152_off
      on: L152_on
  - id: L153
    channelTypeUID: mqtt:switch
    label: Light Living Room Bookcase
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L153_off
      on: L153_on
  - id: L154
    channelTypeUID: mqtt:switch
    label: Light Dining Room
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L154_off
      on: L154_on
  - id: L155
    channelTypeUID: mqtt:switch
    label: Light Kitchen
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L155_off
      on: L155_on
  - id: L156
    channelTypeUID: mqtt:switch
    label: Light Kitchen Desk
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L156_off
      on: L156_on
  - id: L161
    channelTypeUID: mqtt:switch
    label: Light Pantry
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L161_off
      on: L161_on
  - id: L201
    channelTypeUID: mqtt:switch
    label: Light Hall
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L201_off
      on: L201_on
  - id: L211
    channelTypeUID: mqtt:switch
    label: Light Bathroom Mirror
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L211_off
      on: L211_on
  - id: L212
    channelTypeUID: mqtt:switch
    label: Light Bathroom
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L212_off
      on: L212_on
  - id: L221
    channelTypeUID: mqtt:switch
    label: Light Guest room
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L221_off
      on: L221_on
  - id: L231
    channelTypeUID: mqtt:switch
    label: Light Bedroom
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L231_off
      on: L231_on
  - id: L241
    channelTypeUID: mqtt:switch
    label: Light Kids room
    description: null
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L241_off
      on: L241_on

Add all the lights and their specific MQTT. Finally, choose Add Equipment to Model, choose Expert mode below. You will see the text output to create Items. This import text can be slightly modified to tell you what icons you want to have on these elements, what groups they will be in, etc. For our model house, mass import of Items would look something like this:

Switch L111 "Light Vestibule"            <lightbulb>  (LightsThing,Lights,GB111) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L111" }
Switch L112 "Light Stairs GF"            <lightbulb>  (LightsThing,Lights,GB111) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L112" }
Switch L121 "Light Toilet"               <lightbulb>  (LightsThing,Lights,GB121) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L121" }
Switch L122 "Light Toilet Mirror"        <lightbulb>  (LightsThing,Lights,GB121) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L122" }
Switch L131 "Light Office"               <lightbulb>  (LightsThing,Lights,GB131) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L131" }
Switch L141 "Light Technical"            <lightbulb>  (LightsThing,Lights,GB141) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L141" }
Switch L151 "Light Livin Room Center"    <lightbulb>  (LightsThing,Lights,GB151) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L151" }
Switch L152 "Light Living Room TV"       <lightbulb>  (LightsThing,Lights,GB151) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L152" }
Switch L153 "Light Living Room Bookcase" <lightbulb>  (LightsThing,Lights,GB151) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L153" }
Switch L154 "Light Dining Room"          <lightbulb>  (LightsThing,Lights,GB151) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L154" }
Switch L155 "Light Kitchen"              <lightbulb>  (LightsThing,Lights,GB152) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L155" }
Switch L156 "Light Kitchen Desk"         <lightbulb>  (LightsThing,Lights,GB152) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L156" }
Switch L161 "Light Pantry"               <lightbulb>  (LightsThing,Lights,GB161) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L161" }
Switch L201 "Light Hall"                 <lightbulb>  (LightsThing,Lights,GB201) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L201" }
Switch L211 "Light Bathroom Mirror"      <lightbulb>  (LightsThing,Lights,GB211) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L211" }
Switch L212 "Light Bathroom"             <lightbulb>  (LightsThing,Lights,GB211) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L212" }
Switch L221 "Light Guest room"           <lightbulb>  (LightsThing,Lights,GB221) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L221" }
Switch L231 "Light Bedroom"              <lightbulb>  (LightsThing,Lights,GB231) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L231" }
Switch L241 "Light Kids room"            <lightbulb>  (LightsThing,Lights,GB241) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L241" }
Switch L011 "Light Outside South"        <lightbulb>  (LightsThing,Lights,GB101) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L011" }
Switch L012 "Light Outside East"         <lightbulb>  (LightsThing,Lights,GB101) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L012" }
Switch L013 "Light Outside North"        <lightbulb>  (LightsThing,Lights,GB101) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L013" }
Switch L014 "Light Outside West"         <lightbulb>  (LightsThing,Lights,GB101) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L014" }
Switch L021 "Light Garage"               <lightbulb>  (LightsThing,Lights,GB101) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L021" }
Switch L022 "Light Garage Desk"          <lightbulb>  (LightsThing,Lights,GB101) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L022" }
Switch L031 "Light Pool"                 <lightbulb>  (LightsThing,Lights,GB101) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L031" }
Switch L041 "Light Gate"                 <lightbulb>  (LightsThing,Lights,GB101) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L041" }
Switch L042 "Light Garden"               <lightbulb>  (LightsThing,Lights,GB101) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L042" }
Switch L043 "Light Christmas"            <lightbulb>  (LightsThing,Lights,GB101) ["Switch","Light"]  { channel="mqtt:topic:pihome:lightsthing:L043" }

This way you can create up to 50 lights at a time and save clicking with subsequent icon assignments, etc. Enter the modified code and confirm with the Add button on the top right. The corresponding number of lights in Items will be created. In addition, they will each be in the respective room, so you don't have to click them manually.

OpenHAB Created Items

Add Thing for sockets, blinds, sensors, buttons, etc. in the exact same way. Be careful with blinds, there will be also a "STOP" option. With buttons, we will only react to "push" action. Add individual Channels and create Items from them collectively. In our model house, we have created more than 150 elements in this way.

Below you will find the bulk imports we have used. You can save hours of texting with copy our lists of objects and edit it for your own situation. Always create Thing and the appropriate Channels first. Then generate Items.


Switch S011 "Socket Gate"           <poweroutlet>  (SocketsThing,sockets,GB101) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S011" }
Switch S012 "Socket Garage"         <poweroutlet>  (SocketsThing,sockets,GB101) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S012" }
Switch S013 "Socket Water Tank"     <poweroutlet>  (SocketsThing,sockets,GB101) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S013" }
Switch S014 "Socket Outside Socket" <poweroutlet>  (SocketsThing,sockets,GB101) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S014" }
Switch S015 "Socket GreenHouse"     <poweroutlet>  (SocketsThing,sockets,GB101) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S015" }
Switch S016 "Socket Reserve"        <poweroutlet>  (SocketsThing,sockets,GB101) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S016" }
Switch S111 "Socket Vestibule"      <poweroutlet>  (SocketsThing,sockets,GB111) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S111" }
Switch S121 "Socket Toilet"         <poweroutlet>  (SocketsThing,sockets,GB121) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S121" }
Switch S131 "Socket Office"         <poweroutlet>  (SocketsThing,sockets,GB131) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S131" }
Switch S141 "Socket HeatPump"       <poweroutlet>  (SocketsThing,sockets,GB141) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S141" }
Switch S142 "Socket Technical"      <poweroutlet>  (SocketsThing,sockets,GB141) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S142" }
Switch S151 "Socket Living room"    <poweroutlet>  (SocketsThing,sockets,GB151) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S151" }
Switch S152 "Socket Dining room"    <poweroutlet>  (SocketsThing,sockets,GB151) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S152" }
Switch S153 "Socket Oven"           <poweroutlet>  (SocketsThing,sockets,GB152) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S153" }
Switch S154 "Socket Dishwasher"     <poweroutlet>  (SocketsThing,sockets,GB152) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S154" }
Switch S155 "Socket Kitchen Desk"   <poweroutlet>  (SocketsThing,sockets,GB152) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S155" }
Switch S161 "Socket Pantry"         <poweroutlet>  (SocketsThing,sockets,GB161) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S161" }
Switch S201 "Socket Hall"           <poweroutlet>  (SocketsThing,sockets,GB201) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S201" }
Switch S211 "Socket Bathroom"       <poweroutlet>  (SocketsThing,sockets,GB211) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S211" }
Switch S221 "Socket Guest room"     <poweroutlet>  (SocketsThing,sockets,GB221) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S221" }
Switch S231 "Socket Bedroom"        <poweroutlet>  (SocketsThing,sockets,GB231) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S231" }
Switch S241 "Socket Kids Room"      <poweroutlet>  (SocketsThing,sockets,GB241) ["Switch","Oil"]  { channel="mqtt:topic:pihome:socketsthing:S241" }


Switch H111 "Heating Vestibule"   <radiator> (HeatingsThing,heatings,GH111) ["Control","Power"]  { channel="mqtt:topic:pihome:heatingsthing:H111" }
Switch H121 "Heating Toilet"      <radiator> (HeatingsThing,heatings,GH121) ["Control","Power"]  { channel="mqtt:topic:pihome:heatingsthing:H121" }
Switch H131 "Heating Office"      <radiator> (HeatingsThing,heatings,GH131) ["Control","Power"]  { channel="mqtt:topic:pihome:heatingsthing:H131" }
Switch H151 "Heating Living room" <radiator> (HeatingsThing,heatings,GH151) ["Control","Power"]  { channel="mqtt:topic:pihome:heatingsthing:H151" }
Switch H152 "Heating Dining room" <radiator> (HeatingsThing,heatings,GH152) ["Control","Power"]  { channel="mqtt:topic:pihome:heatingsthing:H152" }
Switch H201 "Heating Hall"        <radiator> (HeatingsThing,heatings,GH201) ["Control","Power"]  { channel="mqtt:topic:pihome:heatingsthing:H201" }
Switch H211 "Heating Bathroom"    <radiator> (HeatingsThing,heatings,GH211) ["Control","Power"]  { channel="mqtt:topic:pihome:heatingsthing:H211" }
Switch H221 "Heating Guest room"  <radiator> (HeatingsThing,heatings,GH221) ["Control","Power"]  { channel="mqtt:topic:pihome:heatingsthing:H221" }
Switch H231 "Heating Bedroom"     <radiator> (HeatingsThing,heatings,GH231) ["Control","Power"]  { channel="mqtt:topic:pihome:heatingsthing:H231" }
Switch H241 "Heating Kids room"   <radiator> (HeatingsThing,heatings,GH241) ["Control","Power"]  { channel="mqtt:topic:pihome:heatingsthing:H241" }

//Bulk creation of thermostats and heatings modes. We don't ned MQTT for heatings modes and thermostats so no Channels for them
Number H111SET "Thermostat Vestibule"   <temperature_hot> (HeatingsThing,GH111) ["Point","ColorTemperature"]  
Number H121SET "Thermostat Toilet"      <temperature_hot> (HeatingsThing,GH121) ["Point","ColorTemperature"]  
Number H131SET "Thermostat Office"      <temperature_hot> (HeatingsThing,GH131) ["Point","ColorTemperature"]  
Number H151SET "Thermostat Living room" <temperature_hot> (HeatingsThing,GH151) ["Point","ColorTemperature"]  
Number H152SET "Thermostat Dining room" <temperature_hot> (HeatingsThing,GH152) ["Point","ColorTemperature"]  
Number H201SET "Thermostat Hall"        <temperature_hot> (HeatingsThing,GH201) ["Point","ColorTemperature"]  
Number H211SET "Thermostat Bathroom"    <temperature_hot> (HeatingsThing,GH211) ["Point","ColorTemperature"]  
Number H221SET "Thermostat Guest room"  <temperature_hot> (HeatingsThing,GH221) ["Point","ColorTemperature"]  
Number H231SET "Thermostat Bedroom"     <temperature_hot> (HeatingsThing,GH231) ["Point","ColorTemperature"]  
Number H241SET "Thermostat Kids room"   <temperature_hot> (HeatingsThing,GH241) ["Point","ColorTemperature"]  

Number H111MODE "Mode Vestibule"   <heating> (HeatingsThing,GH111) ["Point","Current"]  
Number H121MODE "Mode Toilet"      <heating> (HeatingsThing,GH121) ["Point","Current"]  
Number H131MODE "Mode Office"      <heating> (HeatingsThing,GH131) ["Point","Current"]  
Number H151MODE "Mode Living room" <heating> (HeatingsThing,GH151) ["Point","Current"]  
Number H152MODE "Mode Dining room" <heating> (HeatingsThing,GH152) ["Point","Current"]  
Number H201MODE "Mode Hall"        <heating> (HeatingsThing,GH201) ["Point","Current"]  
Number H211MODE "Mode Bathroom"    <heating> (HeatingsThing,GH211) ["Point","Current"]  
Number H221MODE "Mode Guest room"  <heating> (HeatingsThing,GH221) ["Point","Current"]  
Number H231MODE "Mode Bedroom"     <heating> (HeatingsThing,GH231) ["Point","Current"]  
Number H241MODE "Mode Kids room"   <heating> (HeatingsThing,GH241) ["Point","Current"]


Switch B111 "Button Vestibule 1"      <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B111",expire="1s,command=OFF" }
Switch B112 "Button Vestibule 2"      <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B112",expire="1s,command=OFF" }
Switch B121 "Button Toilet 1"         <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B121",expire="1s,command=OFF" }
Switch B122 "Button Toilet 2"         <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B122",expire="1s,command=OFF" }
Switch B131 "Button Office 1"         <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B131",expire="1s,command=OFF" }
Switch B132 "Button Office 2"         <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B132",expire="1s,command=OFF" }
Switch B133 "Button Office 3"         <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B133",expire="1s,command=OFF" }
Switch B134 "Button Office 4"         <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B134",expire="1s,command=OFF" }
Switch B141 "Button Technical room 1" <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B141",expire="1s,command=OFF" }
Switch B142 "Button Technical room 1" <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B142",expire="1s,command=OFF" }
Switch B151 "Button Living room 1"    <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B151",expire="1s,command=OFF" }
Switch B152 "Button Living room 2"    <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B152",expire="1s,command=OFF" }
Switch B153 "Button Living room 3"    <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B153",expire="1s,command=OFF" }
Switch B154 "Button Living room 4"    <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B154",expire="1s,command=OFF" }
Switch B155 "Button Living room 5"    <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B155",expire="1s,command=OFF" }
Switch B156 "Button Living room 6"    <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B156",expire="1s,command=OFF" }
Switch B157 "Button Living room 7"    <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B157",expire="1s,command=OFF" }
Switch B158 "Button Living room 8"    <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B158",expire="1s,command=OFF" }
Switch B159 "Button Kitchen 1"        <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B159",expire="1s,command=OFF" }
Switch B160 "Button Kitchen 2"        <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B160",expire="1s,command=OFF" }
Switch B161 "Button Pantry 1"         <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B161",expire="1s,command=OFF" }
Switch B162 "Button Pantry 2"         <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B162",expire="1s,command=OFF" }
Switch B201 "Button Hall 1"           <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B201",expire="1s,command=OFF" }
Switch B202 "Button Hall 2"           <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B202",expire="1s,command=OFF" }
Switch B211 "Button Bathroom 1"       <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B211",expire="1s,command=OFF" }
Switch B212 "Button Bathroom 2"       <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B212",expire="1s,command=OFF" }
Switch B213 "Button Bathroom 3"       <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B213",expire="1s,command=OFF" }
Switch B214 "Button Bathroom 4"       <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B214",expire="1s,command=OFF" }
Switch B221 "Button Guest room 1"     <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B221",expire="1s,command=OFF" }
Switch B222 "Button Guest room 2"     <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B222",expire="1s,command=OFF" }
Switch B223 "Button Guest room 3"     <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B223",expire="1s,command=OFF" }
Switch B224 "Button Guest room 4"     <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B224",expire="1s,command=OFF" }
Switch B231 "Button Bedroom 1"        <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B231",expire="1s,command=OFF" }
Switch B232 "Button Bedroom 2"        <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B232",expire="1s,command=OFF" }
Switch B233 "Button Bedroom 3"        <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B233",expire="1s,command=OFF" }
Switch B234 "Button Bedroom 4"        <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B234",expire="1s,command=OFF" }
Switch B241 "Button Kids room 1"      <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B241",expire="1s,command=OFF" }
Switch B242 "Button Kids room 2"      <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B242",expire="1s,command=OFF" }
Switch B243 "Button Kids room 3"      <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B243",expire="1s,command=OFF" }
Switch B244 "Button Kids room 4"      <wallswitch> (ButtonsThing) ["Tampered","Level"]  { channel="mqtt:topic:pihome:buttonsthing:B244",expire="1s,command=OFF" }


Rollershutter R111 "Shutter Vestibule"      <rollershutter>  (RollerShuttersThing,shutters,GB111) ["OpenState","Level"]  { channel="mqtt:topic:pihome:rollersthing:R111", expire="60s,command=STOP" }
Rollershutter R131 "Shutter Office East"    <rollershutter>  (RollerShuttersThing,shutters,GB131) ["OpenState","Level"]  { channel="mqtt:topic:pihome:rollersthing:R131", expire="60s,command=STOP" }
Rollershutter R132 "Shutter Office South"   <rollershutter>  (RollerShuttersThing,shutters,GB131) ["OpenState","Level"]  { channel="mqtt:topic:pihome:rollersthing:R132", expire="60s,command=STOP" }
Rollershutter R141 "Shutter Technical room" <rollershutter>  (RollerShuttersThing,shutters,GB141) ["OpenState","Level"]  { channel="mqtt:topic:pihome:rollersthing:R141", expire="60s,command=STOP" }
Rollershutter R151 "Shutter Living North1"  <rollershutter>  (RollerShuttersThing,shutters,GB151) ["OpenState","Level"]  { channel="mqtt:topic:pihome:rollersthing:R151", expire="60s,command=STOP" }
Rollershutter R152 "Shutter Living North2"  <rollershutter>  (RollerShuttersThing,shutters,GB151) ["OpenState","Level"]  { channel="mqtt:topic:pihome:rollersthing:R152", expire="60s,command=STOP" }
Rollershutter R153 "Shutter Living East"    <rollershutter>  (RollerShuttersThing,shutters,GB151) ["OpenState","Level"]  { channel="mqtt:topic:pihome:rollersthing:R153", expire="60s,command=STOP" }
Rollershutter R154 "Shutter Kitchen 1"      <rollershutter>  (RollerShuttersThing,shutters,GB152) ["OpenState","Level"]  { channel="mqtt:topic:pihome:rollersthing:R154", expire="60s,command=STOP" }
Rollershutter R155 "Shutter Kitchen 2"      <rollershutter>  (RollerShuttersThing,shutters,GB152) ["OpenState","Level"]  { channel="mqtt:topic:pihome:rollersthing:R155", expire="60s,command=STOP" }
Rollershutter R211 "Shutter Bathroom"       <rollershutter>  (RollerShuttersThing,shutters,GB211) ["OpenState","Level"]  { channel="mqtt:topic:pihome:rollersthing:R211", expire="60s,command=STOP" }
Rollershutter R221 "Shutter Guest room"     <rollershutter>  (RollerShuttersThing,shutters,GB221) ["OpenState","Level"]  { channel="mqtt:topic:pihome:rollersthing:R221", expire="60s,command=STOP" }
Rollershutter R231 "Shutter Bedroom"        <rollershutter>  (RollerShuttersThing,shutters,GB231) ["OpenState","Level"]  { channel="mqtt:topic:pihome:rollersthing:R231", expire="60s,command=STOP" }
Rollershutter R241 "Shutter Kids room"      <rollershutter>  (RollerShuttersThing,shutters,GB241) ["OpenState","Level"]  { channel="mqtt:topic:pihome:rollersthing:R241", expire="60s,command=STOP" }

Sensors of temperature, humidity, floor temperature

Number ST111  "Temp Vestibule"   <temperature> (SensortempThing,temp_humidity,GS111) ["Measurement","Temperature"]  { channel="mqtt:topic:pihome:tempthing:ST111" }
Number ST121  "Temp Toilet"      <temperature> (SensortempThing,temp_humidity,GS121) ["Measurement","Temperature"]  { channel="mqtt:topic:pihome:tempthing:ST121" }
Number ST131  "Temp Office"      <temperature> (SensortempThing,temp_humidity,GS131) ["Measurement","Temperature"]  { channel="mqtt:topic:pihome:tempthing:ST131" }
Number ST141  "Temp Technical"   <temperature> (SensortempThing,temp_humidity,GS141) ["Measurement","Temperature"]  { channel="mqtt:topic:pihome:tempthing:ST141" }
Number ST151  "Temp Living room" <temperature> (SensortempThing,temp_humidity,GS151) ["Measurement","Temperature"]  { channel="mqtt:topic:pihome:tempthing:ST151" }
Number ST152  "Temp Kitchen"     <temperature> (SensortempThing,temp_humidity,GS152) ["Measurement","Temperature"]  { channel="mqtt:topic:pihome:tempthing:ST152" }
Number ST161  "Temp Pantry"      <temperature> (SensortempThing,temp_humidity,GS161) ["Measurement","Temperature"]  { channel="mqtt:topic:pihome:tempthing:ST161" }
Number ST201  "Temp Hall"        <temperature> (SensortempThing,temp_humidity,GS201) ["Measurement","Temperature"]  { channel="mqtt:topic:pihome:tempthing:ST201" }
Number ST211  "Temp Bathroom"    <temperature> (SensortempThing,temp_humidity,GS211) ["Measurement","Temperature"]  { channel="mqtt:topic:pihome:tempthing:ST211" }
Number ST221  "Temp Guest room"  <temperature> (SensortempThing,temp_humidity,GS221) ["Measurement","Temperature"]  { channel="mqtt:topic:pihome:tempthing:ST221" }
Number ST231  "Temp Bedroom"     <temperature> (SensortempThing,temp_humidity,GS231) ["Measurement","Temperature"]  { channel="mqtt:topic:pihome:tempthing:ST231" }
Number ST241  "Temp Kids room"   <temperature> (SensortempThing,temp_humidity,GS241) ["Measurement","Temperature"]  { channel="mqtt:topic:pihome:tempthing:ST241" }

Number SH111 "Humidity Vestibule"   <humidity> (SensorsHumidityThing,temp_humidity,GS111) ["Measurement","Humidity"]  { channel="mqtt:topic:pihome:humiditything:SH111" }
Number SH121 "Humidity Toilet"      <humidity> (SensorsHumidityThing,temp_humidity,GS121) ["Measurement","Humidity"]  { channel="mqtt:topic:pihome:humiditything:SH121" }
Number SH131 "Humidity Office"      <humidity> (SensorsHumidityThing,temp_humidity,GS131) ["Measurement","Humidity"]  { channel="mqtt:topic:pihome:humiditything:SH131" }
Number SH141 "Humidity Technical"   <humidity> (SensorsHumidityThing,temp_humidity,GS141) ["Measurement","Humidity"]  { channel="mqtt:topic:pihome:humiditything:SH141" }
Number SH151 "Humidity Living room" <humidity> (SensorsHumidityThing,temp_humidity,GS151) ["Measurement","Humidity"]  { channel="mqtt:topic:pihome:humiditything:SH151" }
Number SH152 "Humidity Dining room" <humidity> (SensorsHumidityThing,temp_humidity,GS152) ["Measurement","Humidity"]  { channel="mqtt:topic:pihome:humiditything:SH152" }
Number SH161 "Humidity Pantry"      <humidity> (SensorsHumidityThing,temp_humidity,GS161) ["Measurement","Humidity"]  { channel="mqtt:topic:pihome:humiditything:SH161" }
Number SH201 "Humidity Hall"        <humidity> (SensorsHumidityThing,temp_humidity,GS201) ["Measurement","Humidity"]  { channel="mqtt:topic:pihome:humiditything:SH201" }
Number SH211 "Humidity Bathroom"    <humidity> (SensorsHumidityThing,temp_humidity,GS211) ["Measurement","Humidity"]  { channel="mqtt:topic:pihome:humiditything:SH211" }
Number SH221 "Humidity Guest room"  <humidity> (SensorsHumidityThing,temp_humidity,GS221) ["Measurement","Humidity"]  { channel="mqtt:topic:pihome:humiditything:SH221" }
Number SH231 "Humidity Bedroom"     <humidity> (SensorsHumidityThing,temp_humidity,GS231) ["Measurement","Humidity"]  { channel="mqtt:topic:pihome:humiditything:SH231" }
Number SH241 "Humidity Kids room"   <humidity> (SensorsHumidityThing,temp_humidity,GS241) ["Measurement","Humidity"]  { channel="mqtt:topic:pihome:humiditything:SH241" }

//Floor temp
Number SF111 "Floor temperature Vestibule"   <temperature> (SensorfloortempThing,temp_humidity,GS111) ["Measurement","Level"]  { channel="mqtt:topic:pihome:floortempthing:SF111" }
Number SF121 "Floor temperature Toilet"      <temperature> (SensorfloortempThing,temp_humidity,GS121) ["Measurement","Level"]  { channel="mqtt:topic:pihome:floortempthing:SF121" }
Number SF131 "Floor temperature Office"      <temperature> (SensorfloortempThing,temp_humidity,GS131) ["Measurement","Level"]  { channel="mqtt:topic:pihome:floortempthing:SF131" }
Number SF151 "Floor temperature Living room" <temperature> (SensorfloortempThing,temp_humidity,GS151) ["Measurement","Level"]  { channel="mqtt:topic:pihome:floortempthing:SF151" }
Number SF152 "Floor temperature Dining room" <temperature> (SensorfloortempThing,temp_humidity,GS152) ["Measurement","Level"]  { channel="mqtt:topic:pihome:floortempthing:SF152" }
Number SF201 "Floor temperature Hall"        <temperature> (SensorfloortempThing,temp_humidity,GS201) ["Measurement","Level"]  { channel="mqtt:topic:pihome:floortempthing:SF201" }
Number SF211 "Floor temperature Bathroom"    <temperature> (SensorfloortempThing,temp_humidity,GS211) ["Measurement","Level"]  { channel="mqtt:topic:pihome:floortempthing:SF211" }
Number SF221 "Floor temperature Guest room"  <temperature> (SensorfloortempThing,temp_humidity,GS221) ["Measurement","Level"]  { channel="mqtt:topic:pihome:floortempthing:SF221" }
Number SF231 "Floor temperature Bedroom"     <temperature> (SensorfloortempThing,temp_humidity,GS231) ["Measurement","Level"]  { channel="mqtt:topic:pihome:floortempthing:SF231" }
Number SF241 "Floor temperature Kids room"   <temperature> (SensorfloortempThing,temp_humidity,GS241) ["Measurement","Level"]  { channel="mqtt:topic:pihome:floortempthing:SF241" }

PIR sensors

Switch SP111 "PIR Vestibule"      <motion> (SensorPIRThing,motions,GS111) ["Status","Presence"]  { channel="mqtt:topic:pihome:pirthing:SP111" }
Switch SP121 "PIR Toilet"         <motion> (SensorPIRThing,motions,GS121) ["Status","Presence"]  { channel="mqtt:topic:pihome:pirthing:SP121" }
Switch SP131 "PIR Office"         <motion> (SensorPIRThing,motions,GS131) ["Status","Presence"]  { channel="mqtt:topic:pihome:pirthing:SP131" }
Switch SP141 "PIR Technical room" <motion> (SensorPIRThing,motions,GS141) ["Status","Presence"]  { channel="mqtt:topic:pihome:pirthing:SP141" }
Switch SP151 "PIR Living room"    <motion> (SensorPIRThing,motions,GS151) ["Status","Presence"]  { channel="mqtt:topic:pihome:pirthing:SP151" }
Switch SP152 "PIR Dining room"    <motion> (SensorPIRThing,motions,GS152) ["Status","Presence"]  { channel="mqtt:topic:pihome:pirthing:SP152" }
Switch SP161 "PIR Pantry"         <motion> (SensorPIRThing,motions,GS161) ["Status","Presence"]  { channel="mqtt:topic:pihome:pirthing:SP161" }
Switch SP201 "PIR Hall"           <motion> (SensorPIRThing,motions,GS201) ["Status","Presence"]  { channel="mqtt:topic:pihome:pirthing:SP201" }
Switch SP211 "PIR Bathroom"       <motion> (SensorPIRThing,motions,GS211) ["Status","Presence"]  { channel="mqtt:topic:pihome:pirthing:SP211" }
Switch SP221 "PIR Guest room"     <motion> (SensorPIRThing,motions,GS221) ["Status","Presence"]  { channel="mqtt:topic:pihome:pirthing:SP221" }
Switch SP231 "PIR Bedroom"        <motion> (SensorPIRThing,motions,GS231) ["Status","Presence"]  { channel="mqtt:topic:pihome:pirthing:SP231" }
Switch SP241 "PIR Kids room"      <motion> (SensorPIRThing,motions,GS241) ["Status","Presence"]  { channel="mqtt:topic:pihome:pirthing:SP241" }

//BUlk creation of PIR modes (can handle the lights or not), no Channels for modes
Switch SP111_trigger "PIR Trigger Vestibule"      <motion> (SensorPIRThing,motions,GS111)       ["Point","Noise"]  
Switch SP121_trigger "PIR Trigger Toilet"         <motion> (SensorPIRThing,motions,GS121)       ["Point","Noise"]  
Switch SP161_trigger "PIR Trigger Pantry"         <motion> (SensorPIRThing,motions,GS161)       ["Point","Noise"]  
Switch SP211_trigger "PIR Trigger Bathroom"       <motion> (SensorPIRThing,motions,GS211)       ["Point","Noise"]  
Switch SP201_trigger "PIR Trigger Stairs"         <motion> (SensorPIRThing,motions,GS201,GS111) ["Point","Noise"]  
Switch SP141_trigger "PIR Trigger Technical"      <motion> (SensorPIRThing,motions,GS141)       ["Point","Noise"] 

Add comment

Nejlepší články z blogu

Tailscale - remote access without public IP
Tailscale - remote access without public IPRating: 

The Tailscale service solves access between individual devices if you don't have a public IP address. It's free for one user with support for up to 100 devices. We'll show you how to install Tailscale on a Raspberry Pi that you'll have at home and on a client (Android, iPhone) from which you'll want to access the home Raspberry Pi. Our example will be remote access to OpenHAB running on a Raspberry Pi. However, the same setup applies to many other applications - home NAS, PiHole, Home Assistant, Domoticz, NextCloud, and others.

Shelly OpenHAB MQTT
Shelly vs OpenHABRating: 

The Shelly brand is known for its products that primarily communicate over WiFi, including smart plugs, relay switches, blinds control relays, and many other devices. One of the advantages for deployment is the ability to both read and control these devices using the universal MQTT protocol. Across existing add-ons for both OpenHAB and Home Assistant, we will demonstrate how to use Shelly devices without installing any additional extensions.

Victron & OpenHAB
Victron vs Smart HomeRating: 

In this post, we will show you how to retrieve information from a photovoltaic power plant by Victron. We will connect to the Cerbo unit via MQTT. Based on these values, we can control various appliances (heating, boiler, etc.) and prevent the battery from being drained when they don't need to be.

Smart Home GoodWe inverter
Smart Home vs GoodWeRating: 

In the post, we will demonstrate step by step how to communicate directly with the GoodWe inverter in a smart home setup and obtain real-time information (unlike the SEMS portal). This information is essential if we want to react to current parameters in a smart home, such as activating additional cooling or controlling a socket with a various load.

Voice control smart home
Voice control of the houseRating: 

In this article, we will connect the Amazon Echo Dot voice assistant with open source home automation. We won't be using OpenHAB Cloud, so everything runs locally. In this case, a few additional settings are necessary, but the result is worth it!

MikroTik - Winbox, DHCP, Ranges
Basics - Winbox, DHCPRating: 

In this series, we will look at the step-by-step setup of MikroTik devices for home users or a small business (up to 25 people). In the first article, we will focus on the initial setup - we will download Winbox and set up DHCP for the primary network and guest network. Similarly, we will also adjust the WiFi settings.

Alarm Smart Home PIR
Alarm from existing PIR sensors in a smart home.Rating: 

In a your smart home, PIR sensors may not only be used to switch lights on and off based on motion, it is possible to utilize these sensors to detect the presence of motion in a particular room. This information can be used to create a relatively reliable uncertified home security system. In this guide, you will find the logic for how this can work in the OpenHAB software in our model smart home.

NFC Tag Example in Smart Home
NFC tags in smart homeRating: 

NFC (Near Field Communication) tags are small plastic or paper stickers that can be used to automate various functions in the smart home. In this article, we will show you examples of use and a guide on how to write an action on an NFC tag using a mobile phone.

WireGuard iOS
WireGuard on iOS devicesRating: 

In this article, you will find a detailed guide on how to connect to WireGuard VPN from iOS.

WireGuard on Android device
WireGuard on Android devicesRating: 

In this article, you will find a detailed guide on how to connect to WireGuard VPN from Android.