@MaxDau Max,
This functionality can be achieved with Home Assistant Software. https://www.home-assistant.io/.
However if you are not already using home assistant it will take a lot of time to get it up and running (and in particular your head around it).
If you think it is something you would want to do then I recommend dedicating a Raspberry PI to this Application Alone and running the HASSIO Operating System. It’s a lot trickier to manually install, use Docker etc. etc.
Hope this helps.
Kevin