Lights Control Hardware (PLC)

Hi Community!

I need some help in choosing hardware. Probably PLC but I’m not sure.

Here is my problem.
I have some loads - let’s say mostly lights. And I have different switches. I need to control lights with different types of switches (or with different behavior of switches):

  • with regular fixed ON/OFF wall light switch - turn on associated Light when switch is ON, turn OFF when switch is OFF
  • with regular fixed ON/OFF wall light switch - but in this case invert associated Light power state on every change of switch state (like in hotels)
  • with push button (not fixed) switch - invert associated Light power state on every button press. Most common way used for “smart” light systems.

Also this hardware needs to communicate and be controlled by OpenHab (via Modbus/TCP/Rest/etc) and support these options:

  • turn ON/OF load
  • get state of any Light channel: ON or OFF
  • get state / receive events of any switch: ON, OFF, long press (where applied), etc
  • (optionally) temporaly disable any of switches - so its associated Light channel can be controlled only remotely.

So in general logic is pretty simple - just ON/OFF Lights in different ways. See example:

I already have done all required wiring so this is not a problem. All cables go into one place.

Very preferably: programming software should work on Linux (I don’t have Windows/Mac).

I understand that all these requiretmens can be easy satisfied with home made hardware solution (Arduino or Raspberry Pi and bunch of relays) but I’m looking for something ready to use. So I will need only to program it without any soldering.

Maybe somebody can give me at least some examples of such hardware.

Thank you in advance!

P.S.
For a long time I’ve been using some Modbus controller for controlling lights in part of my system. It works only with push (not fixed) buttons and cannot be programmed. It does its job but I’m looking for something more flexible.

I can’t recommend anything but why does all of this logic have to be coded in the device? All of these behaviors are easily handled using openHAB Rules.

It have to be on device in order to work without OpenHab. I.e. basic functionality of light switches must work without OpenHab.

Of course some extended logic like “trigger some scene with long press” should be definitely implemented on OpenHab. But in order to implement it I need this controller send me event when “long press” happens (just an example).

As I said I’m already using some simple Modbus controller. It changes Relay (Light) state by pressing Push button. And also it allows to change the same Light state via Modbus. This controller works all the time and doesn’t depends on OpenHab. Problems with this controller:

  • it doesn’t allow to detect “long presses”
  • it doesn’t allow temporary disable some switch
  • it doesn’t work with regular fixed (mechanical or bi-stable) switches and I don’t want to change these switches to push buttons
  • it cannot be reconfigured/programmed in order to implement something new
  • etc.

As far as I understand something like Siemens LOGO! is what I need but I’m not sure. And it is too expensive to buy it in order just to play.

I do think somebody already uses some solutions and may share experience.

I don’t know how you have it wired but many of us just use smart switches at the wall plate. There ore options from all sorts of different technologies including zwave, zigbee, wifi, and various wired options like KNX and of course PLC (I’m assuming you mean power line communication) like X10.

Some of these offer the ability to install the “smart” device behind the “dumb” wall switch so you don’t even have to worry about matching the rest of your switches. In all cases though, should OH go down, they still operate as “dumb” switches.

Thank you for answer @rlkoshak!

Here by PLC I mean Programmable Logic Controller. I know about option when you install “smart” switch behind existing “dumb” wall switch. But here I’m looking for different option.

My already existing lights wiring organized in star topology. Which means that I have separate wires for every switch and every lamp. And all these wires are going to one single place - electricity cabinet. So in this electricity cabinet I have wires from all my switches and lights.

That is why I’m looking for some device which will be placed in my electricity cabinet, will control all lights from single place, will satisfy requiretments from my first message in this post and of course will communicate with OpenHab.

BTW, after some research I found device which fits (I think) my requiretmens: M-DUINO PLC Arduino Ethernet 58 I/Os Analog/Digital PLUS.
But still I’m very interested in experience of other people from OpenHab Community. Maybe there are better/cheaper/simpler options.

Hi!
I am using Fatek PLC with extension modules and an Ethernet card (72 outputs and inputs, Modbus and Fatek protocol via UDP). All switches are monostable, bistable are useless in this case. I have a CAT5 ethernet cable in every switch socket.
All long clicks, two clicks etc. are programmed in the PLC, some timers also. openHAB integrates the Satel alarm, DMX, Xiaomi bulbs, temp/humidity sensors and activates several rules related to the astronomical clock, presence and so on. So if I do something in openHAB the basic functions works, all lights, roller shutters.
Wireless technologies are in some cases like pain in the back :slight_smile: for example, thick silicate walls, reinforced concrete ceiling. So I prefer to rely on cables.
One more thing big advantage of PLC is its stability.

1 Like

Hi!

I am also searching for this kind of solution with an star topologiy of wiring. But as i have to do it room by room in my Home i havent startet jet. My preferences are in principle the same espasicaly:

I will use the Siemens LOGO becaus of the name Brand and long term support.
A non name brand solution that i looked into is Denkovi Ethernet Relay boards and smartDEN IP Modules. There are also Application Notes for OpenHab.

In Comparison:
Simens Logo ~416€
24 Di
20 Do

Denkovi 1x (PLC) 1x (Relay Module) 1x (32 Input Module) ~429€
24 Di
24 Do
12 Ai
2 Ao
12 NTC

I would say Siemens ist the better option because of the name brand. But if you could use the extra inputs an outputs Denkovi might be interesting.

I would maybe do my Rollershutters with Denkovi because it is not mission critical.

Kind Regards
Markus

PS. sorry for my bad english i am from Germany

1 Like

you can look at Siemens as well . S7-200 (PLC) or even the Logo! (Logical Programebel Relay)

And the Logo! has a binding for OpenHab .
Depends how deep your logic needs to be on the Controller ?

1 Like

My approach to this has been to keep the hardware as stupid as possible, while allowing openHAB to “add the automation” on top.

My choices influenced by covering a commercial warehouse - large area, multiple “central” control boxes, avoid wireless tech - not the same as a home.

No PLCs. Simple pulse (step) relays at the central box, which allow standalone operation from multiple direct wired wall switches.
Cheap Modbus digital I/O units allow openHAB to monitor and control the relays.
Also take inputs from cheap wired PIRs.

It would have to be rather different if I needed dimmer functions though. Design choices there would be driven by what dimmer control tech was available at the right price. I suspect i would look at KNX.

1 Like

I use mostly MOSBUS devices like ADAM6050 for this. They have own logic, which I do not use, and can be controlled by OH

1 Like

Hi

I use a Schneider electric PLC to do exactly what you want.

I’m in my phone now, I can send more information later.

See this old thread:

João

1 Like

Not exactly what I’m looking for but still interesting.

@rossko57 can you please tell what pulse relays (vendor/model) you use? And how do you controll them?
In order to trigger state of pulse relay you need to close its control conacts for short period of time. But if pusle relay control contacs use 110V/220V then I guess you need another relay in order to triger it. :slight_smile: Is it correct?

Yes, that’s the safest way.

mains Pulse relay for DIN rail cabinet
https://zamel.com/en-GB/products/exta-building-automation/bistable-impulse-relays/pbm01
although you could use a two-pole unit to allow signalling back to openHAB.

modbus unit, light duty relay contacts used as “pushbutton” for pulse relay

This is for a commercial site, not a home, 10A capacity is used - clonky is Good :smiley:

1 Like

Hi all

I am trying to use a set of Fatek PLC FBs with rj45 CBE modules to control my home.
I am not a ladder expert and right now i manage to perform single clicks to toggle relays for lights On/OFF and long press on pushbuttons to control blinds ( while press it operates).
I wonder if you can help me with some ladder examples on:

  • how to detect single and dual clicks from a pushbutton (to toggle lamp1 or lamp2 depending on if I perform a single click (lamp1) or a dual click (lamp2)
  • how to detect continuous click or dual click from a pushbutton to control blinds (continuous click will make blind up/down while pressing - i have separate buttons for up and down directions - dual click will trigger a timmer controlled output to completely raise or lower the blind without the need to maintain the button pressed.
    I also have a more difficult question: how to connect the plcs through ethernet cable (i imagine that it is possible to send input reactions from one plc to output actions on another plc…but don’t know how).
    Any help (ladder examples, briefs explanations , etc) would be welcomed.
    Thanks
    Rui

Hi Rui!
Here fatek.zip You will find two examples of ladder, how to use Fatek with OH for lights. Second one is simplest version. It’s mono and bistable switch. Mono is physical switch, bi is for OH. I made appropriate comments in Fatek lader. Sorry now i’m lack of time, latter I will try to make more example what you ask for. It’s a little bit complicated because procedures in ladder are scattered and without comments when saved to plc.
Here is how to connect PLC to PLC
http://www.fatek.com/en/data/ftp/PLC/FBs_Manual/Manual_2/Chapter_12.pdf
Can i ask why you want to send data between two PLCs instead of using extension modules?
Regards
Rafal

Hi Rafal,

thank you very much for your assistance. I will look at the files you sent me.
Even if you have ladder examples without comments I can try to figure out the algorithm behind it.

The reason why I use several plcs is that I have different control locations inside the house. For example, I have an electrical cabinet for each floor (basement, main floor, and 1st floor), and a control cabinet attached to each electrical cabinet (so, in this case, I have 3 plcs - each one with an extension module or 2). In most cases, we could consider that the control could be independent for each floor but there are some situations where the pushbutton is on one floor and the light is in another, for example in stairs. That’s why I need to create some kind of bridge among all the plcs that are distributed along the house (in my case I have 7 different locations).

Hi Rui!
Sorry for delay, I was out. Here is a complete PLC Ladder with lights, shades, sprinkler and Modbus communications with LED dimmers.
1.pdw
In this ladder you can find how to 1,2 and long click
2.pdw
Shades are controlled by two relays. First turns on/off power, second one angle/direction.

Hi all,

i´ve a simmilar construction with adam 6052…
My boxes run in GCL-Mode and talk to eachother. I would like to use the internal Vlag like a virtual pushbutton but i´m just able to switch the internal Flag to “true” but it don´t switches of again.

Does anyone has an Idea?

Here is my config:

Box1
image
Box2 Rule1
AdamBox2Rule1
Box2 Rule 2
AdamBox2Rule2
Box2 Rule 3
AdamBox2Rule3
Modbus adress AdamVlag
AdamBoxmodBus

Wohnhaus01.things.txt (1.5 KB)

This doesn’t really have much to do with the rest of thread.

You do not say, but from your Things definition -

Bridge modbus:tcp:Wohnhaus01 [ host="192.168.0.152", port=502, id=1 ] {
    
    Bridge poller thing [ start=304, length=1, refresh=500, type="holding" ]
    {
        Thing data do01 [  readTransform="01.0", readStart="304", readValueType="int16", writeTransform="01.0", writeStart="304", writeValueType="int64_swap", writeType="holding", writeMultipleEvenWithSingleRegisterOrCoil="false" ]
...

perhaps you are trying to read or write from individual bits in a register?? I can’t tell. Can you explain in simple terms what you are trying to read and write from openHAB?

This looks odd
writeValueType="int64_swap"
because it will write 4 16-bit registers in one go.

The addressing 40301, 40303 in the little table you show us (from Adam docs?) suggest the Adam works in 32-bit mode.

This is unusual
readTransform="01.0",
what is it that you expect this to do? It will force every read poll to a value of 1

Hi rossko57,

thank you for your fast response!

Let me try to explain what i have done more precised…

My Adamboxes run in GLC mode and are networked to eachother. we have a little farm with 3 Buildings and the only connction i have had was network. I need to switch lights and other applications from all 3 buildings. I used the inputs of those boxes for my lightbuttons and send the inputs via network to the other boxes. Ihave tried to figure it a little bit more presize:

My Plan is now to make my farm a little bit smarter and i would like to begin with openHab.
I thought i could use these Vlags from the adamboxes as a “switch/button” in openHab…

You are absolutly right by saying its 32bit and thats what i´ve tried first but the result was the same…
…i can switch the Vlag on but it doesn´t switch off :frowning:

Here i did some screenshoots from a modBus-tool where i´m able to switch them on and off:

Swich Vlag1 to on:

Read status of that:

Swich Vlag1 to of:

Read status of that:

that means:

Vlag00 is 0000000000000001
Vlag01 is 0000000000000010
Vlag03 is 0000000000000100
Vlag04 is 0000000000001000
Vlag05 is 0000000000010000
Vlag06 is 0000000000100000
Vlag07 is 0000000001000000
Vlag08 is 0000000010000000
Vlag09 is 0000000100000000
Vlag10 is 0000001000000000
Vlag11 is 0000010000000000
Vlag12 is 0000100000000000
Vlag13 is 0001000000000000
Vlag14 is 0010000000000000
Vlag15 is 0100000000000000