Complex time/day/temperature based automation

Good morning all.
I am looking for help building an automation that I current (just about!) achieve using several.
I have a heater in my garden office (aka shed!) that is plugged into a Smart Life plug. I also have a Hue motion sensor that provides a temperature reading. All of these work, I can switch on the plug using HA and I get regular output from the Hue sensor.
While the kids are home schooling (#covid) I only work in the office 9-5 on Monday and Tuesday. The garden gets pretty cold at night. Here’s what I would like to do:
IF Monday OR Tuesday 9-5, turn ON the heater if temp < 20 and OFF if >23 (ie working temp)
IF NOT (Monday OR Tuesday) 9-5, turn on the heater if the temp <5 and OFF if >10 (ie night time ‘anti frost’ temp)

This looks pretty simple, but the temp based triggers only seem to work when the temperature enters or leaves a range. If its already in or out of that range at the time specified, then it wont trigger. For example, in the morning, lets say the overnight control means the temp is currently 6C in the office and we hit 9am. I have a current automation that says turn ON the heater if the temp goes <20 but >0 (second bit seems to be mandatory in the GUI?). But that only triggers when the temp drops below 20C from above. It doesnt want to trigger when the automation becomes ‘live’ at 9am if the temp is <20 already. The only way I have found to solve this is to have another automation that independently turns the heater on at 9am and pushes it up towards the 20-23 range and therefore starts to trigger the hi/low control.
I currently have lots of separate automation trying to achieve this simple control - overnight, daytime working day, daytime non-working day, start the heater in the morning on a working day as above.
Is there a way to get this into a single automation?? I fear I might be stuck with the mess I have already, and then trying to trouble shoot the interactions between them.

They trigger when they cross the above and/or below threshold specified in the trigger.

So you are using temperature triggers and time based conditions?

If so, just add one additional trigger to your automation. A time trigger that occurs at the start of your time range. That way the temps are checked at the beginning of the time range and if they are already within the the conditional range the actions will occur.

OK - great - that means I can add a final ‘off’ of the day so the temp drops towards the anti-frost level, and a first ‘on’ of the day so it heads up towards the steady state for the work day.
Is there any way to have OR conditions - so I can have a single automation for all temps ? ie

IF date/time = daytime on certain days then do x;
ELSE date/time = night time then do y;

or do these need to be separate automations?

Yes you can have or conditions. See: https://www.home-assistant.io/docs/scripts/conditions/#or-condition

Thanks. Looks like I’ll need to dust off my scripting skills as this doesn’t look possible through the GUI.

My choice would be to use the Generic Thermostat integration to control the switch’s operation. It will maintain the ambient temperature at the desired target temperature.

The automation’s task is reduced to simply changing the Generic Thermostat’s target temperature according to your desired schedule (say 22 on Monday and Tuesday between 09:00 and 17:00 and 8 at all other times).