Help for Rules for freezer automation & MQTT Import

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Oetsch
Normal user
Posts: 195
Joined: 13 Jul 2020, 12:10

Help for Rules for freezer automation & MQTT Import

#1 Post by Oetsch » 25 Oct 2020, 09:04

Hi
yesterday the thermostat of our freezer got broken. Because the replacement spare part has to be ordered and isn´t cheap my intention is to make the emergency solution workable for the future. I installed a waterproof DS18B20 at an ESP8266 and a Shelly Plug to switch the freezer on and of. The temperature regulation is done in IObroker but I´m not so happy with it because this night it stopped working well. Guess the Wifi connection isn´t stable enough and I like to switch to an independent temperature control done by ESPEASY. I have a Sonoff basic on my desk which is able to switch the freezer on/off and the ds18b20 can be connected.

Problem for me is the rule and the import function of the setpoint. My idea is that the setpoint should be imported e.g. MQTT from IObroker but if there is a problem (connection loss or startup etc.) the setpoint should used from a standard value which is stored in espeasy.

The temperature control itself should work as 2-point control. switch on if temperature is 1°C above setpoint. switch off if temperature is equal setpoint.

Do you think this is a good solution whith not to much effort to implement?
Starting now to flash the Sonoff but I have big headage doing the MQTT Import. this has not work yet for me and in this case this should be very stable.

Do have have some ideasor hints how to do best?

Thank you very much!

mrwee
Normal user
Posts: 225
Joined: 31 Aug 2016, 12:52

Re: Help for Rules for freezer automation & MQTT Import

#2 Post by mrwee » 25 Oct 2020, 09:23

By far the most secure way, is to use the "Level Control" device. It will handle all the control for you. Then you can use MQTT to monitor the temperature & that the sensor / Espeasy is actually alive.

Oetsch
Normal user
Posts: 195
Joined: 13 Jul 2020, 12:10

Re: Help for Rules for freezer automation & MQTT Import

#3 Post by Oetsch » 25 Oct 2020, 09:32

Thx mrwee
Haven´t used the controler before and had a look to it.
*Edit: connection for relay is now clear according wiki.

external setpoint setting I have to test, thx!

Oetsch
Normal user
Posts: 195
Joined: 13 Jul 2020, 12:10

Re: Help for Rules for freezer automation & MQTT Import

#4 Post by Oetsch » 25 Oct 2020, 11:13

Mmmh, I´m still struggeling with the sonoff basic and my wifi connection is not stable (rebooting).

Seems that this is a known "feature": https://github.com/letscontrolit/ESPEasy/issues/2931

Trying now to flash blank image and than normal 1M 8266 again, will see

TD-er
Core team member
Posts: 8752
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Help for Rules for freezer automation & MQTT Import

#5 Post by TD-er » 25 Oct 2020, 13:02

Just a warning as you plan on using a Sonoff.
When the Sonoff is powered via mains power, then ALL parts of the ESP are somehow connected to mains power as its power supply has no isolation from mains.
This means the temperature sensor is also connected to mains power.
Not sure how well the isolation is between the (metal?) probe of the temperature sensor and the pins, but I wouldn't be surprised if that's somehow connected or at least not properly isolated to withstand 250V.

So I would strongly advice you to power the ESP via an isolated power supply and maybe make a 2-stage relay to switch the freezer or maybe use something like a solid state relay to switch the mains as those only switch at 0-crossing of the mains voltage. (easier on the compressor motor)

TL;DR
Connecting the Dallas sensor to the Sonoff is quite dangerous.

Oetsch
Normal user
Posts: 195
Joined: 13 Jul 2020, 12:10

Re: Help for Rules for freezer automation & MQTT Import

#6 Post by Oetsch » 25 Oct 2020, 13:49

Thanks. A good point and I´m not feeling well doing this for continous period, fully agree.

Have to look for a "board" with 1 relay and 1 additional gpio for the DS18B20 inkl. isolated power supply.
Best would be a "board" incl. housing. Don´t know if there is sth. available.

Thats the reason why i like the sonoff because of included power supply. As alternative I only know Shelly but they are ot supported by ESPEasy.

In this case I like to have this included controler in the device to have maximum availebility without need for wifi connection or iobroker etc.

So have to search for sth. but this will need delivery time etc.

User avatar
Ath
Normal user
Posts: 3517
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Help for Rules for freezer automation & MQTT Import

#7 Post by Ath » 25 Oct 2020, 14:08

Oetsch wrote: 25 Oct 2020, 13:49 As alternative I only know Shelly but they are ot supported by ESPEasy.
Shelly 1 and 2/2.5 are supported by ESPEasy, they even have their own configuration as they have 2MB of flash, allowing for OTA updates, yay!, but they have exactly the same electrical issues as the Sonoff's, and in this case the manufacturer is even giving warnings for that 8-)
/Ton (PayPal.me)

Oetsch
Normal user
Posts: 195
Joined: 13 Jul 2020, 12:10

Re: Help for Rules for freezer automation & MQTT Import

#8 Post by Oetsch » 25 Oct 2020, 14:12

Ath wrote: 25 Oct 2020, 14:08
Oetsch wrote: 25 Oct 2020, 13:49 As alternative I only know Shelly but they are ot supported by ESPEasy.
Shelly 1 and 2/2.5 are supported by ESPEasy, they even have their own configuration as they have 2MB of flash, allowing for OTA updates, yay!, but they have exactly the same electrical issues as the Sonoff's, and in this case the manufacturer is even giving warnings for that 8-)
Thx. Without knowing in detail, in between my feeling also pushed me in this direction. So dedicated 230VAC to 5VDC power supply for D1 mini + relay or a relay board based on ESP8266, is only recommandable solution.

TD-er
Core team member
Posts: 8752
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Help for Rules for freezer automation & MQTT Import

#9 Post by TD-er » 25 Oct 2020, 14:49

If you plan on using a standard USB charger as power supply (which should work), make sure not to use an USB cable which is too long as that may result in a voltage drop depending on the current.
Also lots of USB chargers sold do not output a very clean 5V voltage. So better also add a capactor of +/- 220 - 470 uF on the ESP side (at 5V).
Better use capacitors rated for more then 10V as some USB chargers output spikes when the load changes.

Oetsch
Normal user
Posts: 195
Joined: 13 Jul 2020, 12:10

Re: Help for Rules for freezer automation & MQTT Import

#10 Post by Oetsch » 25 Oct 2020, 16:51

Thx, evaluating at the moment what i will do.

I like very much having just 1 plug for the freezer. So this means that I have to integrate the 5V power supply in the top of the housing which is not to high but I expect having a 5V 1-2A power supply in a waterproof housing should fit.
This will also mean that the cable length from power supply to the ESP8266 will not be very long e.g. 20cm.

Thinking about using a D1 Mini + Relay Shield or a ESP8266 Relay Board. The relay boards if found so far are mainly for ESP8266-01 which i do not like so much. Biggest issue for relay board is having an additional connection option for the DS18B20. Mainly these boards are only for switching the relays and no spare GPIOs are accessable by free pins of the board.

Oetsch
Normal user
Posts: 195
Joined: 13 Jul 2020, 12:10

Re: Help for Rules for freezer automation & MQTT Import

#11 Post by Oetsch » 25 Oct 2020, 17:31

mrwee wrote: 25 Oct 2020, 09:23 By far the most secure way, is to use the "Level Control" device. It will handle all the control for you. Then you can use MQTT to monitor the temperature & that the sensor / Espeasy is actually alive.
Thinking again about this solution.... According wiki: https://www.letscontrolit.com/wiki/inde ... velControl

This solution is made for e.g. heater but I like to use for freezer so how to influence control set GPIO out to 1 for cooling not for heating?

*Edit: Could answer by myself. Easiest solution is to manipulate the negative temperature valvue inside of the freezer (formula in espeasy) to a positive value.
Last edited by Oetsch on 26 Oct 2020, 07:59, edited 1 time in total.

TD-er
Core team member
Posts: 8752
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Help for Rules for freezer automation & MQTT Import

#12 Post by TD-er » 25 Oct 2020, 20:44

You can also split the switching and temperature measurement over 2 ESP units.
The temperature reading can then be shared among nodes via the ESPEasy p2p layer.
So you'll have a perfect isolation between both.

Oetsch
Normal user
Posts: 195
Joined: 13 Jul 2020, 12:10

Re: Help for Rules for freezer automation & MQTT Import

#13 Post by Oetsch » 26 Oct 2020, 08:09

Thx. With regard to isolation I fully agree.

But for me the difference to the current "emergency solution" is not so big. DS18B20 connected to an ESP8266-01 equipped with ESPEASY and a Shelly PLUG to switch the freezer on/off. Ok for control iobroker in addition has to do the work.

Most discussable for me is the degree of depency to the wifi and in general the degree of independence. Having I ESP-Unit controling the freezer would make it totally independent. It will work even if no wifi is there. In general only the ESP itself has to work. This i like very much and feels for me as good solution to be protected against influences from outside at a high level.

A the moment the emergency solution is working well. Guess the issue in the first night was caused by the time switch (daylight safing time) for one of the involved components. I have ordered some relays for a D1 mini and some external 5V power supplies. This will also take time for delivery. Hope the emergency solution will work stable until end of my journey and then i will go on to implement new hardware and control by espeasy.

Thank you very much for your help and hints!

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 125 guests