I have noticed whilst it has been cold and fuel prices are high that I have been turning on my heating for short sharp bursts. I have a nest to do this - but I find I tend to want it on when I am cold not just because the schedule says I should. Ideally I just want buttons on my dashboard that just say heating on for X where X could be 5, 10, 15 minutes then turn off. Obviously it would not need to turn on if any of my temperature sensors are above a set level. Additionally, though it might have to be separate it would be good if I could still keep something about the temperature dropping to below Y temperature - but I can always stick these in different automations or use the safety temperature in nest.
How would I go about setting the heating, any thoughts greatly appreciated?
In terms of basic logic I assume it would be something like:
If button_toggle on then
start_time = now
end_time = start_time + button_toggle_time
foreach sensor in sensors
if min_temp > sensor.temp then
min_temp = sensor.temp
if max_temp < sensor.temp then
max_temp = sensor.temp
avg_temp = avg(sensors.temp)
loop while (time <= end_time) AND (start_time IS BETWEEN 1700 and 2030)
if (avg_temp <= 18 OR min_temp <= 10) AND (nest.temp <= 20 OR max_temp <= 22) then
turn heating on
else
turn heating off
wait 30 seconds
button_toggle off
And my guess at HA yaml
push_for_heat_5:
alias: Push_To_Heat_For_5_Minutes
trigger:
- entity: push_for_heat_5_button
action:
sequence:
- repeat:
while: "{{ now().time < 2030 AND now().time > 1700 }}"
sequence:
- service: nest.turn_on
- delay: '00:00:00'
- service: nest.turn_off
- delay: '00:00:00'
default:
- service: nest.turn_off