I’ve set up a humidor with a d1mini and esphome. It works great but I’d like to improve efficiency so here’s my problem: Cigars should be kept at 70% at 70 F, but if temperature change the relative humidity will change too. By example if the temp is 72 then the humidity should fall to 65% to prevent mold in the humidor.
Below is my working code without temperature compensation.Would appreciate your help:
The humidity is always higher inside the humidor than outside. So the humidifier should stop working until 65% is reached. With this code the humidifier works about 10 seconds 6-7 times a day. Also, the temperature slows down or rise up very slowly.
This is not true. Absolute humidity stays same if you change temperature. Relative humidity RH changes with temperature.
So if you have sealed container with air RH=70% and T=70F and you raise temperature to 72F your relative humidity becomes 66% while absolute humidity remains same 12.9g/m3. Your sensor gives you relative humidity and temperature.
But what would you like to adjust? Cigars are usually kept at RH 68-72%
You are right. Absolute humidity stays the same forgive me. In fact my sensor (htu21d) reads RH (or am I wrong again?) and the temperature here in Canada fluctuates between winter and summer due to the fact that we have to switch from heating to air conditionning in the summer. All I want is a code that follows these changes in temperature and adjust the humidity in consequence.
Have you considered using your sensors in conjunction with a generic hygrostat template? I use these everywhere where I control humidity, it gives a nice UI (similar to thermostats) and then instead of trying to control humidity via code, I just tell the virtual humidifier which already has the smarts to turn on/off humidifiers as needed.
I don’t want to rewire all that stuff. I tought it would be easier to change the code like; if the temp is 72 than set humidifier to 67%, if 73 than set it to 63% and so on…
I know nothing about cigars, but if you want a constant absolute humidity (which I’d find hard to believe) you can use the Thermal Comfort integration to convert RH to AH (or alternatively you could do the calculation yourself):
Both AH and RH can be used with a generic thermostat. But that is on HA, not on the ESP. There you have:
It mentions temperatures, but there’s no reason it can’t be used with humidity. Doing it on the ESP means it will keep working even if HA is down.
Thermal Comfort also works from HA, but the formula to convert temp+hum to absolute humidity can also be found online should you need it.
I believe that you want to do opposite. You shouldn’t look for constant absolute humidity! That would cause condensation, mold etc. You should keep constant RH near to 70% independently from temperature changes.
And RH is what your sensor gives, so your code got very simple
I think these is only recommended rh/t (not matching) min max zone for ok cigar storage.
Anyway, absolute humidity is just a parameter to do calculations, there is no element in nature that follows that anyhow. For example, grain storage in silos, mold growth in houses, hardwood flooring, cannabis growing… whatever, is related to RH. It’s the % of actual water vapor in air compared to max possible water vapor in air. 100% would be full condensation, so pure liquid water. Nature doesn’t do calculations or coding.
“if the temp is 72 than set humidifier to 67%, if 73 than set it to 63% and so on…”
Try that towards lower temperatures and you will see…
Trust me, I’m an engineer, I like cigars and I come from country colder than yours.
I didn’t know it existed, I think it’s the best solution in my case. With the help from bme280 environment example in the cookbook I’m in business. Thanks !