![]() |
Resident script pump circulation - 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: Resident script pump circulation (/showthread.php?tid=1279) |
Resident script pump circulation - Domoticatorino - 07.03.2018 Hi, I did a resident script that every minute checks the status of 2 valves and when one of them goes ON, a pump has to be start after 5 minutes. Instead if valves are both OFF pump has to be stop immediately. Considering that I have to use a os.sleep() command, I would like to avoid to run many script in parallel. What do you suggest? Thanks. RE: Resident script pump circulation - Erwin van der Zwart - 07.03.2018 yHi, Resident scripts don’t run in parallel, only event based do that. BR, Erwin RE: Resident script pump circulation - Domoticatorino - 08.03.2018 Do you mean that if script starts every minute and inside it there's a os.sleep() of 5 minutes, the second script doesn't start? Thanks RE: Resident script pump circulation - admin - 08.03.2018 Scripts never block each other. You can safely use os.sleep in resident scripts. Though for larger delays I recommend using scheduled scripts. RE: Resident script pump circulation - Domoticatorino - 08.03.2018 Hi Admin, You're right but I cannot use a scheduled script. Otherwise I risk to want 10 minutes before starting the pump. I need to don't run a script if the previous one is running. What do you suggest?? Thanks. RE: Resident script pump circulation - admin - 08.03.2018 1. Add tag valve to your valve objects. Create an event script that is mapped to valve tag: Code: -- get OR'ed value of all tagged objects 2. Create either a resident script with large sleep time or a scheduled script that runs every minute: Code: -- turn pump on when time delta >= 5 minutes In both scripts replace pump with pump object name or group address. RE: Resident script pump circulation - Domoticatorino - 08.03.2018 Code: -- check if previous script needs to be killed Surfing on the forum I found an instruction to avoid to add running script. Here above what I did. It seems working. What I would like to do is kill the os.sleep time (360 seconds) if in the meanwhile logic OR is false. I hope I have been cleared. Thanks. RE: Resident script pump circulation - admin - 09.03.2018 You script is not fully correct. Each telegram sent to valve objects will reset wait timer. In some egde cases pump can never be turned on. RE: Resident script pump circulation - Domoticatorino - 09.03.2018 Hi Admin, you,'re right. In fact this morning pump did not srart. Can you suggest me how to update the script? Thanks. RE: Resident script pump circulation - buuuudzik - 09.03.2018 You can do it also as resident and use tag 'circulation_pump' for valves: Code: valveStatesTag = 'circulation_pump' RE: Resident script pump circulation - Domoticatorino - 09.03.2018 Thank you. Which resident time do you suggest? RE: Resident script pump circulation - buuuudzik - 09.03.2018 For such think I like use 1 minute interval but if you want better reaction you can set less time like 30 or 15s oryou can adjust further this script e.g. you can choose Resident 0s and create auto adjusting the time for next calculation like below: Code: valveStatesTag = 'circulation_pump' You can also disable this script if heating controller is off. RE: Resident script pump circulation - Domoticatorino - 10.03.2018 Cool, in which way I can disable the script? Thanks RE: Resident script pump circulation - buuuudzik - 10.03.2018 (10.03.2018, 08:05)Domoticatorino Wrote: Cool, in which way I can disable the script? By use such command: Code: script.disable(script_name) RE: Resident script pump circulation - Domoticatorino - 10.03.2018 Obviously in a different script? RE: Resident script pump circulation - buuuudzik - 10.03.2018 (10.03.2018, 14:12)Domoticatorino Wrote: Obviously in a different script? Yes, but you can also take all script in 1 if statement and check the status of controller. Enjoy? RE: Resident script pump circulation - Domoticatorino - 10.03.2018 Code: valveStatesTag = 'pompa_circolazione_giorno' Hi, I use this script above and it seems does not work. I use 120 sec to check without loosing too time. Unfortunately Pump does not start. What do you think? Thanks. RE: Resident script pump circulation - buuuudzik - 10.03.2018 Please check the updated version. RE: Resident script pump circulation - Domoticatorino - 10.03.2018 It is a Schneider HL 2.0.1 RE: Resident script pump circulation - buuuudzik - 10.03.2018 (10.03.2018, 17:14)Domoticatorino Wrote: It is a Schneider HL 2.0.1 I mean updated version of above script ![]() Code: valveStatesTag = 'circulation_pump' |