Integrate Siemens Logo (plclogo) in OpenHAB 2

openhab2
binding
siemens
Tags: #<Tag:0x00007f51f2ec8010> #<Tag:0x00007f51f2ecfb80> #<Tag:0x00007f51f2ecf590>

(Mcullmann) #187

@ Udo: Thank you for that information, I will delete the imports.

@ dreamer: I actually did just two posts before, one is for light switches and one for roller shutter. You just need to change your IP, blockname and output name.


(tv-arnd) #188

@ falkena Great job, my 1st steps with plclogo binding works out of the box.
Some feedback regarding the documentation: https://github.com/falkena/openhab2-addons/blob/plclogo/addons/binding/org.openhab.binding.plclogo/README.md

In the logo.things example files the TSAP values are shown as 0x3100 / 0x2000. But in the table at the beginning of the documentation, the values are defined as 0x0300 or 0x0200. This might be a bit confusing. Hope that helps improving the documentation.

Arnd


(Alexander Falkenstern) #189

Hi @tv-arnd,

fixed it. Thanks.


(Alexander Falkenstern) #190

Hello everybody,

I’ve pushed binding update to my binary repository some days ago: @BlackAlpha found small bug with marker blocks on Logo7. Thanks for testing :slight_smile:

BTW: Pull-request https://github.com/openhab/openhab2-addons/pull/2286 is still open :frowning:

Kind regards,

Alexander


(tv-arnd) #191

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


(Alexander Falkenstern) #192

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


(Joe) #193

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


(Stefan) #195

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.

(Stefan) #196

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!


(Alexander Falkenstern) #197

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


(Stefan) #198

@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


(Alexander Falkenstern) #199

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.


(Joe) #200

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.


(Alexander Falkenstern) #201

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

Kind regards,

Alexander.


(Joe) #202

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.


(Alexander Falkenstern) #203

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


(Alexander Falkenstern) #204

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


(Jacek Tomasiak) #205

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


(Stijn Van Hoof) #206

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


(Alexander Falkenstern) #207

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!