Check tomorrows temperature to set hour range of smart socket

Hey everyone,

I’m new to smart home but I’ve got a nice case that I want to deal with and have no clue how to do it in the best way :slight_smile:

So I’ve got electric accumulative heaters (storage stoves) that I can switch on at certain - cheap energy hour range (10 p.m. - 6 a.m. and 1 p.m - 3 p.m.). So for example at warm day I want to just switch them on for 3 hours and night and 2 hours at the day time but when the temperatures go lower than 5 degrees, I want to switch them for 5 + 2 hours.

What I want to do is to:

  • every day at certain hour (probably around 9 p.m.)
  • check the maximum/minimum or the average temperature of the next day
  • considering that temperature - set the hour range for the heater: if <5 = x, if 5-10 = y, 10-15 = z etc.

I’ve got smart sockets added to my home assistant through the tuya integration so it should work :slight_smile:

Is there someone that dealt with same task and succeeded? If not - there are for sure people here who know how to help. Thanks!

Hi,

Did you solve this somehow? I have a similar problem. I tried to give the problem to ChatGPT, but after several rounds of small changes, I still ended up with a bunch of different errors. I want to:

  • get the average temperature for the next 24 hours at 00:00
  • use the formula y = 24 - (ax+b), where y = for how many hours I can block the heat pump, x = average temperature, while a and b I will put manually based on my data elsewhere, Y should be rounded down
  • then I have two options:
    a) during non-sunny months, I will use the y directly in the code made by someone else, which will then check the electricity prices and idle the pump during the y most expensive hours
    b) during sunny months, I will stop the pump at y hours before 9:00 to make sure the pump runs non-stop when solar energy is produced. For this, I would greatly appreciate any hints.