# Design Pattern: Working with Groups in Rules

**URL:** <https://community.openhab.org/t/design-pattern-working-with-groups-in-rules/20512>\
**Category:** Tutorials & Examples\
**Tags:** groups, designpattern\
**Created:** [January 17, 2017, 7:26pm UTC](https://community.openhab.org/t/design-pattern-working-with-groups-in-rules/20512 "2017-01-17T19:26:46Z")\
**Posts on this page:** 1\
**Showing post:** 163

<div class="post-metadata">

**Author:** ![requireiot](https://community.openhab.org/letter_avatar_proxy/v4/letter/r/9fc348/32.png) [@requireiot](https://community.openhab.org/u/requireiot)\
**Post date:** [October 30, 2021, 12:55pm UTC](https://community.openhab.org/t/design-pattern-working-with-groups-in-rules/20512/163 "2021-10-30T12:55:48Z")

</div>

Lights in my home automation setup may be controlled multiple ways: by a physical switch hardwired to the light, by a button on a UI screen, or by a rule in response to some other events.  
To keep it simple, I combine the design patterns for _Proxy Items_, for _Groups_ and for _Associated Items_. I define rules for the desired behavior at the level of a _group_, and then assign the lights to that group.

With this setup, the proxy item will always correctly reflect the status of the light, independent of what caused that status (command from a rule, gesture on a physical control, gesture on a UI element).

A more detailed description can be found [here](https://requireiot.com/openhab-proxy-items-and-groups/).

---

_[View the full topic](https://community.openhab.org/t/design-pattern-working-with-groups-in-rules/20512)._
