Integrate Siemens Logo (plclogo) in OpenHAB 2

openhab2
binding
siemens
Tags: #<Tag:0x00007fe057f5ac78> #<Tag:0x00007fe057f5a9d0> #<Tag:0x00007fe057f5a840>

(Jacek Tomasiak) #103

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


(Jacek Tomasiak) #104

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.


(Jacek Tomasiak) #105

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?


(Jacek Tomasiak) #106

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


(Alexander Falkenstern) #107

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


(Jacek Tomasiak) #108

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


(Jacek Tomasiak) #109

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


(Alexander Falkenstern) #110

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


(Jacek Tomasiak) #111

Fix #1 confirmed to work fine. Thanks!


(Jacek Tomasiak) #112

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


(Alexander Falkenstern) #113

Hi @skazi,

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

Kind regards,

Alexander


(Petos) #114

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…


(Alexander Falkenstern) #115

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


(Petos) #116

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


(Alexander Falkenstern) #117

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.


(Petos) #118

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


(Alexander Falkenstern) #119

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


(Petos) #120

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


(Petos) #121

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


(Alexander Falkenstern) #122

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.