66splitbus Posted July 31, 2021 Posted July 31, 2021 Could some one give me a direction to look as to why these programs do not run correctly? Im building meat curing chamber and need to dial in the humidity. Ill have a dehumidifier and a humidifier both connected to 2635 on/off modules. Right now for debugging im just using my lights and its just very inconsistent. Sometimes the dehumidifier doesnt shut off at all, and the Wait 10 seconds is random at best. Basically I want to let the humidifier turn on for X seconds the wait X seconds before turning on again. Thanks!!
larryllix Posted August 1, 2021 Posted August 1, 2021 (edited) A few things. Each program contains a second Wait 10 seconds. Since there are no following lines the Waits do not function for anything in the programs. The only triggers you have for each program is the humidity reading changes from your sensor. Each time the humidity changes reading the program may run again or reset the currently running program. In this case it will not cause a problem. Here is what I would do using two variables $Humidity.max, $Humidity.min Humidifier Program [Run at Startup Enabled] If humidity <= $Humidity.min <----- Integer variable. You can change while running without the program stopping AND dehumidifier is Off <------ insurance against both running simultaneously Then Repeat while humidity <= $Humidity.min <---- same integer variable=always common set humidifier ON Wait 20 minutes <--------run time set humdifier Off Wait 10 minutes <----------- Off time if desired Repeat 1 times Else set humidifier Off <-------------- may get interrupted while on, insurance Do the same thing for the dehumidifier, changing the cross locking to the humidifier status. Edited August 1, 2021 by larryllix
kclenden Posted August 1, 2021 Posted August 1, 2021 (edited) 7 hours ago, 66splitbus said: Could some one give me a direction to look as to why these programs do not run correctly? 3 hours ago, larryllix said: A few things. To put a finer point on @larryllix's points, here are a couple things you should know: Only one instance of a particular program will ever run. So if something causes a program to restart, the old instance just ceases to exist at whatever execution point it was at when the new instance starts "Wait" statements allow a program's IF to be reevaluated. This means that if at any point during the wait, a trigger in the program's IF goes off then the current instance of the program ceases, and the IF is reevaluated and either the THEN or ELSE section will begin executing as the new instance of the program. In your program, the humidity reading is the trigger for the IF. So when it changes, the IF will be evaluated. So in your case, let's say the humidity was 70 and the THEN started to execute. It turns the light on and then enters a 10 second WAIT. If at any point during those 10 seconds the humidity changes from 70 to something else (could be 70.1 or 69.9 or anything else), then the current instance of the program will cease to exist, and a new instance will begin by evaluating the IF. Depending on the the result of evaluating the IF, either the THEN or the ELSE will begin to execute. Edited August 1, 2021 by kclenden 1
66splitbus Posted August 1, 2021 Author Posted August 1, 2021 Thank you both very much that explains a lot!! I'll be working on this tonight. Really appreciate the insight!!
66splitbus Posted August 1, 2021 Author Posted August 1, 2021 (edited) Ok, sorry to be such a noob but Im not quite sure how to achieve: humidity <= $Humidity.min I can only compare my humidity controller to a number between 0-100 not another variable. Side note, I have a much better understanding on how Wait works. Huge to know that a new instance starts if the value changes. Edited August 1, 2021 by 66splitbus
larryllix Posted August 1, 2021 Posted August 1, 2021 Most devices support comparison to a device parameter. Maybe this is a feature in ISY Pro??? I have run Pro for years so I am not sure. However, if not....and I know this sounds like it is getting complicated but it gives easy future options to Make your devices easily replaceable...say average two devices humidities? Detect a failed unit and replace with another in ISY software? Make your programs easy to test? This is how I would do it. YMMV Create a state variable called $sHouse.humidity Create a folder called "Sync devices" Create a program under that folder called Sync.humidity Enable run at startup for this program (Summary tab) Program Sync.humidty [enabled] If device.humidity >= 0 <----- trigger on any change Then Wait 2 seconds <------ avoid CPU clashes with other programs = background task set $sHouse.humidity = device.humidity <---- keep ram copy of it set $sHouse.humidityy init to device.humidity <---- power up knowing last humidity reading Else --- Now use that state variable for your de/humidifier control programs. You can test you programs by twiddling the state variable Just ask if you want more or have problems!!
kclenden Posted August 2, 2021 Posted August 2, 2021 8 hours ago, 66splitbus said: I can only compare my humidity controller to a number between 0-100 not another variable. Click the right pointing triangle that I've circled in red: 3
66splitbus Posted August 4, 2021 Author Posted August 4, 2021 Holy crap!!! Thats it. Thank all of you. I cant believe Ive never clicked that, never even noticed it really. ?♂️?♂️?♂️?♂️?♂️ Now I can finally properly use this damn thing. lolol 1
Recommended Posts