"Presence detector" for housekeeper

First of all, I’m new to HA so please bear with me if there is a trivial answer to this. I have searched but could not find exactly what I was looking for.

I have a housekeeper who comes to my house at a fixed interval on a fixed weekday. I would like some sort of presence detection so that the state is “home” during this time, even if none of the regular occupants are at home.

I thought of creating a binary sensor, that would be initialized with the value “off”, and then have some sort of trigger that sets it to “on” only between a certain time interval on a certain day of the week. I could then use this binary sensor with a Composite Device Tracker (GitHub - pnbruckner/ha-composite-tracker: Home Assistant Composite Device Tracker) to create a device_tracker.housekeeper_presence which could then be assigned to the People object for the housekeeper as a “Track Device”.

In pseudo-code:
Initialize my_binary_sensor to "off"
If day-of-week == Tuesday AND (time-of-day is after 9 am AND time-of-day is before 5 pm)
Make sure my_binary_sensor is "on"
Otherwise, make sure my_binary_sensor is "off"

I guess I would need some sort of trigger with a time condition and an action, I’ve tried to read up on this but I just installed HA a few days ago so I’m fairly new to this.

Does anyone have an example that would achieve this? Or something similar, or a better solution? With some code examples please, I’m still in the process of learning the basics. :slight_smile: