This is a wiki article and can be improved by everyone. Please do!
(Use this as a template for further tutorials about PLCLogo.)
Problem Statement
How to obtain status of Logo-inputs for window/door alarm contacts?
Concept
Reading inputs of a Logo via openHAB PLCLogo binding and visualize their status (read-only) in a BasicUI sitemap. Magnetic alarm contacts provide the open/closed status of a window or door. A closed alarm contact shall represent a closed window/door. Connect each alarm contact to a dedicated Logo-input. A sophisticated Logo configuration is not required because Logo-inputs are directly read by the PLCLogo binding.
Solution
Here is a screenshot of what the result looks like.
(Screenshot contains modified icons, icons.pdf (7.2 KB) Rename pdf to zip!)
LOGO! Configuration (LOGO! SoftComfort Diagram Editor)
Things (logo7.things)
In this example, the IP address 192.168.xxx.yyy represents the Logo device’s address and must be adapted.The TSAP parameters must be adjusted as well.
Bridge plclogo:device:Logo7 "Logo7 PLC" [ address="192.168.xxx.yyy", family="0BA7", localTSAP="0x0200", remoteTSAP="0x0200", refresh=1000 ]
{
Thing digital Inputs "Logo7 Inputs" [ kind="I" ]
Thing digital Outputs "Logo7 Outputs" [ kind="Q" ]
}
Items (logo7.items)
Contact Logo7_I1 "Fenster WC [MAP(contact_door_de.map):%s]" <mywindow> { channel="plclogo:digital:Logo7:Inputs:I1" }
Contact Logo7_I2 "Haustür [MAP(contact_door_de.map):%s]" <myfrontdoor> { channel="plclogo:digital:Logo7:Inputs:I2" }
Contact Logo7_I3 "Fenster Küche [MAP(contact_door_de.map):%s]" <mywindow> { channel="plclogo:digital:Logo7:Inputs:I3" }
Contact Logo7_I4 "Fenster Essen [MAP(contact_door_de.map):%s]" <mydoor> { channel="plclogo:digital:Logo7:Inputs:I4" }
Contact Logo7_I5 "Fenster Wohnen (links) [MAP(contact_door_de.map):%s]" <mydoor> { channel="plclogo:digital:Logo7:Inputs:I5" }
Contact Logo7_I6 "Fenster Wohnen (rechts) [MAP(contact_door_de.map):%s]" <mydoor> { channel="plclogo:digital:Logo7:Inputs:I6" }
Transformation (contact_door_de.map)
Make sure you have the Map Transformation service installed in Add-ons / Transformations.
CLOSED=ZU
OPEN=OFFEN
NULL=undefiniert
-=Strich
Sitemap (default.sitemap)
sitemap default label="Haus" {
Frame label="Alarmkontakte" icon="groundfloor" { // icon does not work
Default item=Logo7_I1 valuecolor=[CLOSED="green", OPEN="red"]
Default item=Logo7_I2 valuecolor=[CLOSED="green", OPEN="red"]
Default item=Logo7_I3 valuecolor=[CLOSED="green", OPEN="red"]
Default item=Logo7_I4 valuecolor=[CLOSED="green", OPEN="red"]
Default item=Logo7_I5 valuecolor=[CLOSED="green", OPEN="red"]
Default item=Logo7_I6 valuecolor=[CLOSED="green", OPEN="red"]
}
}
Revision History
- January 2019: original post for openHAB version 2.4 with Logo 0BA7
- February 2019: added custom icons and adapted icon-reference in items.
Troubleshooting
- nothing so far
Next Ideas
- none so far