Custom Component: Camera PTZ Positioning Based on Motion Sensor input

I have a few cameras that support panning and tilting which are already integrated into HA and I have motion sensors in all rooms, inside and outside.

I’m thinking about a component that takes a motion sensor, camera and present number as input and positions the camera to that preset when the motion sensor is activated.

The reason a custom component will be handy here is because we can link multiple cameras to the same motion sensor.
Could add in scheduling capabilites such that cameras face a wall when you are at home but turn to face into the room when the alarm system is activated.
When an alarm is triggered, the cameras will know exactly where to turn to capture the person breaking in because that is defined via the mapping of sensor/camera/preset.
This compent can manage recordings as well - starting and stopping recordings at the right time, facing the right direction when an event occurs.

What else can be done with this? Any more ideas?

it will be pretty extensive automating it but you don’t need a custom component for what you want to do.

Yeah anything can be done with yaml automations depending on your level of patience.
I feel more comfortable in Python for complex things like this and its good to make things reusable so that others can use it too.

I have a cheap nasty china IP camera with PTZ. I’ve stopped it phoning home and I have thought about using it with HASS however I’d need to work out how to get PTZ working and I’d also need to make it turn into a corner when we are home (we both find cameras in rooms creepy).
Following this with interest.