KlausMu / esp32-fan-controller

ESP32 fan controller with temperature sensor and MQTT
266 stars 46 forks source link

updates, project. #18

Closed s4saken closed 9 months ago

s4saken commented 9 months ago

Hi Klaus,

I see your very busy making this great. Thanks man for all the effort. I got a new touch display and its working great again.

I managed to setup new pwm channels to. Because i have 2 fans for my case. I wanted to create a positive pressure for in/out. So i got this working on a second temp control, but with an offset. Kinda great.

The second channel i use for a build in filter, for when i dont need any temp control. Also bought a 2 channel relais module. Gonna create 2 switches for light and case power. I am gonna add the mqtt discovery messages for these also.

All and all, very nice project, nice base and just a very good smart device.

Testing the new updates right now.

Kind Regards,

KlausMu commented 9 months ago

Thanks a lot for your feedback. I really appreciate it. I'm finished now with all the planned changes. Nothing more on the to do list. So you can test witout fear that something new is in the pipeline.

s4saken commented 9 months ago

Well i see you added something new in the pwm control also, regarding setting the off state on pwm controlled fans. I guess this is a fix for the problem i was looking for, since my self added pwm channels, did not comply with off state. Gonna test is right now :D. Thanks again.

KlausMu commented 9 months ago

Well, mainly I added an explicit "off" state, inspired by how HA is doing it. If the device is "off", pwm is set to 0, and also kept at 0, no matter what the temperature controller is saying. Don't know if this helps you. As said earlier, setting pwm=0 may not really stop your fan. This depends on the fan. If your fan keeps spinning at pwm=0, there is nothing you can do. You would need to power it off.

Maybe you find also helpful

s4saken commented 9 months ago

That new config override option is nice, for my 2.8 inch display i do have to switch the touch around to match the tft, in the touch code itself.

I am still working on this project, and i am wondering if you want another pull request when i am done? I am going for clean configuration following most of your example. Also i am learning a bunch. I am also running code inspection from the platform regularly.

At this moment the following has been added and tested successfully and is fully compatible with fan_only/off mode:

Currently working on:

Currently thinking about.

KlausMu commented 9 months ago

I think the project should focussing on cooling. That's the main purpose of fans (beside reducing moisture). So supporting a relay for heating is out of scope, I think.

But what could be of interest is having more than one pwm channel, including pwm offset for the other fans. But they would all be controlled by the same temperatureController, right (the only difference is the pwm offset)? Or would you also introduce several temperatureControllers? That would be rather complex, and I fear that it would not longer be possible to understand the code easily.

Regarding HA discovery, I think we would still have only one single climate or fan device (the latter setting pwm as percentage). For each fan we would have two dedicated sensors for pwm (absolute value) and rpm.

s4saken commented 9 months ago

I think the project should focussing on cooling. That's the main purpose of fans (beside reducing moisture). So supporting a relay for heating is out of scope, I think.

But what could be of interest is having more than one pwm channel, including pwm offset for the other fans. But they would all be controlled by the same temperatureController, right (the only difference is the pwm offset)? Or would you also introduce several temperatureControllers? That would be rather complex, and I fear that it would not longer be possible to understand the code easily.

Regarding HA discovery, I think we would still have only one single climate or fan device (the latter setting pwm as percentage). For each fan we would have two dedicated sensors for pwm (absolute value) and rpm.

With additional controllers the setup will indeed get more complicated. Adding extra controllers is also not needed formthe use case. My thoughts on adding extra channel with offset, is as follows. Air goes in, Air goes out, overpressure is good to keep the dust out. Not only for a 3d printer case. Many usecases.

Just give me some time to finish and create a pull. Then you can decide what to keep.

KlausMu commented 9 months ago

So the "in" fan runs at higher pwm as the "out" fan, the result is overpressure, right? Ok, now I think I got your idea.

s4saken commented 9 months ago

So the "in" fan runs at higher pwm as the "out" fan, the result is overpressure, right? Ok, now I think I got your idea.

Yes.

Together with filters, the slightly higher pressure will be sufficient to keep the case from pulling in dust through holes or cracks.

s4saken commented 8 months ago

Hi Klaus,

Wanted you to know i don't think i can create the function in the code. Atm my code has been so heavily modified, i don't think i will be able to go back to the main repo.

Just wanted to thank you again for the work and wanted to tell you what i created, its finished.

Fan

Relais:

Finally i choose to add heater mode to hvac, so it all comes together nicely. To my suprise the esp32, did not get slow at all. Touch also did not get slow, which is amazing in my opinion.

I don't use the retained messages for discovery messages, but i do use them for status topics, and settings topics. This makes using the controller very easy. Using the controller with stock values is possible, if setup through mqtt, the mqtt server will act as a settings manager for the controller. I tested everything, and it is working like charm, there where some challenges for me, but inspecting your code, and thinking out of the box, worked very well.

Kind Regard, 4Saken WhatsApp Image 2023-12-28 at 20 12 42

KlausMu commented 8 months ago

Looks great, thanks for the update! Which hardware are you using for heating the printer enclosure?

s4saken commented 8 months ago

Looks great, thanks for the update! Which hardware are you using for heating the printer enclosure?

I first wanted to use a ceramic unit, ptc. But because they are a capacitive load, they cause some interference on the grid. I opted for this:

ali

400 watts. Using a ssr relais 40a, with a heatsink. Since most of the hardware is in the box to, i created a box for all the hardware, and i am pulling some air though this. This solution saves me power also, because i don't have to keep the room on temperature. Heating the air also gives me more control over humidity, since small amounts of temp changes can already make big difference in humidity.

I am still testing though, so i can't recomment anything yet. I am not in a hurry.