My home automation currently consists of a bunch of Sonoff devices, including TH16 thermostats driving resititive heaters. Simply controlled by the ewelink app, haven't found a need pushing me to Tasmota yet.
I would like to find a solution that lets me vary the thermostat target temperature by time of day, according to a pre-determined schedule and the forecast from Weather Underground. Technically it would be the thermostat upper and lower setting, but for simplicity I'll refer to a single target temperature which is an average of the upper and lower. I've done this manually (cranking the heater when I wake up early in the morning, and turning it off at 8pm) and the house seems to have enough thermal mass/insulation to coast for an hour or two once heated. Fluctuations of this magnitude don't seem to bother us.
This would serve two purposes:
1) Optimizing use of off peak power - ramping up the target temperature by a couple of degrees prior to peak power prices (e.g. before 7am and 5pm), and easing the target temperature down on the tail end of peak prices (e.g. before 11am and 9pm).
2) Minimising use of heater ahead of a hot day (our house is a sun trap) - ramping down the target temperature by a couple of degrees in the morning (from 7am) when the forecast indicates a warm and clear day.
Here's a graph to convey the idea:
Can anyone suggest an approach to make this happen, ideally with my existing Sonoff hardware? I have a raspberry pi if needed to pull everything together. IFTTT doesn't pull the temperature from the Sonoff TH16, so I'm guessing I'll need to go a more custom route.
If I can get this working for the heaters, I'd like to apply it to my hot water cylinder - using the headroom between 50C (minimum needed for reasonable shower) and 70C to coast through peak power price periods too.