It would be nice to implement OPC A Client in OpenHAB - e.g. ability to connect to OPC UA Server.
This quite well supported modern communication protocol, used in automation PLCs, which are getting more and more used in home automation. OPC UA supported by many leading PLC vendors like Beckhof, Wago, Siemens, Codesys-based etc.
Previously only Modbus TCP could be used to communicate with those, but this 20 years old protocol is quite obsolete for IoT use - e.g. it is not so easy to configure, requires polling, limited data types etc. OPC UA can replace Modbus TCP in such cases easily.
I am far (and I mean really far) from being an expert on Node.js, but I wonder if it is really appropriate to use this in the context of an openHAB binding?
The following link seems to be a really good place to start in terms of open-source and OPC UA:
This implementation, however, is in C. This could maybe be used through the means of JNI, but again; I am not sure if this is appropriate for a binding.
The one that āsticks outā is opc-ua-sdk with its ua-client-sdk implented in pure Java.
I am not sure about the license, though:
The digitalpetri OPC-UA Client SDK is licensed under the GNU Affero General Public License v3 (AGPL-3.0).
Commercial-friendly licensing may be purchased.
It is quite relevant as MQTT does not get you even close to what you in theory could do with OPC UA. Not that I am a big fan of it, but lets face the truth, you canāt do much with MQTT without getting burred into fairly complex configuration management. You have to decide how to name topics, what structures you send and how you command other end. All this is granted for UA plus support for grouping and discovery of symbols held by PLC. Surely you can do it with conventions such homie and sparkplug but this requires the PLC program author to follow these specs. I can guarantee you that most of them will not bother about these unless there is ready to use library which makes integration for them easier. Even if such library would existed, quite often it could involve extra licensing fees. Auite a lot libraries bought from PLC manufacturers require to pay extra for IP based communications.
Personally, speaking about single PLC installation, if Iād have to choice to pay 50⬠for OPC UA license or no fee for MQTT Iād pick earlier one and save on labor costs. If youād ask me same question about 50 or more devices then Iād start considering MQTT only if these 50 devices would rely on the same program.
@davidtorres I have a plan to put a proof of concept binding within coming weeks. Stay tuned.
Well, I found that MQTT event bus binding does this job quite well, so that you get already quite structurized naming conventions for topics and a list of all your things, which you can directly use in PLC. Thatās why I was so upset, when this became a low priority topic for developers migrating to OH 2.X.
Anyway I agree that OPC UA might be an interesting topic, so pls go on with PoC.
As long as OPC UA is not available as binding you can use Node-Red as gateway between openhab and OPC UA using the OPC UA and openhab contribution to connect OPC UA tag to openhab items and vice versa.