Gate opener optimization - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Gate opener optimization (/showthread.php?tid=4672) |
Gate opener optimization - Novodk - 23.03.2023 Hey I have made this script to open and close my gate, it works almost all the time I'm not a programmer at all, so maybe someone can tell me if there is a better/easier/more correct way to make it work 100% all the time. I have a 4x knx relay where I only use 3 relays First one (2/2/0) is to control a contactor that supplies power to a big 3x400vAC to 24vDC transformer. Second one (2/2/2) is to tell my actuators to close. Third one (2/2/4) is to tell my actuators to open. 32/1/1 is just to open a widget with the controls. 32/1/4 is to show the status of the gate, open or closed There is mechanical stops on the gate if it hits something. Code: close = event.getvalue() Code: open = event.getvalue() RE: Gate opener optimization - admin - 24.03.2023 What happens when the script is not working correctly? Maybe the start-up time for the power supply needs to be longer? The delay after the movement can be shorter. The code looks correct, apart from 'true' in quotes. It works because non-empty string evaluates as boolean true. But if you write 'false' you will get true instead. |