Add a binding manually (Simatic)- A step is missing

  • Platform information:
    • Hardware: Raspberry pi 3b
    • openHAB version: 2.4

Hi all,

I work on the communication between OH2 and a siemens plc (S7-1200).
I found a binding module:
https://github.com/docbender/openHAB-Simatic

I downloaded the compiled binding: org.openhab.binding.simatic-1.9.0-SNAPSHOT.jar
I uploaded the file in “share/openhab2-addons” folder.
I established a ssh connection with the raspberry.
The file is located at the following path: /usr/share/openhab2/addons

In PaperUI/Configurations/Bindings, it’s empty.
In PaperUI/Add-ons/Bindings, i don’t found the new binding

Should i add something in the file “addons.cfg” (/etc/openhab2/services/addons.cfg)?

Feel free to ask more details.
Thank you for your help.

Others will jump in in a minute but right off it seems you have got the .jar file in the right place. I do not think you need to add anything to addons.cfg (but I could be wrong)
have you tried restarting OpenHAB?

Thank for your help.
Yes i tried… a lot of time.

Unfortunately, no modification.

Giovanni
I just went to Git and checked out your binding. It is a OpenHAB 1 binding I think.
it should still work but you may need look for it in legacy bindings in PaperUI or something

I use the modbus binding to communicate with my S7-1200 PLC. That’s an alternative route If you can’t get this to work.

I already enabled the legacy 1.X bindings option. But without result … :confused:

gitMiguel: I tested pymodbus as server. It works but i encounter problem with data persistance.
If i used the plc as server, we can use only holding register.
That the reason why i try a direct communication between OH2 et S7

The repo in your link contains another link to the bindings wiki page. There you can find configuration examples for this 1.x binding.

What do you mean only holding registers and data persistence problems?

This is the solution in order to establish the communication:
Installation of binding:
Install description provide by docbender

While the openHAB distribution already contains many add-ons of openHAB 1, there are still quite some of them missing - please help testing them - if they are confirmed to be working, they can be included in the distribution. Test a not included add-on is very straight forward:

1 - Start your runtime
2 - Install the 1.x compatibility layer by running feature:install openhab-runtime-compat1x in the openHAB console
3 - As with openHAB 1.x, simply take the jar file of your add-on(org.openhab.binding.simatic-1.9.0-SNAPSHOT.jar) and place it in the ${openhab.home}/addons folder.
4 - Copy your personal openhab.cfg file to ${openhab.home}/conf/services/openhab.cfg
5 - Restart

openhab.cfg
Create a file openhab.cfg in openHAB-conf/services

################################### Simatic Binding ######################################
#
# plc - define tagret PLC by IP address, cpu rack and slot. Definition look IP:rack.slot (ex.: 192.168.254.36:0.2).
# Above that communication type can be optionally specify at the end separate by semicolon.
# Supported communication types : PG, OP, S7 and 200 (S7-200 connection).
# It is possible defined more PLCs ex. plc, plc1, plc315,...
#
# refresh - check for new data interval - default 1000ms
#
simatic:refresh=2000
simatic:plc=192.168.100.5:0.1

IP: 192.168.100.5
Rack: 0
Cpu position: 1 (S7-1200/S71500: 1 ; S7-300: 2)

In the plc (S7-1XXX), verify that the following option is check in the “hardware config”/Protection & Security:

Permit access with PUT/GET communication from remote partner

In the log, you can verify that the communication is established.

Thank you for your help