Help example on simple light controll, lux - 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: Help example on simple light controll, lux (/showthread.php?tid=1807) |
Help example on simple light controll, lux - kenjirosama - 22.12.2018 Hi. I am new to this type of programming and had no problem with the block programing they used before but the fb is simply not working for me. I am trying to controll my light to go on below X LUX and of above Y lux. I simply doesnt get it to work. Any ideas? Thanks! RE: Help example on simple light controll, lux - Daniel - 22.12.2018 Try this Code: lux = grp.getvalue('1/1/1') RE: Help example on simple light controll, lux - kenjirosama - 22.12.2018 Thank you very much for your reply! Unfortunately I dont get it to work. created a resident script with the code and changed the adresses but doesnt look like the output changes regarldess of lux or input. I am probably doing something wrong but I dont know what. RE: Help example on simple light controll, lux - Daniel - 22.12.2018 Yes there was stupid mistake in line 3 corrected the original script RE: Help example on simple light controll, lux - kenjirosama - 22.12.2018 (22.12.2018, 18:36)Daniel. Wrote: Yes there was stupid mistake in line 3 corrected the original script Works perfectly! Thank you so much!!! RE: Help example on simple light controll, lux - Joep - 14.03.2024 (22.12.2018, 17:54)Daniel Wrote: Try this I would like to replace the hysteresis from this script for a time period. So let's say i want an hysteresis for 30 minutes how can this be done? RE: Help example on simple light controll, lux - admin - 14.03.2024 You can use grp.find() and updatetime field to check when the last telegram was sent to this specific object. Then use os.time() to calculate the delta. Alternative solution is to use a scheduled script that runs every X minutes. RE: Help example on simple light controll, lux - Joep - 14.03.2024 (14.03.2024, 09:26)admin Wrote: You can use grp.find() and updatetime field to check when the last telegram was sent to this specific object. Then use os.time() to calculate the delta. Hi admin that will not work for me as the updatetime of the object is changing all the time. Code: lux = grp.getvalue('1/0/3') RE: Help example on simple light controll, lux - admin - 14.03.2024 Either use storage to save the time when the script was run previously. Or use a scheduled script instead of event. RE: Help example on simple light controll, lux - Joep - 14.03.2024 (14.03.2024, 09:49)admin Wrote: Either use storage to save the time when the script was run previously. Or use a scheduled script instead of event. ok clear thanks. RE: Help example on simple light controll, lux - manos@dynamitec - 28.03.2024 Hello Admin, I have a project where I want to use the script below to do a simple light control in steps. Can you please help me to achieve the same functionality but for multiple lights groups. This will be a resident script with sleep time 10sec. I was thinking if I can create a table to map all variables and then a function to execute every 10sec. Or any better idea Code: ------Global Settings--------- Thank you in advance. RE: Help example on simple light controll, lux - admin - 28.03.2024 Try this (untested): Code: min = 10 |