Jump to content

Simple humidity control program not working as expected.


66splitbus

Recommended Posts

Posted

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!!

image.png.95e02b6dc2895105671031404c0ce615.thumb.png.57b0306e09809945957de896cb146705.png

Posted (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 by larryllix
Posted (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 by kclenden
  • Like 1
Posted

Thank you both very much that explains a lot!! I'll be working on this tonight. Really appreciate the insight!!

Posted (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. :)

image.png

image.png

Edited by 66splitbus
Posted

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!!
 

Posted
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:

image.png.22c321667df7c3fc61cea62c798e3143.png

  • Like 3
Posted

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

 

 

  • Like 1
Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

    • There are no registered users currently online
  • Forum Statistics

    • Total Topics
      37.2k
    • Total Posts
      372.4k
×
×
  • Create New...