There is a ZoneMinder Binding that has been submitted for inclusion. You would set up ZoneMinder to process the data and generate the motion detection events.
There is a program called motion that detects motion of a camera feed. You could then write a script around that to publish the events into openHAB using HTTP or MQTT.
It depends on how you do the motion detection. You will need to research ZoneMinder and/or Motion, pick one, get it working and only then will we be able to tell you how you would interface it with openHAB.
Fundamentally, motion detection is not something that openHAB does. You need to figure out that part first. I have one camera hooked up to ZoneMinder but it is mostly a DIY cobbled together camera. Your camera will integrate differently and I’ve no advice to provide. And even then I don’t have any integration between my camera and openHAB.
This is a hard problem. With some perseverance you should be able to figure it out. But most of the hard work will take place outside of openHAB so you will find limited help on this particular forum.
In that case create a rule that triggers when that item is updated. In the rule check to see if it is 2. If so sendCommand ON to the light. Then create a Timer to go off in now.plusMinutes(30) with a body to turn the light OFF.