Sett up presence detection with PIR, doors etc

I am trying to setup a motion detection based on PIRs, door sensors, Phones, Wi-fi, “House mode” time of day and so on. I want to detect when someone is in a room, or on the way towards a room. I wonder how people attack problems like this? I tried a bit with automation, but it seems like you need a LOT of automation when there are so many different actions and conditions that work together. And there doesn’t seem to be much of a framework for things like this in HA? Could the best be to go for app-daemon?