vitormhenrique / OctoPrint-Enclosure

OctoPrint Enclosure Plugin
GNU General Public License v3.0
396 stars 202 forks source link

Offset AM2302 #378

Open Mikelomi opened 3 years ago

Mikelomi commented 3 years ago

Hello, I use your Plugin with many Features, but there is a little thing that i miss. My Sensor Am2302 works perfectly with Temp but the Humidity alwas about 8-10 percent to much.

Is there a possabillity to set an Offset corection to the values. Also would it be nice to have control my Drybox by Humidity Sensor for start /Stop Drying. . Thank You,for doing this good Job since.

Sorry for my bad English

TazerReloaded commented 3 years ago

The AM2302 is a digital sensor, performing conversion and compensation internally, so the reported value should be correct. What kind of measurement did you use as a reference? Regarding the offset feature: This could be benificial for all kinds of sensors, not just the AM2302, and is easy to implement. The other feature, controlling an output with the humidity reading, is a bit more complicated, because sensor outputs can be expected to fluctuate and that would also make the output unstable. The simplest solution would be to define a value when the output should be switched on, and a value when it should be switched off. That way, we'd have some hysteresis and the output should work reliably. For example: You want your drybox at around 35% humidity, so you start your heater at humidity 38%, and switch it of when it reaches 25% (keep in mind that the AM2302 measures relative humidity, so the value will drop dignificantly when temperature rises. All values are rough estimates, I have not tested this scenario).

sajovicd commented 3 years ago

Your example is already implented for a long time and it works perfect I use all the time for my dehumidifier box

TazerReloaded commented 3 years ago

Oh, didn't see that I guess, I don't have a dehumidifier in my box. Thought only temperature could be used as an input. Well, then only the offset problem remains. Although it's not essential, because even readings with wrong offset can be used for controlling outputs.

Mikelomi commented 3 years ago

Thank you all for your quick response to help. I don´t know how to realize as User Sajovicd with only Input use. I don´t understand for the moment how to do this.

thank´s