3.díl - Konfigurace - Things, Items

Co budeme potřebovat:

RPi 3 B+ nebo RPi 4 B (+ nějaký case) s nainstalovaným OpenHAB dle návodu zde.

SSD flash disk (v testovacím provozu lze nahradit kvalitnější microSD kartou)

Úvodem

V minulém návodu jsme nainstalovali OpenHAB 3 a přidali pár užitečných rozšíření pro základní funkcionalitu. V tomto návodu začneme s konfigurací domu. Základní model naleznete pod Settings-> Model. Pomocí Add location vytvořte strukturu vašeho bydlení. Např. přízemí, první patro, zahrada. A do jednotlivých lokací přidejte pokoje. Podlaží i pokoje jsou typy Group viz příklad:

OpenHAB - Model configuration

Pak budeme do jednotlivých místností přidávat jednotlivé prvky Items, tedy zásuvky, světla, senzory atd. To je ale možné vytvářet také hromadně. Ukážeme si to o krok dál.

MQTT a propojení s "Items" (světla, zásuvky, žaluzie, senzory atd.)

Musíme se rozhodnout jak to udělat s MQTT. Abychom mohli nastavit reakci na MQTT zprávy musíme prvek Items provázat s nějakým Thing typu MQTT Binding. V tomto případě pro komunikaci s Arduinem použijeme typ Generic MQTT Thing. Jednodužší než vytvářet spousty Thing pro každé světlo je vytvořit jeden Thing pro dejme tomu všechny světla a pak pod touto Thing vytvořit tolik Channels kolik máme světel. V Channels nastavíme na jaký tvar MQTT zprávy (topic) bude daný Channel reagovat.  Prvky nebo-li Items pak z Channels lze vytvořit hromadně. Už jste se v tom ztratili? :D Nebojte, až si to naklikáte bude vám to jasnější. Pojďme na to!   

Přejděte do záložky Settings->Thing a přidejte novou položku pomocí modré ikony + vpravo dole. Vyberte
a vyplňte například dle obrázku níže:

OpenHAB - MQTT Thing

Rozklikněte si nové přidaný Lights Thing a uprostřed přepněte na panel Channels. Zvolte Add new Channel. Vyberte On/Off Switch a nastavte dole na jaký typ zprávy (topic) bude Channel reagovat.

OpenHAB - MQTT Thing Channel

OpenHAB - MQTT Thing Channel Topic

Další Channels můžete vytvořit buď dalším klikáním (voprus), nebo rychleji textově, že zkopírujete a upravíte nový Channel v záložce Code kterou najdete úplně vpravo. Všimněte si kódování světel jako Lxxx, kde L=Light a xxx je označení místnosti v domě viz. Pi-Home - Modelový dům

OpenHAB - MQTT Thing Channel Bulk Import

Náš Code pro Thing světel vypadal tedy nějak takto:

UID: mqtt:topic:pihome:lightsthing
label: Lights Thing
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:pihome
channels:
  - id: L111
    channelTypeUID: mqtt:switch
    label: Light Vestibule
    description: ""
    configuration:
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L111_off
      on: L111_on
  - id: L112
    channelTypeUID: mqtt:switch
    label: Light Stairs GF
    description: null
    configuration:
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L112_off
      on: L112_on
  - id: L121
    channelTypeUID: mqtt:switch
    label: Light Toilet
    description: null
    configuration:
      commandTopic: pihome/lights
      stateTopic: pihome/lights
      off: L121_off
      on: L121_on

Přidejte všechna světla a jejich specifické MQTT. Nakonec zvolte Add Equipment to Model ,dole zvolte Expert mode. Uvidíte textový výstup pro vytvoření prvků Items. Tento text jde malinko poupravit, aby jste už rovnou řekli jaké ikony chcete u těchto prvků mít, v jakých skupinách budou atp. Pro náš modelový dům by nakonec vypadal hromadný import prvků Items nějak takto:

//Lighs
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" }

Takto můžete najednou vytvořit i 50 světel a ušetřit si klikání s následným přiřazováním ikon atp. Upravený kód vložte a potvrďte tlačítkem Add vpravo nahoře. Vytvoří se vám odpovídající počet světel v Items.

OpenHAB - Created Items

Úplně stejným způsobem přidejte Thing pro zásuvky, žaluzie, senzory, tlačítka atd. Pozor u žaluzii bude ještě volba "STOP". U tlačítek budeme reagovat jenom na stlačení. Přidejte jednotlivé Channels a vytvořte z nich pak hromadně Items. V našem modelovém domě jsme takto předvytvořili více než 150 prvků.

Pi-Home - Things, Items example

Níže naleznete hromadné importy, které jsme použily. Vždy vytvořte prvně Thing a příslušné Channels. Pak teprv generujte Items.

Zásuvky

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" }

Topení

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" }

//Hromadně vytvoříme i termostaty a režimy topení nezávislé už na MQTT, tedy Channel pro ně nejsou potřeba
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"]

Tlačítka

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" }

Žaluzie

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" }

Senzory teploty mísností, podlahy a vlhkosti

//Temp
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" }

//Hum
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 senzory

//PIR
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" }

//Hromadně vytvoříme i režimy PIR nezávislé už na MQTT, tedy Channel pro ně nejsou potřeba
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"] 


Přidat komentář

Nejlepší články z blogu

PiHome - Chytry dum mereni spotreby elektriny
Měření spotřeby domu po fázíchHodnocení: 
0%

V tomto příspěvku ukážeme jak lze řešit měření aktuální spotřeby po fázích v rodinném domě. Lze použít různé komerční zařízení, bohužel nativní MQTT zařízení jsme nenašli. V našem případě jsme tedy zvolili kvůli existující síti Z-Wave produkt Aeotec Home Energy Meter Gen5.

DIY Alarm
Alarm z existujících PIR senzorů v chytrém doměHodnocení: 
0%

V chytrém domě, kde PIR čidla neslouží jenom ke spínání světel při pohybu, je možné tyto čidla vyžít k zjištění přítomnosti osob v dané místnosti. Na těchto informacích se dá postavit poměrně spolehlivý domácí necertifikovaný zabezpečovací systém. V tomto postupu naleznete logiku jakým způsobem to může fungovat v softwaru OpenHAB 3 na našem demo příkladě chytrého domu.

Arduino PIR - možnost deaktivace, časovač a denní doba
Pokročilé nastavení PIR čidel pro řízení světel v OpenHABHodnocení: 
100%

PIR čidlo HC-SR501 obsahuje mechanické nastavení dosahu záběru a délky sepnutí. V inteligentním domě ale chceme mít možnost variabilně parametry PIR měnit. Ukážeme jak PIR čidlo nastavit tak, aby šlo v aplikaci nebo vypínačem deaktivovat a volitelně nastavovat délku svícení.

Centrální tablet pro chytrý dům
Centrální tablet pro ovládání chytrého domuHodnocení: 
80%

Centrální tablet nebo starší smartphone se perfektně hodí jako centrální ukazatel informací o stavu v domě a také k jeho ovládání. Zpravidla nahrazuje videovrátného a můžete si na něm pustit například oblíbenou hudbu při vaření nebo číst recepty. V článku popíšeme funkční příklad takového "wall" tabletu a jeho nastavení v tzv. kiosk módu, aby nesvítíl po nocích a reagoval jenom když je někdo poblíž.

Persistent linux live USB
Vytvoření persistent live USB LinuxuHodnocení: 
0%

Většina distribucí linuxu existuje v "live" provedení, tz. že po rozbalení jej můžete používat přímo z flash disku nebe externiho SSD. Po uložení práce se vám ale klasická live distribuce znovu uvede to výchozího nastavení. Toto řeší tzv. persistent live instalace. Ukážeme si jak jej vytvořit na Linuxu nebo Windows.

Jabltron propojení s chytrou domácností
Propojení Jablotronu s OpenHABHodnocení: 
0%

V tomto článku si představíme užitečný "binding" pro OpenHAB hlavně v tuzemských instalacích kde je hodně zastoupen alarm od firmy Jablotron. Propojení alarmu s chytrou domácností nám umožní reagovat na stav zakódování/odkodování domu. Typicky při zákodování domu zhasnout všechna světla, zavřít přívod vody, vypnout cirkulaci TUV, vypnout spínáne zásuvky a cokoliv dalšího co nepotřebujete v provozu nejste-li doma.

Thunderbird vs Exchange email and calendar
Thunderbird vs MS ExchangeHodnocení: 
0%

V tomto článku si ukážeme jak provozovat firemní poštu a kalendář postavenou na MS Exchange 20xx s Thunderbirdem na jakḱoliv distribuci Linuxu. Používám toto řešení k spokojenosti přes 8 let od verze Exchange 2013 - 2016 - 2019.

Konfigurace OpenVPN na MikroTiku
OpenVPN na routerech MikroTikHodnocení: 
90%

Máte-li doma smart-home, NAS atp., je dobré myslet na bezpečný přístup do vaší sítě zvenku. Zde bych aktuálně volil komerční router jako Turris, nebo levnější variantu routerů MikroTik. V tomto článku ukážeme postup, jak si zřídit zabezpečený přístup do domácí sítě z venku jak z počítače tak z mobilu pomocí OpenVPN na routerech MikroTik.

Nastavení OpenVPN v iOS
Nastavení OpenVPN připojení v iOSHodnocení: 
100%

V tomto článku najdete podrobný návod, jak se připojit k OpenVPN v iOS.

Nastavení OpenVPN na Androidu
Nastavení OpenVPN připojení v AndroiduHodnocení: 
100%

V tomto článku najdete podrobný návod, jak se připojit k OpenVPN na Androidu.