Integrate Siemens Logo (plclogo) in OpenHAB 2

Thanks @falkena for the great binding.
I am now working with the merged version from the openHAB 2.4 on RaspberryPI.
There were many contributions for practical solutions above - thanks as well. This thread becomes quite overloaded, imho. I think we should create a new forum thread to collect solutions that are complete and 100% work (fool-proof).

One post in that thread contains one solution? Or like the “Design Pattern” (one topic per solution)? Tagged with [Tutorials & Examples] [Solutions] [Bindings]

This should be editable (for revision) by all, if possible? Alternatively feedback from replies is incorporated into the 1st post (by the author of thread).
Should contain some structure, e.g. Problem Statement, Concept, Example, a screenshot of what you get (sitemap screenshot), openHAB version, zip-file with all openhab-config files and maybe Logo-config (Logo soft comfort file or screenshot of the Diagram-Editor. Drawback: This forum does not permit zip-file uploads, therefore all config must be placed as code fences in the post.

What do you think?

I wish we could get properly consolidated examples for:

  • rolloshutters
  • lights (switch + status indicator)
  • timer configuration (setting logo clock parameters…more in a later post)

Here an example as template.

Thread-name PLCLogo Solution: Logo Input Monitoring

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 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.

This thread is a wiki article and can be improved by everyone. Please do!

Solution

Here is a screenshot of what the result look like.


(Screenshot contains modified icons, not included.)

LOGO! Configuration (LOGO! SoftComfort Diagram Editor)
OpenHAB_LogoPLC_alarmcontacts_Logo-config

Things (logo7.things)
In this example, the IP address 192.168.xxx.yyy represents the Logo device’s address and must be adapted.

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]"      <window> { channel="plclogo:digital:Logo7:Inputs:I1" }
Contact Logo7_I2    "Haustür [MAP(contact_door_de.map):%s]"         <frontdoor>   { channel="plclogo:digital:Logo7:Inputs:I2" }
Contact Logo7_I3    "Fenster Küche [MAP(contact_door_de.map):%s]"   <window> { channel="plclogo:digital:Logo7:Inputs:I3" } 
Contact Logo7_I4    "Fenster Essen [MAP(contact_door_de.map):%s]"   <door> { channel="plclogo:digital:Logo7:Inputs:I4" }
Contact Logo7_I5    "Fenster Wohnen (links) [MAP(contact_door_de.map):%s]"  <door> { channel="plclogo:digital:Logo7:Inputs:I5" }
Contact Logo7_I6    "Fenster Wohnen (rechts) [MAP(contact_door_de.map):%s]" <door> { 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

Troubleshooting

  • nothing so far

Next Ideas

  • none so far

Arnd

1 Like