Hi All,
Find below a proposal for light-switching with Logo’s comfort-switch. Very deterministic, because no proxy-switch, no pulse, simple rule.
I have created a new comfort-switch (UDF) - may could be optimised. The principle is that parallel operation of a physical wall-switch and a NI (network input) shall be possible. NI is an on/off switch (can be triggered by openHAB, displays the light’s status and follows the light’s Q per rule)
Cases:
- classical switching on/off Q from wall-switch (permanent or with auto-off)
- on/off switching Q from NI network-switch (permanent)
- switching on Q from wall-switch by a long press, switching off by NI
- switching on Q from NI, switching off by wall-switch
@falkena
Problem with 3: when light Q is switched permanently ON by wall-switch, openHAB’s NI follows, but switching NI off does not work (requires NI to go off, then on, then off). All logged fine. In other words, NI going off does not trigger Logo Q to go off.
Problem with 4: when light Q is switched permanently ON by NI, Q can be switched of by wall-switch. But cannot be switched on again by wall-switch
This works fine in the Logo simulation.
Find the UDF here (rename pdf to zip): OH_Logo_Comfort-Switch.pdf (35.5 KB)
Things
Bridge plclogo:device:Logo7 "Logo7 PLC" [ address="192.168.xxx.yyy", family="0BA7", localTSAP="0x0200", remoteTSAP="0x0200", refresh=1000 ]
{
Thing digital Inputs "Logo7 Inputs" [ kind="I" ]
Thing digital Outputs "Logo7 Outputs" [ kind="Q" ]
Thing memory VB100_4 [ block="VB100.4", observe="NI5" ] // Light
}
Items
Switch Logo7_Q8 "Q8" { channel="plclogo:digital:Logo7:Outputs:Q8" }
Switch Logo7_NI5 "NI5 Licht Wohnen L" <light> { channel="plclogo:memory:Logo7:VB100_4:state" }// Light
Anything wrong, how I turned a ‘memory’ into a ‘switch’? (there is no NI for Logo 0BA7 / state vs. observed?).
Sitemap
sitemap default label="Haus" {
Frame label="Light Switch" {
Switch item=Logo7_NI5 mappings=[OFF="AUS", ON="EIN"] // Light
}
}
Rules (super simple, no proxy-switch required!!)
rule "Switch Light Wohnen L Logo"
when
Item Logo7_Q8 changed // light changed
then
Logo7_NI5.postUpdate(Logo7_Q8.state) // NI always follows Q
end
rule "Startup"
when
System started
then
logInfo("StartUp", "System startup: Logo states flushed into proxy switches")
Logo7_NI5.postUpdate(Logo7_Q8.state) // update the state at startup
end
NI is written twice in some cases: NI manually switched off, Q goes of, NI follows to off (again). Problem?