Detect if temperature is below/above a certain value 5 days in a row

Hi,

I am trying to achieve the following:
A better summer/winter detection to switch my heating configuration.
During winter time, when temperature is very low, the target room temperature is reached, but it is not comfortable anymore and I need to raise the target temperature by 1°C to fell comfortable - this is not needed in summer time. I wanted to use the DarkSky Weather API (should be sufficient, I hope).

Solution I thought of:
I would like to detect if the minimal temperature for a day/night was below 0°C for 5 days in a row. This should trigger a configuration change. As I already have the according heating configuration change scripted (it works), I am just missing the trigger.

If nobody has a better idea, how can I do that best, I was thinking of the following:

  • an input select which indicate 0,1,2,3,4,5 “days” (otherwise I dont have a persistant variable)
  • an input select to indicate my summer/winter state
  • each night at 2am check minimal temperature for that day/night. If below threshold, “advance” the input select to the next day (if 0 -> 1, if 3 -> 4…). If above threshold, set to “0”
  • if input select reaches day 5 -> trigger config change and winter/summer state change
  • based on winter/summer use different thresholds (below threshold 1 vs above threshold 2)

Thanks for your ideas and thoughts.

P.S: I dont have app_daemon running, but python scripts are. HA is running in a docker container as well as homegear for connecting to the heating system.

Firstly I don’t understand your reasoning.
Why is it okay to be cold in the summer but not in winter ?
I set my heating and it runs 24/365, it just so happens that it doesn’t come on roughly 8 months of the year.
But in the event that you need this for some ancillary reason then what I’d do is
Have an input boolean to indicate the result if the temperature goes below your set value
Have an automation that runs at 00:01 to set the boolean if the temperature is below your value (if the temp stays below your set value it won’t trigger anything)
Have an automation that triggers on going below your set value and sets your input boolean
Have an input counter (say 0 to 10)
Have an automation at say 23:59 that looks at the input boolean and if it’s set increment your counter
If it’s not, set the set counter to 0
If the counter == 5 then set ANOTHER input boolean to say WINTER
Have an automation that UNSETS WINTER IF…

1 Like

Hello @Mutt,

reasoning is simple: it is the “felt” temperature due to humidity etc (I assume). At least in summer time the setting is ok and a degree warmer would be too hot, when too cold outside, it seems colder inside and I need to adjust. For whatever reason.

The solution you provided is actually my thought I tried to lay out in my first post. So I assume that I am on the right track, though it seems a bit complex for that problem :slight_smile: . Thanks for this!

The steps are laid out to actually mimic the conditions required by your statement of the problem and the mechanics required to get there.
If fact your actual solution will be more complex as what do you do if you have a cold snap (say 6 days in October) then it goes warmer for another month ? Then how do you reset the winter condition ?
I agree it’s far more complex than it needs to be but I summarised that in my first line. I simply wouldn’t do it this way.

I can see what you mean. For now, I can simply trigger my desired condition manually with a script. I have to do this twice a year, so should be possible :-).
Nevertheless I will try the above out. The issue with the adjustment actually only applies to 1-2 months a year, but it is annoying :-).
I also have different heating conditions e.g. when guests are in the house or long absence was detected…
If I find a smart way to reduce the scripting, I will share it here.

I just have a set of criteria that I apply ALL the time.

  1. Is a Door/Window Open ? (if yes why should I just heat the outside ? - set target to 4° )
  2. Is the house Occupied ? (if not, set target to 14° )
  3. Is is night time ? (if it is set target to 16°)
  4. Is it day time ? (if it is set target to 17° )
  5. Is it evening ? (ie house is occupied but activity level low, set target to 18° )

I can set times and values for all these conditions from the front end
I have a ‘boost’ button to set the temp to ‘evening value’ for 1 hour.
I can force individual eviction for any individual (if one of us forgets their phone at home
I can force occupancy ‘on’ for if we have guests or I have a contractor in.
The temperature decay is quite slow and the rise reasonably quick, so the above works for me but you could set another radius on ‘heating’ (say) your home co-ordinates, but radius “<= 5km” if your house needs more time to heat. Adjust as you go along to get something that you can basically forget about