Hi,
New to OpenHab and I am really liking the concept of having something like this in my house.
Before I begin deep diving into it. Will this work with PLCs?
Some posts on Reddit said yes while others said no.
I came across a github add-on that I cannot find on the website. GitHub - docbender/openHAB-Simatic: openHAB binding for Siemens Simatic S7 PLC.
From the few hours I spent on research, it seems possible.
So it would be nice to know 100% before putting ton of time into it.
I have a S7-1200 and S7-1500 PLC at home. Which already controls a few different items (Lights, Sensors, Temp, Etc).
My goal would be to make it remote with the OpenHab Mobile App Reading and writing data to the PLC + the HMIs that locally control a few more things.
I know I will probably need to setup a VPN (PfSense) or something equivalent for remote access to the PLC.
But would OpenHab be able to read and write data to the PLC?
If Yes, What would the tag structure look like on OpenHab, If I have a Motor Run command is on %M0.0 (PLC tag)
If there is a binding for it and the binding is updated to run with the current version of OH then yes, it will work.
However, keep in mind that as I understand it PLCs work very different from OH in many different ways so there will need to be a good deal of translation between what something in the PLC means and what it does and how it does it to the model of Things, Items and Rule in openHAB. I’ve seen many on the forum struggle with this translation.
I mean, if you already have pfSense that’s great! But if not, that’s way overkill just to have a VPN. With tailscale (for example) it’s just a couple of commands to set up and join a VPN network. I might also recommend opnSense over pfSense too. Netgate is kind of skeezy as a company.
Or just use myopenhab.org. No VPN required and it’s a free service.
This is kind of what I’m talking about. OH doesn’t have a tag structure. It’s not a PLC and it’s not going to expose stuff in a PLC way. OH has the concept of Things which represent a device. All the technology specific stuff (i.e. PLC stuff) gets captured there. Things have Channels. A Channel represents a single sensor value or actuator. Items get linked to Channels. Items are a normalization layer. A Switch is a Switch whether it’s linked to a PLC Channel or a Zwave Channel.
Everything else in OH operates on Items.
For details on what a PLC Thing might look like and how it might map PLC stuff to Channels see PLCLogo - Bindings | openHAB.
That specific binding you link to is on the Marketplace so you can install that through the Add-on store in MainUI. There isn’t much documentation though.
First off I would like to say thank you! Quick response and very detailed.
I would have to take a look at how the translation work and see if its worth the time.
Not sure what you mean by channels or items, I am assuming how the data/bits are stored on OH?
Regarding the VPN, I already have PfSense set up at home. Never heard any one call Netgate “Skeezy”. Shouldn’t be a big deal to switch to OpnSense.
Any particular reason why you think they are “Skeezy”?
See the Concepts section of the OH docs. It outlines all these concepts and what they mean.
Besides being almost abusive on their forum (which I was the recipient of on one occasion):
close sourcing all new development (similar to what Mongo DB, Elastic, and most recently Redis did)
there’s this (tl;dr Netgear bought opnsence.com and posted some pretty low rent attacks denigrating and making fun of the fork). It’s not a good look. There were also similar shenanigans on Reddit grabbing /r/opnsense and kicking them out of the subreddit and stuff like that.
After the whole Wireguard feasko and the closed source announcement I switched to opnSense and am glad I did. It looks better, is easier to set up, development continues apace, there’s no drama, and their forum is friendly and helpful.
Hi.
This is the solution I’m using for a few years now. The only (and important) difference is that I use a Schneider Electric PLC so I use the ModBus binding. OpenHab reads and writes the registers (MW) so I can control all my ligths, windows, etc, from OpenHab. Everything connected to the PLC is a Thing on OpenHab and I can use the Items created in rules.
I do have some programing running on the PLC so most of my house works normally without OpenHab (the switch near the door and the room light are conected to the PLC, so if I press the switch the lamp turns ON by the PLC. I can control the same light on OpenHab, as the lamp is a Thing - and an Item - in OpenHab)
As said if there’s a binding yes you can control PLCs from openHAB. It’s either a PLC specific binding or one of the generic ones like Modbus and HTTP that you can tailor to fit your need.
You will be finding one that fits your device in most cases. Modbus usually will work.
The issue with integrating PLCs is looming elsewhere, though.
PLCs, by their concept and nature, are controllers themselves like is openHAB.
They’re not meant to and often not built to be controlled by someone else.
They’re the local king. While they could be programmed to act as slave controllers on receiving instructions from the master (openHAB), they are not in most cases.
But you will not be starting on the green field but bring in a use case where a PLC has been implementing the control logic, already being the master of some local application.
Now you change paradigm and introduce an emperor (openHAB) and tell the king to transfer his power (the logic it’s executing) or at least part of that over to him.
Just like in politics, that results in quite some distortions you will have to resolve in order to finally hopefully arrive at a working home automation system that’s working reliably and flawlessly end-to-end.
So prepare to put substantial work into analysis and rework of your PLC programs and logic.