Integrate Siemens Logo (plclogo) in OpenHAB 2

@falkena
Then I don’t know what’s wrong here:
API response for /things/plc01_my_domain_net is following:

{
  "statusInfo": {
    "status": "ONLINE",
    "statusDetail": "NONE"
  },
  "label": "plc01",
  "configuration": {
    "localTSAP": "0x0300",
    "refresh": 100,
    "address": "--removed--",
    "remoteTSAP": "0x0200",
    "family": "0BA8"
  },
  "properties": {},
  "UID": "plclogo:device:plc01_my_domain_net",
  "thingTypeUID": "plclogo:device",
  "channels": []
}

Nothing in channels :frowning:

OK, I got it working. I had the bridge from some old version of binding and it was (as in my dump above): plclogo:device:plc01_my_domain_net. I removed this, re-added and it got some random ID: plclogo:device:fb062d28. Now the rtc channel shows fine and everything (regarding RTC) seems to work correctly.

One weird thing still happening in my setup is that the old plclogo:device:plc01_my_domain_net keeps popping up in the inbox. Can this be related to the fact that I have DNS entry for the IP of my LOGO?

OK, I removed all plclogo things and re-added. Now RTC works with plclogo:device:plc01_my_domain_net too.

Hi @skazi,

Ok. Thanks for information:-)

Your problem with item linking don’t leave me in peace… It’s really strange with PaperUI.
I’ve create now thing via PaperUI and read it out via rest API. Channel is here. Seems to be configured properly, but I’m not able to connect a link to. It’s really strange. Have really no idea, what’s going wrong here :frowning:

Kind reagards,

Alexander

Hi @falkena

The channels also show up for me. The problem is channel type. Wouldn’t it work if you simply declare the channel types in the xml? Like for example here: https://github.com/openhab/openhab2-addons/blob/master/addons/binding/org.openhab.binding.exec/ESH-INF/thing/thing-types.xml#L48

BR,
Jacek

Hi @falkena
I noticed one more problem. In the ESH xml files you have patterns defined which don’t look correct to me.
For example: https://github.com/falkena/openhab2-addons/blob/feature/plclogo/addons/binding/org.openhab.binding.plclogo/ESH-INF/config/digital.xml#L7
If these are supposed to be standard regexps then e.g. VB[0-850]{1,3} means: VB followed by 1 to 3 digits from 0-8 range or 5s or 0s so e.g. VB9 will not be accepted.
BR,
Jacek

Hi @BlackAlpha, @jens and @skazi.

I’ve commited new version of binding to https://github.com/falkena/binaries

Fixes:

  1. Channel can not be linked vi PaperUI.
  2. Block name check failed due to erroneous regular expression.
  3. Logo 7 return wrong RTC data.
  4. Thing change in *.things file throws IllegalThreadStateException.
  5. Update documentation

Link of channels via PaperUI work on 2.1.0 snapshot only due to https://github.com/eclipse/smarthome/issues/2903

Feedback is always welcome.

I’ve one smal request: Can you, please, write down feature requests and bugs within my github/issues. There are a lot of discussion stuff here. And i am loosing last time what was done and what not.

Kind regards,

Alexander

Fix #1 confirmed to work fine. Thanks!

@falkena Where should we report bugs/feature requests? I don’t see any “Issues” enabled on your openhab forks (https://softwareengineering.stackexchange.com/questions/179468/forking-a-repo-on-github-but-allowing-new-issues-on-the-fork).

Hi @skazi,

thanks for the hint and link :slight_smile: I’ve activated issues. Should work now.

Kind regards,

Alexander

Hi,
i still can’t to right config my Logo8 in manual config.
Could somebody help me?
PaperUI:

Logo.things:

Bridge plclogo:device:Logo1 [ address="192.168.0.160", family="0BA8", localTSAP="0x0300", remoteTSAP="0x0200", refresh=200 ]
	{
	Thing plclogo:analog:Hladina_NA [ block="AM1" ]
	}

no items config

openhab.log:

2017-05-18 10:51:19.606 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Logo.things'
2017-05-18 10:51:19.756 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'Logo.things'
2017-05-18 10:51:19.785 [INFO ] [ing.plclogo.handler.PLCBridgeHandler] - Destroy RTC job for 192.168.0.160.

events.log:

2017-05-18 10:51:19.718 [ThingAddedEvent           ] - Thing 'plclogo:device:Logo1' has been added.
2017-05-18 10:51:19.732 [hingStatusInfoChangedEvent] - 'plclogo:device:Logo1' changed from UNINITIALIZED to INITIALIZING
2017-05-18 10:51:19.739 [ThingAddedEvent           ] - Thing 'plclogo:analog:Hladina_NA' has been added.
2017-05-18 10:51:19.744 [hingStatusInfoChangedEvent] - 'plclogo:device:Logo1' changed from INITIALIZING to OFFLINE (CONFIGURATION_ERROR): Can not initialize LOGO!. Please, check parameter.
2017-05-18 10:51:19.756 [hingStatusInfoChangedEvent] - 'plclogo:analog:Hladina_NA' changed from UNINITIALIZED to INITIALIZING
2017-05-18 10:51:19.759 [ThingUpdatedEvent         ] - Thing 'plclogo:analog:Hladina_NA' has been updated.
2017-05-18 10:51:19.763 [hingStatusInfoChangedEvent] - 'plclogo:analog:Hladina_NA' changed from INITIALIZING to ONLINE
2017-05-18 10:51:19.792 [ThingUpdatedEvent         ] - Thing 'plclogo:device:Logo1' has been updated.
2017-05-18 10:51:19.797 [ThingUpdatedEvent         ] - Thing 'plclogo:analog:Hladina_NA' has been updated.
2017-05-18 10:51:19.809 [ThingUpdatedEvent         ] - Thing 'plclogo:analog:Hladina_NA' has been updated.

I don`t know what is wrong…

Hi @Petos,

Bridge offlline errors comes normally from wrong localTSAP/remoteTSAP settings. Please take a look what is configured in LogoSoft Comfort. And try to run thing discovery. If your Logo is available via network, it should be shown in PaperUI. You can leave it discovered without configuration.

Please use

Thing analog Hladina_NA [ block="AM1" ]

instead of

Thing plclogo:analog:Hladina_NA [ block="AM1" ]

It was an copy/paste error in documentation before.

Kind regards,

Alexander

Hi @falkena,
i had it before too.
I changed it now again and frontail:

2017-05-18 18:18:12.929 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'Logo.things'
==> /var/log/openhab2/events.log <==
2017-05-18 18:18:12.980 [hingStatusInfoChangedEvent] - 'plclogo:analog:Hladina_NA' changed from ONLINE to UNINITIALIZED (HANDLER_MISSING_ERROR)
2017-05-18 18:18:12.989 [ThingRemovedEvent         ] - Thing 'plclogo:analog:Hladina_NA' has been removed.
==> /var/log/openhab2/openhab.log <==
2017-05-18 18:18:13.007 [INFO ] [ing.plclogo.handler.PLCBridgeHandler] - Destroy RTC job for 192.168.0.160.
==> /var/log/openhab2/events.log <==
2017-05-18 18:18:13.013 [ThingUpdatedEvent         ] - Thing 'plclogo:device:Logo1' has been updated.
2017-05-18 18:18:13.019 [ThingAddedEvent           ] - Thing 'plclogo:analog:Logo1:Hladina_NA' has been added.
==> /var/log/openhab2/openhab.log <==
2017-05-18 18:18:13.038 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'Logo.things'
==> /var/log/openhab2/events.log <==
2017-05-18 18:18:13.042 [hingStatusInfoChangedEvent] - 'plclogo:analog:Logo1:Hladina_NA' changed from UNINITIALIZED to INITIALIZING
2017-05-18 18:18:13.046 [ThingUpdatedEvent         ] - Thing 'plclogo:analog:Logo1:Hladina_NA' has been updated.
2017-05-18 18:18:13.051 [hingStatusInfoChangedEvent] - 'plclogo:analog:Logo1:Hladina_NA' changed from INITIALIZING to ONLINE
2017-05-18 18:18:13.063 [ThingRemovedEvent         ] - Thing 'plclogo:analog:Hladina_NA' has been removed.
==> /var/log/openhab2/openhab.log <==
2017-05-18 18:18:13.079 [INFO ] [ing.plclogo.handler.PLCBridgeHandler] - Destroy RTC job for 192.168.0.160.
==> /var/log/openhab2/events.log <==
2017-05-18 18:18:13.088 [ThingUpdatedEvent         ] - Thing 'plclogo:device:Logo1' has been updated.
2017-05-18 18:18:13.096 [ThingUpdatedEvent         ] - Thing 'plclogo:analog:Logo1:Hladina_NA' has been updated.
2017-05-18 18:18:13.101 [ThingUpdatedEvent         ] - Thing 'plclogo:analog:Logo1:Hladina_NA' has been updated.

And PaperUI:

Analog Output looks good, but bridge is still offline

Thanks
Petr

Hi @Petos,

Ok. The problem is, that your Logo can not be connected. Analog output will not work without valid Logo connection. Means the bridge must be online. Can you connect LOGO! with LOGO!Soft comfort?

Is LOGO! connection configured?

More information can be found here: http://snap7.sourceforge.net/logo.html

Please check your localTSAP/remoteTSAP settings:

Is there something in TRACE - Log?

Kind regards,

Alexander

PS: Sorry about screenshots in german, i’ve no english version.

Hi @falkena,
Logo works good and I can connect. I had working config via discovery, but i need more (grouping, rename things and items) and i trying to config Logo manualy.
Kind Regards
Petr

Hi @Petos,

ok. Then be sure, please, that discovered Logo bridge is not in things list anymore. You can not access to the same LOGO! via two bridges.

Kind regards,

Alexander

Hi @falkena,
i understand. I cleared every items and things via PaperUI and started to use config files. Can i check if i deleted it all?
I used Karaf for clear.
Kind Regards
Petr

Hi @falkena,
i cleared all. Sitemaps, Items and things. Files and via Karaf too. Next i reboot whole RPI. First i did copy Logo.things.

Bridge plclogo:device:Logo1 [ address="192.168.0.160", family="0BA8", localTSAP="0x0300", remoteTSAP="0x0200", refresh=200 ]
	{
	Thing analog Hladina_NA [ block="AM1" ]
	Thing analog Hladina_KS [ block="AM2" ]
	Thing analog Hladina_VS [ block="AM3" ]
	}

And still it doesn`t works good.

2017-05-19 08:41:22.217 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'Logo.things'
2017-05-19 08:41:22.228 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'Logo.things' is either empty or cannot be parsed correctly!
2017-05-19 08:41:22.257 [ERROR] [.core.internal.folder.FolderObserver] - Error handling update of file '/etc/openhab2/things/Logo.things': null.
java.lang.NullPointerException
	at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.getAllThingUIDs(GenericThingProvider.java:929)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
	at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.modelChanged(GenericThingProvider.java:884)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
	at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:207)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
	at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:120)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
	at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.checkFile(FolderObserver.java:272)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
	at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.access$1(FolderObserver.java:265)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
	at org.eclipse.smarthome.model.core.internal.folder.FolderObserver$WatchQueueReader.processWatchEvent(FolderObserver.java:146)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
	at org.eclipse.smarthome.core.service.AbstractWatchQueueReader.run(AbstractWatchQueueReader.java:122)[98:org.eclipse.smarthome.core:0.9.0.b4]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
2017-05-19 08:41:22.283 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Logo.things'
2017-05-19 08:41:22.357 [INFO ] [ing.plclogo.handler.PLCBridgeHandler] - Destroy RTC job for 192.168.0.160.

BR
Petr

Hi @Petos,

huch, its an error from eclipse smarthome. Have you tried to restart openHAB?
May be there are troubles with upper case letter in filename.

Kind Regards,

Alexander.