Hot Water in Timerange by Button Click - Junker Bosch Ta250

I have long since implemented a hot water control system from Homeassistant Button to my very old Junkers gas heating system using simulated button presses via relay.

harryinet/oldmakesmart

That works quite well. Now there are often children and grandchildren in the house, so I would like to be able to set the hot water not just once at the click of a button, but to be able to set time ranges.

Example: If the water drops below 34° between 07:00 and 09:30, then activate “Heat water”. Sounds very simple, but not if it is already heating (then it would be deactivated).

I have considered something with Generic Thermostat, but it switches to HEAT or OFF or IDLE, whereby in my case HEAT is just a short simulated keystroke, OFF is the identical simulated keystroke.

The following would be ideal, too: Only start the hot water when someone has clicked the button, but then maintain the temperature until 09:30. There may be no need for hot water that day in the morning.
If the button is clicked outside the time, heat the water once to the target temperature.

This is to reduce the permanent heating of the water by the gas heater.

At the moment I am lacking an idea, if you have any hints, please send me a pseudo code, i.e. a verbal description.

Thanks in advance for any tips.

Translated with DeepL.com (free version)

In the end, it’s not as complex as I thought …

  • Take a generic_thermostat with a dummy switch
  • Create calendar_events with the switch-on and switch-off times, here as an example from 06:00-09:00, 11:00-13:30, 16:00-20:00
  • An automation that queries the start and end events and then sets the target temperature to 35° or 10° depending on the event
  • Another automation triggers the relay that simulates the button press when the generic_thermostat changes from IDLE to HEATING and vice versa.
    Done
  • Another button in the dashboard sets the target temperature of the generic_thermostat to 35° if required, so the calendar_event is overridden until the next phase

Waste product: My control system from 2 years ago, when I wasn’t so familiar with the Home Assistant, is probably no longer needed

Translated with DeepL.com (free version)