Hi,
you can give HABApp a try. It’s a rule engine for home automation in python I am using to easily create rules.
I have included an example rule which does exactly what you want without further configuration changes.
I would love to get some feedback