There are a couple of pages on that. Basically pairs of groups (trigger & action) are used.
https://openhab-scripters.github.io/openhab-helper-libraries/Python/Community/Area%20Triggers%20and%20Actions.html