Problem Statement
Using the Comfort-Switch block in LOGO! How to switch such a Logo-output for lights or power outlets via openHAB and in parallel via a physical wall-switch which is directly connected to a LOGO! input? The status of the Logo-output shall be correctly monitored in openHAB.
Concept
A new Comfort-Switch block has been developed as UDF (User Defined Function). This has the known Trigger- and Reset-Input, but additionally a Set-Input (and a Switch-Input).
The Comfort-Switch’s Trigger-Input is used to toggle the LOGO! output (Q) from a wall-switch, which is physically connected to a LOGO! input (I). Via network input (NI) LOGO! receives commands from openHAB. The NI has the states ON|OFF (no pulse), is connected to the SW-Input and reflects the status of Q. In openHAB, the NI serves as UI-control (user-interaction) and status-display (visualisation).
Events originating from LOGO! (physical wall-switch pressed causing relay Q changes) must update the NI (NI must always follow Q by rule).
A rule triggered at openHAB-startup initializes the NI and writes the current state of Q into it (important if Q has changed when openHAB was offline).
Solution
Things, Items, Rules and Sitemap are identical to the solution with the RS-switch above.
Explanation of Comfort-Switch UDF with additional Set-input (pulse) and Switch-input (ON/OFF)
5 Functions:
1a: Trigger (pulse long) -> Q=ON (permanent).
1b: Trigger (puls short) -> Q=ON (temporary, switched Q=OFF after n seconds).
1c: Trigger pulse -> Q=OFF (if Q was ON).
2a: Set (positive edge) -> Q=ON.
2b: Reset (positive edge) -> Q=OFF (initial state)
Remark (for parallel operation of trigger and switches):
- If Q=ON, then changes of Set-input must not ‘disturb’.
- If Q=ON, then Trigger (pulse) must clear Q (and must not start another cycle)
- Reset always clears Q (regardless whethr Q was set by trigger or Set-input).
SW (Switch ON or OFF) triggers the Set/Reset-inputs when SW changes.
Thanks to supporters in the Siemens LOGO! Forum.
LOGO! Configuration (LOGO! SoftComfort Diagram Editor)
Here is a screenshot of what the UDF looks like:
Here is a screenshot of what the test-program looks like:
Rename pdf to zip: myComfort-Switch_UDF_L7.zip.pdf (16.3 KB)
(The edge-triggered OR-block are now integrated into the UDF.)
Revision History
- June 2020: openHAB version 2.5.5-1 (Release Build) with Logo 0BA7
Troubleshooting
- none
Next Ideas
- none