Smart Heating System automation

I have had a read through the forum, and can’t find exactly what im looking for, and i’m struggling to get my head around automations.

I have the following,
central heating operated via a sonoff basic, switch.central_heating
Lounge temperature reading, sensor.lounge_temperature
slider in HA, to set the target temperature input_slider.target_temp
device tracker - device_tracker.tony_phone

From this I want to create an automation, to switch the heating,
IF
A. time is between 0600 - 0730, and 1630 - 1900
B. the lounge temperature is lower than the target temp
C. The device tracker is showing home

I’ve looked into the climate widget, but it doesn’t seem to cover all bases.

Now i know this should be simple, but my understanding of automation is that non-existent, i don’t know where to start.

Any guidance appreciated,