Integrate Siemens Logo (plclogo) in OpenHAB 2

Hi everybody,
I am still reading / exploring this as a beginner
hoping to discover common pitfalls.
I cannot see the status (nor status updates) in PaperUI/Control for Logo-inputs. It works for Logo-outputs. Status updates work for inputs/outputs in BasicUI/Sitemap (re-start of OpenHAB helps after re-config, also working with several browsers).
Do you see any status (updates) for inputs in PaperUI?
Here my items (I played a lot with [%s] ):

Contact Logo7_I1        "I1 status is [MAP(de.map):%s]" { channel="plclogo:digital:Logo7:Inputs:I1" }
Contact Logo7_I2        "I2 [%s]" <light>   { channel="plclogo:digital:Logo7:Inputs:I2" }
Contact Logo7_I3_Kueche "I3 Status Fenster [MAP(de.map):%s]"    <door> { channel="plclogo:digital:Logo7:Inputs:I3" } 

Thanks
Arnd

Hello @tv-arnd,

this was my observation too: PaperUi will not show state for Contact items. More over: sometimes PaperUi failes to update the state for Switch items properly. I observed it with pulse things with 100ms pulse length. Nevertheless, the state is updated properly: log file has entries about item state change.

Kind regards,

Alexander

i don’t know why my settings are not working.
openhab 2.4 and newest plclogo-2.3.0 installed

simple configuration of one logo with on Analog Thing (AI4)
the connection to the logo seems to work but not to the AI

image

and the log says:
2018-06-19 11:25:47.618 [WARN ] [nding.plclogo.internal.PLCLogoClient] - Reconnect during read from 192.168.100.101: TCP Sending error.

i also tried with other logos and only one digital thing (Q1).

what should i do?

same effect wita01 described above

Hi there
I have exactly the same issue (warning, non functioning) here. strugguling with that since February. I was hoping the actual version of the binding would help to make it working but no sucess yet. ;(

For me, the fault message appears once per second in the log for ten times, before it stops and restarts after another 5 seconds or so.
ANY idea, please?!

PS: OH2 is running a virtual machine (VMWare, Ubuntu Server 18.x)

PSS:
for some reason, it seams that 2 jobs are created at the same time on a restart:

2018-06-19 20:07:03.525 [INFO ] [ing.plclogo.handler.PLCBridgeHandler] - Creating new reader job for 192.168.0.21 with interval 100 ms.
2018-06-19 20:07:03.536 [INFO ] [ing.plclogo.handler.PLCBridgeHandler] - Creating new RTC job for 192.168.0.21 with interval 500 ms.

I’d like to share my config now, and hope that anyone can tell me what I’m doing wrong :slight_smile:

Logo-Program:


(the idea of timer B005 and B044 is, to avoid any misbehavior in case V2.0 or V2.4 remains on indefinitely for some reason; works well in simulation)

Logo-Config:

Binding is running:

*.things:

*.items
disregard items in section “virtual switch”, except the first two lines as they’re not existing anymore


Logo6

(will not post the rule for now since I suspect the problem is in communication)

Paper-UI
screenshot shows a formerly used config with more than just two puls-things. Disregard the 6 digital pulse in/outputs in the bottom as they don’t exist anymore in the actual config


(note that any pulse remains on, once it was activated, clicking it on that page causes two entries in events log: "changed from ON to OFF ; changed from OFF to ON)

and finally the openhab log:

please help! Thank you very much in advance!

Hello @everybody,

after a long time, PR was reviewed and some modifications was need. Additionally, i build the binding against 2.4.0 snapshot. Download it here, please. Is it possible to get feedback, if it still work? Thanks :slight_smile:

@novoplan: As far as i see, you are using old configuration style. It will not work with current binding version.
You can access analog block now via

  Thing analog aInputs  [ kind="AI" ]
  Thing analog aOutputs [ kind="AQ" ]

Inputs/Outputs can be found then in Channels:

Please, take a look into documentation for more details. The warning in a log file simply says, that binding was unable to get new states from Logo and the reason why.

@wita01: VMWare can be a reason for your network issues, since communication runs via virtual network adapter and not physical one. May be this helps
 That’s right, binding creates two reader threads: One thread to monitor data state changes and another to monitor RTC (Real Time Clock). The reason is simple: Logo updates RTC once a second. And i’ll have the value as accurate as possible, even data update thread is configured to fetch changes once a minute. Please, forget PaperUI, if you will monitor state changes properly. PaperUI simply fail to get changes. Sometimes it helps to reload browser page. Additionally, especially pulse things tends not to update properly, if modified via PaperUI. My test system ends sometimes in a kind of endless loop: Pulse switch goes pemanently ON/OFF. Restart openhab or Logo! will help only :frowning:

Kind regards,

Alexander

@falkena: Thanks for your reply and explanations. I’m almost sure that VMWare is not the origing of the issue, because I was playing around with a former version of your Binding on a raspberry PI. This was done in February or so, with exactly the same Log entries. Additionally do you think that no communication would be the result in that case? Poor network performence might be an explanation for unstable communication rather than no communication, in my opinion?
My ethernet network has max. 30 devices online, including all access points, mobile phones and so on. Not much traffic, however there are quite a few nodes to be passed: Notebook-> EthernetSwitch-> Router(Switch)-> EthernetSwitch-> PowerLineAdaptor-> 230V-> PowerLineAdaptor-> Logo.
But LogoSoftComfort, for example, works perfectly fine (OH2 stopped of course), and also Ping returns reasonable times with no package loss. Both from a Virtualized Windows machine running in parallel to OH2 (not from the pysical host!).
Anyway I will retry with just one switch in between, and/or from a raspberry.

Thanks for this advice - what a pitty! Will there be along term solution? I do never want my outdoor lights in an endless ON and OFF loop!
But for monitoring I also used the “events.log”, as well as my eyes (no light was going on) so definitely no communication- neither to- nor from the Logo.

I’m really looking forward to having your great piece of work running in my environment :slight_smile:
Thank you!
Stefan

Hi @wita01,

as far i see, you are able to communicate with Logo. But it seems to be very unstable: You get nearly every 3’d second timeout. After any timeout, new connection must be opened. This is a warning you see. May be it’s a good idea to reduce Log-Level from WARN to INFO or DEBUG. I wouldn’t trust LogoSoftComfort: It may have the same behaviour and you simply do not see it
 Please, try follow: “Hack” a small FBD as shown here. Then “hack” two memory and digital output things:

// things
Thing  digital Outputs [ kind="Q" ]
Thing  memory  VB0_1   [ block="VB0.1" ]
Thing  memory  VB0_2   [ block="VB0.2" ]

And create items connected to things above on properly channels. Then start openhab and online simulation in LogoSoftComfort! same time on same Logo. You should see NI state changes in online simulation, if you modify switches in openhab and openhab should reflect Q1 changes. Was it successfull? What time is reported by ping?

My follow setup work fine with 100ms - polling

Production system:

                                                                                                | --> Logo1

RasPi3 --> Cable --> Router --> Cable --> Switch --> Cable --> -|
| --> Logo2
Ping response: 0.5-5ms for both Logos.

Test system:
RasPi2 --> Wireless --> Router --> Cable --> Cable --> Logo
Ping response: 3-16ms

Kind regards,

Alexander.

thanks a lot. now i can see the actual state of my items.
but why i get those warnings in the log?

2018-06-26 13:17:26.032 [WARN ] [nding.plclogo.internal.PLCLogoClient] - Reconnect during read from 192.168.100.101: TCP Sending error.

Hi @novoplan,
normally due to network connection. It seems, i must reduce log level from WARN to INFO :slight_smile:

Kind regards,

Alexander.

does the binding need an internet connection? i’m wondering.
after enabling my filter rule to disconnect the pi from the internet, the binding responses a network error.
everythings works fine after disabling the filter.
ping to the logos with enabled filter works fine.

@novoplan: No. Internet connection isn’t need. But at least port 102 must be open: http://www.multiprojekt.pl/ftp/weintek_hmi/plc_connection_guide/Siemens_LOGO_Ethernet.pdf

Kind regards,

Alexander.

Hello @all,

just right now uploaded new version of the binding in my binary repository.
Change-Log:

  1. Modify thread for RTC to reduce system load.
  2. Added “weekday” channel to the bridge, since Logo, at least Logo8, provides Day of the Week :slight_smile:
    Channel accepts String-Items.
  3. Added “diagnostic” channel to the bridge. Channel accepts String - Items.
    Currently, i have valid mapping for Logo8 only. Can somebody assit me please, to find
    the mapping for Logo7? Binding logs raw data got from Logo in TRACE mode.

Is it possible to get feedback, if changes are ok? If yes, i will add a commit to pull-request :slight_smile:

Thanks.

Kind regards,

Alexander

Hi @falkena,

I did some quick testing and everything seems to be working fine.
Diagnostic channel says “SD Card does not exist” which is correct in my case.

Regards,
Jacek

Hi guys,

New at the openhab2 story. I’ve managed to connect openhab2 with my 3 logo8 modules.
From paper UI I can see the status of my digital output switches , but when i flip the switch, nothing happens.
Like I have read only rights.

Any idea what I’m doing wrong?

regards,
Stijn

Hi @snowstriker,
Nothing: It’s not possible to set Q’s directly. I assume, that Logo simply overwrites value you set during next program cycle. It’s possible to set VB - memory blocks (memory thing) or Marker (digital thing with kind=“M”).
See documentation for details.

Kind regards,

Alexander

PS: Thanks @skazi for testing!

Hello,

Im new here and need some help to start up.

I install openhab 2 on my raspery PI.
It works.

Now i want to install the addon.


I put it into the diretory.

But what are the next steps to get it in Paper UI? And the control panel.

Tanks

Hi @falkena,

I found a sheet for the corresponding memory blocks for logo8 and the digital outputs, yet the GUI didn’t accept my values. Do you have more documentation about how to find or calculate the right parameter to alter the digital outputs?

Same question for Marker, can’t find a lot of information about how to use the marker parameter.

if someone can just point me in the right direction I can try and test some things.

Thanks.

@snowstriker try with something simple like here: Integrate Siemens Logo (plclogo) in OpenHAB 2 (including my following comments)

Hi @skazi , I now have a working logo configuration with 3 logo devices. For some use cases( all lights out or off ) it uses NI and NQ for communicating between logo’s. I don’t have any VB value because I used the remote device parameter. So do i Need the use a new Network input , give it a local variable memory value and configure in logosoft what happens when openhab gives a signal?