Request for Virtual thermostat, plus some

I’m after some help if possible,
My house is all electric room heaters, no single boiler. I’m after some help for my rooms.

Using contact, motion and temperature sensors, and a switch on the heater:

Minimum room temperature Away mode
Minimum room temperature Night Mode
Minimum room temperature Home mode.

If there is motion in that room, and door is closed, then switch on heater up to a set temperature,
If door is open, heater off. If the room is up to temperature then heater off.
If there’s no motion in, say 10 mins, then heater off.

I’ve searched and found apps that can deal with boiler thermostat modes changing if a door opens, and Vthermostats that keep a room warm, but nothing with doors and motion.
(It’s the motion that’s confusing me. I can’t increase the motion timeout on the ST sensor, so the heater is going on and off every few seconds as someone moves in the room! I’ve tried combinations with CoRE but it’s scrambling my head)

Thank you