Camera + ZoneMinder

Hello,
I bought a Foscam C1 camera, but I can only display the stream in home assistant and that’s it.
So I what I want is to add motion detection in HA and a switch to turn on/off the camera.

Is it the best way to go with zoneMinder ?
Is Xiaomi camera (with hack) working also with ZoneMinder ?

Thanks