Switching on/off, checking status before sending on or off command

Everything is working right now, Rossko.

Thanks!

Hi Rafal,

I understand now! Good thinking!

I read on forums about SD card wear on raspberry Pi (mainly because of the logs that are written to the card continuously). A lot of people say their Pi (which runs 24/7 for OpenHAB) crashes after a couple of months up to for some people around year.
That’s why I decided to test what happens with the mono-stable virtual contact of OpenHAB when it crashes. To do so I put the contact on 1 and took off the power to the Pi. And it seems the contact stays 1.
So in circuit like this one:

I can’t turn of the lights any more until the Pi is repaired.
That’s why I decided make a PLC program that doesn’t care about the crashing of the Pi and that I can still use the physical buttons or the virtual button of another app.
Realized that like this:

where DB2.DBX0.1 is bi-stable from my other app. And where DB12.DBX0.0 is mono-stable of OpenHAB, this one goes from OFF to ON over a positive edge function making it change Q_TeleruptorLamps. And for ON to OFF over a negative edge function.
Worked perfectly but only problem is that I lost sync.
With this rule this problem is solved too:
rule “GF_Chickencoop_LightStatusChanged”

when
Item GF_chickencoop_LightStatusONOFF changed
then
if( GF_chickencoop_LightStatusONOFF.state == OPEN )
{ GF_chickencoop_LightONOFF.postUpdate(ON) }
else { GF_chickencoop_LightONOFF.postUpdate(OFF) }
end

I’m satisfied with this solution and think I’ll continu to use it.

Something else, Fatek is not use here in Belgium. How do you communicate with it? Modbus?

Thanks and regards,
Tom.

Hi Tom!

I read on forums about SD card wear on raspberry Pi (mainly because of the logs that are written to the card continuously). A lot of people say their Pi (which runs 24/7 for OpenHAB) crashes after a couple of months up to for some people around year.

Sometimes couple months, sometimes shorter. You get less worries with SSD or EMC,
I personally use UP board with EMC it’s Industrial grade SBC.

Something else, Fatek is not use here in Belgium. How do you communicate with it? Modbus?

I am not trying to convince you to Fatek:) You can easily adapt my code to Siemens LAD, there are also coils and contacts, one difference is TOGG but if you don’t have similar function in Siemens LAD, you can do it on coils and contacts, there are two lines more.
I Communicate with Fatek with native Fatek protocol via Fatek binding it is similar to modbus. I’m afraid that if you use dozens of inputs, the system will not respond too quickly.

Regards
Rafal