Fasades lighting script by time and outside sensor - 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: Fasades lighting script by time and outside sensor (/showthread.php?tid=4322) |
Fasades lighting script by time and outside sensor - AlexLV - 25.10.2022 Hi, I started to create widget for fasades lighting and easy script, but all not so easy for me. Idea - swich On/off by time or/and outside sensor. At widget I need enter hour/min for On time and hour.min for Off time. Also I added Sensor control - Light level form sensor, Lux when Light will be On, and Delta when Light should be off. Below my widget (not finished) and script. Some moments I need help: 1. How to show zero in front if hours or minutes from 0 to 9 ? 2. For me my idea not forking correctly, fasades light is flashing some times. 3. How check "mistakes" settings better? Not found example at forum. i used resident script 1 minute. Code: HStart = grp.getvalue('0/1/100') -- Hours to start Fasades Light On BR, Alex RE: Fasades lighting script by time and outside sensor - admin - 25.10.2022 You have 4 independent IF statements. This causes the light to flicker if more than one statement is true. I think it makes more sense to create a scheduler tied to sunrise/sunset instead of manually specifying the time. RE: Fasades lighting script by time and outside sensor - AlexLV - 25.10.2022 Yes, but customer wants such way. I will try to propose sunset/sunrise variant to him. Alex RE: Fasades lighting script by time and outside sensor - admin - 25.10.2022 Then you need to define your logic correctly. Right now time and sensor value are independent. I suppose you want to control the light using sensor value only when the current time is between user-defined on/off time. RE: Fasades lighting script by time and outside sensor - Gadjoken - 26.10.2022 Hello, I use several scripts to achieve I think what you want: Script 1 : Scheduled Minute 1,16,31,46 every Hour every Month every day name COMMANDE ECLAIRAGE EXTERIEUR (The name is used in a script to disable it): Code: -- Commande Eclairage exterieur Script 2 : Event-Based sur 35/1/2=Commande calendrier éclairage extérieur : Code: ConsigneH = event.getvalue() -- Retour calendrier - Eclairage exterieur Script 3 : Event-Based sur 35/1/1=Auto/manu eclairage extérieur : Code: ConsigneLux = grp.getvalue('35/1/3') -- Consigne Lux spaceLYNK Then you create a calendar with 35/1/2 Exterior lighting control and you integrate it in addition to your lux setpoint (35/1/3) in your supervision which will give the attached photo, the customer can modify via the schedule the start/stop times in the morning and evening as well as the lux setpoint. I also added on another page the auto/manu object so that the customer can turn on or off his lighting as he wishes without this automation. B.R. |