target humidity - DaveL17/indigo-scripts GitHub Wiki
The target humidity script is used to set the desired humidity target level based on current indoor humidity, current outside temperature and user preference.
The script relies on a formula derived from a published target humidity table from Trane:
Outdoor Temp (°F) | Indoor Humidity |
---|---|
+40° | 45% |
+30° | 40% |
+20° | 35% |
+10° | 30% |
0° | 25% |
-10° | 20% |
-20° | 15% |
If the current outside temperature is 45°F or higher, the target humidity level will be set to 45%. Similarly, if the outside temperature is -20°F or lower, the target humidity will be set to 15%. Between -20°F and 45°F, the target humidity level will be set based on the following formula:
Target Humidity = 45 - ((40 - Outside Temperature) / 2)
The resulting target humidity value is saved to a variable which can be used in combination with your HVAC control.
First, you will need to modify the code to fit your Indigo installation. This doesn't require any knowledge of Python, but you will need to edit the script using a tool that can save plain text files.
Current Humidity Source:
You will need to edit the following line to match the Indigo device ID of your current humidity source. Further, if your
device's humidity level is not called sensorValue
you will need to change the state name as well.
current_humidity = indigo.devices[281604201].states["sensorValue"]
Current Outdoor Temperature Source:
You will similarly need to edit the following line to match the Indigo ID and state name of your outdoor temperature
source. I recommend the WUnderground family of plugins. The line should look something like this:
current_temperature = float(indigo.devices[1899035475].states["temp"])
Current Humidity Variable
We save the current humidity level to an Indigo variable. Edit the following line to match the variable ID of your
current humidity variable.
current_humidity_var = 950128135
Target Humidity Variable
Lastly, we save the target humidity into an Indigo variable. Edit the following line to match the variable ID of your
target humidity variable.
target_humidity_var_id = 187913970
Tying it all together
Now that you have the current humidity and target humidity, you can create a trigger to control your humidifier relay.
Note that Indigo doesn't allow us to compare a device state and a variable value to determine if humidity is called for
(which is why we save the current humidity value to its own variable--it's for the comparison.)