Integrate Siemens Logo (plclogo) in OpenHAB 2

openhab2
binding
siemens
Tags: #<Tag:0x00007f51e0043880> #<Tag:0x00007f51e0043588> #<Tag:0x00007f51e00433a8>

(Jacek Tomasiak) #154

Hi,

What happened to the “pulse” feature?

BR,
Jacek


(Alexander Falkenstern) #155

Hi @skazi,

must be ported and debugged: It worked not properly.

Kind regards,

Alexander.


(Andre Kaiser) #156

I am new to openhab2 and try to configure my openhab2 by examples.
I have 2 0ba8 for my shutters. Can someone help me with examples of his working configuratiuon.
I use the composition with zPos variant on my logo.My two logos are already online in the PaperUI,
but the configuration of the inputs and outputs is on UNINITIALIZED - HANDLER_CONFIGURATION_PENDING.
I used the example from the documentation and adapted it to my situation.

Thanks.
Andre


(Alexander Falkenstern) #157

Hi @Dreamar,

According to error message, some required parameter are missing or have invalid format. It’s a little bit hard to provide more information about error without your configuration. If you send configuration, at least *.things file, as well binding version via PM, i’ll try to figure out what the problem is.

Kind regrads,

Alexander


(Alexander Falkenstern) #158

Hello everybody,

me again :slight_smile:

Just uploaded new version to https://github.com/falkena/binaries. Small Change-Log:

  1. Reintegrate Pulse-Thing
  2. Remove some old code
  3. Fix some possible NPE’s

Kind regards and happy new year,

Alexander


(Jacek Tomasiak) #159

Thanks @falkena!

The pulse thing enabled me to replace this:

// things
Thing  digital Outputs [ kind="Q" ]
Thing  memory  VB0_2   [ block="VB0.2" ]
// items
Switch  Relay3    "Relay#3"   (LOGO1)  { channel="plclogo:digital:PLC01:Outputs:Q4" }
Switch  PLC01_NI2 "PLC01_NI2" (LOGO1)  { channel="plclogo:memory:PLC01:VB0_2:state" }
Switch  VButton2  "VButton2"  (LOGO1)
// rules
rule "forward VButton2 command to logo NI"
when
    Item VButton2 received command
then
    // short pulse
    sendCommand(PLC01_NI2, ON)
    sendCommand(PLC01_NI2, OFF)
end

rule "update VButton2 from logo relay"
when
    Item Relay3 received update
then
    postUpdate(VButton2, Relay3.state)
end

with this:

// things
Thing  digital Outputs [ kind="Q" ]
Thing  pulse   VB0_1   [ block="VB0.1", pulse=100 ]
// items
Switch  Relay1    "Relay#1"   (LOGO1)  { channel="plclogo:digital:PLC01:Outputs:Q2" }
Switch  PLC01_NI1 "PLC01_NI1" (LOGO1)  { channel="plclogo:pulse:PLC01:VB0_1:state" }
// rules
rule "forward Relay1 command to logo NI1"
when
    Item Relay1 received command
then
    sendCommand(PLC01_NI1, ON) // short pulse
end

to make my light switches work as I expect (physical click on the wall and virtual click in habpanel).

Best Regards and happy new year to you too!
Jacek

PS. I know that the base version was overcomplicated but still… the pulse thing made me re-think this and get a simpler solution.


(Alexander Falkenstern) #160

Hi @skazi,

cool :slight_smile: One thing i didn’t catch:
Has sendCommand(PLC01_NI1, ON) any effect on Logo? I failed to set network inputs on Logo this way:
I simply connected NI1 and NI2 to RS-trigger and took a look into online simulation in LogoSoft. Trigger had not changed it state. Should be there any special mapping for NI-blocks in LogoSoftComfort?

Greetings,

Alexander


(Jacek Tomasiak) #161

Hi @falkena,

Works fine for me with following setup:
Zrzut ekranu z 2018-01-11 14-26-56

How would you trigger the pulse if not by sendCommand(PLC01_NI1, ON)?

I had one case where the things would not react as they should but restarting openhab solved it. I was testing different approaches and I think I changed too many things too quickly so openhab was not able to properly re-wire all pieces.

BR,
Jacek


(Alexander Falkenstern) #162

Hi @skazi,

Grrr… I didn’t match your items to things properly yesterday: PLC01_NI1 modifies the address VB0.1 and not memory address of NI1 directly. This way it works. I hoped, that you found a way to write the NI1 address directly without additional mapping to “normal” memory. Seems, that NI-Blocks memory range is read-only. Strange is, that directly write to marker (M-Blocks) memory range works…

Thanks :slight_smile:

Kind regards,

Alexander


(Norbert) #163

Hi everybody,

I am very new to openhab2 and trying to configure my Siemens Logo 0BA8 FS4 by examples and searching for documentation. I installed the latest plc binding (2.3.0.201801051407) and according to karaf it is active.
My problem:
I would like to configure things for input and output:

Bridge plclogo:device:Logo1 [ address=“10.10.126.222”, family=“0BA8”, localTSAP=“0x0100”, remoteTSAP=“0x0200”, refresh=500 ]
{
Thing digital Q1 [ block=“Q1” ]
Thing digital Q2 [ block=“Q2” ]
Thing pulse I11 [ block=“I11”, pulse=100 ]
}

The output things seem to work, but the log file (openhab.log) complains

2018-01-14 16:39:18.687 [WARN ] [ding.plclogo.handler.PLCPulseHandler] - Invalid channel plclogo:pulse:Logo1:I11:observed found.
2018-01-14 16:39:19.201 [WARN ] [ding.plclogo.handler.PLCPulseHandler] - Wrong configurated LOGO! block I11 found.

Do I have to use Network Inputs with that V01.1 alias VB01.1 stuff I do not really understand yet.

What am I doing wrong? Any help appreciated.

Kind regards

Norbert


(Jacek Tomasiak) #164

Hi @bastelmal,

“I” blocks are physical inputs, you can’t change their state using software. Take a look at my examples just ~4 posts above. You have to use “NI” blocks with “VB” addresses assigned and access them via “VB” blocks in openhab.

Regards,
Jacek


(Norbert) #165

Thanks @skazi,
there are still many questions but my first rule works.
Regards

Norbert


(Michael) #166

Hello Alexander,

Thanks a lot for your binding! Too bad I wasted all the ours writing my own “binding” with the help of snap7 and the exec-binding. I wish I had discovered this earlier! This latest snapshot works great from me with a LOGO8!

Is there a change that Rollershutter items will be supported in the future for pulse channels?
Is there a good reason why this binding is not officialy supported as an openHAB binding?

Best regards
Michael


(Alexander Falkenstern) #167

Hi Michael,

We need extension for pulse - things to support rollershutters. Reason: There are at least 2 pulses need. One for “Up” and one for “Down”. But the most “problem” i have is Percent: Have no idea, how to implement it properly.
Details are here: https://docs.openhab.org/configuration/items.html If i get idea how to model “percent” properly and find time, i’ll implement it. About reason: I have open PR in openhab2-addons repository. I think, it’s only the question of time, when it will be merged.

Kind regards,

Alexander


(Michael) #168

Hi Alexander,

Yes, the problem here is that there is no longer a possibility to assign a channel (or someting similar) to an UP, STOP, or DOWN command. This was possible in openHAB 1.x but this functionality was not reimplemented. So even if the plclogo binding would understand “UP” and “DOWN”, it still would need to know where it comes from.
It is possible to assign 2 or more channels to an item. Maybe a way is to dedicate one channel with an additional keyword e.g. acceptcmd=“UP”. All other command will be ignored. If the keyword is not used, only “ON” and “OFF” will be accepted (as before).

  Thing pulse   BitMap1     [ block="VB100.0", acceptcmd="UP", pulse=250 ]
  Thing pulse   BitMap2     [ block="VB100.1", acceptcmd="DOWN", pulse=250 ]

The “observed” is not a must to be supported in this case in my opinion, since the return-channel can be easier implemented than the command-channel in combination with rollershutters (item). And the status value which you get from the PLC will unlikely be shown in percent. Thus it will always be necessary to write a rule to aquire the status information.
For the pulse-thing, a percent command is prett much useless, since you just want to change a bit…

Best regads,
Michael


(Stefan) #169

Hi There

I have an issue getting aconnection between OH2 (stable release 2.2.0) and an Logo 0ba8.
I installed the latest version (org.openhab.binding.plclogo-2.3.0-SNAPSHOT) of falkena’s binding (by downloading the *.jar from the “binaries” folder on github, and copying this to the */addons folder).
The binding is displayed as “running” in karaf console.

The log file shows continous warnings, and it seems to affect OH2’s performance (experienced delayed response on sitemaps). No action on the Logo! at all.

2018-02-11 14:58:11.100 [WARN ] [nding.plclogo.internal.PLCLogoClient] - Reconnect during read from 192.168.0.21: Data Receiving timeout.
2018-02-11 14:58:13.230 [WARN ] [nding.plclogo.internal.PLCLogoClient] - Reconnect during read from 192.168.0.21: Data Receiving timeout.
2018-02-11 14:58:15.362 [WARN ] [nding.plclogo.internal.PLCLogoClient] - Giving up reading from 192.168.0.21 after 10 retries.
2018-02-11 14:58:15.363 [WARN ] [ding.plclogo.handler.PLCPulseHandler] - Can not read data from LOGO!: Data Receiving timeout…

Here is my config
logo.things:

Bridge plclogo:device:LogoRemise [ address=“192.168.0.21”, family=“0BA8”, localTSAP=“0x3000”, remoteTSAP=“0x2000”, refresh=300 ]
{
Thing pulse VB2_0 [ block=“VB2.0”, pulse=400 ] //Taste Aussenfluter aus
Thing pulse VB2_4 [ block=“VB2.4”, pulse=400 ] //Taste Aussenfluter ein
// Thing pulse VB2_1 [ block=“VB2.1”, pulse=400 ] //Taste FluterHausNord aus (obsolete)
// Thing pulse VB2_5 [ block=“VB2.5”, pulse=400 ] //Taste FluterHausNord ein (obsolete)
Thing pulse VB2_2 [ block=“VB2.2”, pulse=400 ] //Taste Licht oben aus
Thing pulse VB2_6 [ block=“VB2.6”, pulse=400 ] //Taste Licht oben ein
Thing pulse VB2_3 [ block=“VB2.3”, pulse=400 ] //Taste Licht unten aus
Thing pulse VB2_7 [ block=“VB2.7”, pulse=400 ] //Taste Licht unten ein
Thing pulse VB3_0 [ block=“VB3.0”, pulse=400 ] //Taste starte Timer
Thing pulse VB3_1 [ block=“VB3.1”, pulse=400 ] //Taste stoppe Timer

Thing digital NetworkOutputs [ kind=“NQ” ] //NetworkOutputs
Thing digital Outputs [ kind=“Q” ] //Outputs
}
logo.items
Switch VS_FluterRemise_ein {channel=“plclogo:pulse:LogoRemise:VB2_4:state”}
Switch VS_FluterRemise_aus {channel=“plclogo:pulse:LogoRemise:VB2_0:state”}
Switch VS_LichtOgRemise_ein {channel=“plclogo:pulse:LogoRemise:VB2_6:state”}
Switch VS_LichtOgRemise_aus {channel=“plclogo:pulse:LogoRemise:VB2_2:state”}
Switch VS_LichtUgRemise_ein {channel=“plclogo:pulse:LogoRemise:VB2_7:state”}
Switch VS_LichtUgRemise_aus {channel=“plclogo:pulse:LogoRemise:VB2_3:state”}
Switch VS_ResetTimerRemise {channel=“plclogo:pulse:LogoRemise:VB3_1:state”}
Switch VS_StartTimerRemise {channel=“plclogo:pulse:LogoRemise:VB3_0:state”}

Switch VC_OUT_FluterRemise {channel=“plclogo:digital:LogoRemise:Outputs:Q1”}
Switch VC_OUT_LichtOgRemise {channel=“plclogo:digital:LogoRemise:Outputs:Q2”}
Switch VC_OUT_LichtUgRemise {channel=“plclogo:digital:LogoRemise:Outputs:Q3”}
Switch VC_OUT_TriggerFluterNord {channel=“plclogo:digital:LogoRemise:NetworkOutputs:NQ1”}
Switch VC_TimerRemise {channel=“plclogo:digital:LogoRemise:NetworkOutputs:NQ2”}

BTW: I had an older version of Falkenas binding (i think it was called V2.1. - October/November 2017) running on unstable releas OH2.2.x but thought it would be a good idea going to the stable release and latest version of this binding.

any idea what I’m doing wrong?
Thank you in advance!


(Stefan) #170

(deleted, wrong topic)


(Michael) #171

Hi Stefan,

I am running the same plclogo binding on this openHAB-2.2.0.010 version.

If you are able to ping your Logo, then it shouldn’t be far from being able to connect - except correct configuration.
I use this on 2 setups:

  • openHAB running on Windows (for development)
  • openHAB on a Synology NAS (final target)
    Both are running fine.
    I would recommend to comment out all things and see if this has any effects.
    Also, if you used ealier version, there might be a disturbing *.cfg file in the “services” folder.

(blu) #172

i have an issue, similar to the one “Dreamar” submitted earlier in this topic.
"2018-02-25 13:50:03.073 [hingStatusInfoChangedEvent] - ‘plclogo:analog:Logo:AM1’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_CONFIGURATION_PENDING)

RTC is working and connection to Logo seems to be fine. I tried many workarounds in the last days but nothing helped

logo.things

Bridge plclogo:device:Logo [ address=“192.168.2.203”, family=“0BA8”, localTSAP=“0x0300”, remoteTSAP=“0x0200”, refresh=100 ]
{
Thing digital VB0_0 [ block=“VB0.0” ]
Thing digital VB0_1 [ block=“VB0.1” ]
Thing digital NI1 [ block=“NI1” ]
Thing digital NI2 [ block=“NI2” ]
Thing analog AM1 [ block=“AM1” ]

}

logo.items
// NI1 is mapped to VB0.0 address in LOGO!Soft Comfort
// NI2 is mapped to VB0.1 address in LOGO!Soft Comfort
Switch LogoUp {channel=“plclogo:digital:Logo:VB0_0:state”}
Switch LogoDown {channel=“plclogo:digital:Logo:VB0_1:state”}
Contact LogoIsUp {channel=“plclogo:digital:Logo:NI1:state”}
Contact LogoIsDown {channel=“plclogo:digital:Logo:NI2:state”}
Number AM1Merker {channel=“plclogo:analog:Logo:AM1:value”}


(Michael) #173

A hint to a general issue:
Recently I moved to another identical (Linux based) platform, an a configuration which was running perfectly before didn’t on the new platform. The interesting thing was that it didn’t just work at all, but apprx. half of my inputs on the Logo didn’t work randomly.

Once again it turned out to be a file permission issue - due to the new openHAB installation which I installed sightly different than on the first identical platform. After fixing the permissios, everything was fine.