I recently added another Pico \ Pi \ Kasa combination to a second similar room and they are doing a good job of keeping both rooms at the set RH% level. But it seems that there are two separate requirements. The first is to prevent the growth of mould. A peruse of various sources suggests a wide variation in RH% levels to achieve this, the lowest figures tend to be provided by businesses that provide air conditioning \ dehumidification services, and higher probably more realistic levels, by academics that have done experimental work in the lab. Anyway, I have chosen an upper limit of 57% this purpose.
The second requirement is to prevent condensation and 57% isn't necessarily low enough to do this, it depends on the temperature of the coldest part of the room, in my case where the walls are thinnest below the windows. I can take this into account by adjusting the upper limit by reducing the figure in the 'upper limit file' depending on the temperature forecast for the colder hours of the day, which are generally during the night. Manually adjusting the limit is OK, but I want something that does that automatically. For example, the outdoor temperature today is forecast to drop by over 6C and the difference then will be c. 10C between ambient room temperature and the outside temperature. Obviously the outside temperature will be lower than the coldest part of the room's walls, so I can add a bit, a fudge factor, to that figure.
I would like to have been able to scrape the local BBC weather forecast into a Google sheet but I couldn't find a way to do this. However, I did find another site giving temperature forecasts for my area that look fairly accurate that I could scrape into a Google sheet using the IMPORTHTML function. But I didn't want to have a spreadsheet permanently open on the Pi to do this, so I investigated publishing it to the web and then downloading it using 'wget' and parsing out the temperature data from the rest of the content. The only problem with this approach is that Google sheets do not normally update their values unless the sheet is open somewhere. I was pleased to find that grabbing the data with 'wget' does update the data on the published sheet.
The forecasts are given for three hour periods during the day. I then wrote a formula to give the
next temperature forecast based on the current time. So, it's now 17.40 as I write this and the sheet gives a temperature forecast for 18.00, of 3.33C. Having studied a chart for ambient temperature, RH% and dew point I can see that it's the magnitude of the difference that gives the target RH% to avoid condensation. Later tonight the temperature is forecast to be c. 0C and a RH% of the preset 57% will be too high to prevent condensation, so I use the difference between the ambient temperature and the forecast outside temperature to calculate the maximum RH% for the room. This is used to update the 'upper limit file', according to simple formula in a bash script. If you like that sort of thing
it's quite fun watching the script update the 'upper limit file' as the forecast temperature drops at night. I only implemented this function 3 days ago but it seems good so far.
One thing I found out is that since I added the equipment to a second room, The Kasa library script fails if two devices are being turned on or off at the same time. Starting the second dehumidifier script 3 minutes after the first seems to have avoided these 'collisions', so far.
RC