How to Group Things in Openhab2

I have multiple device such as sony bravia tv, Phillips hue lights , z-wave sensors and sonos player connected to openhab , How can I make group of more devices so that i can do perform action on multiple device.
For example I have go make movie mood,

  1. First My TV gets ON,
  2. My Hue lights gets off.
  3. My music player stops etc.

How can I group these device in openhab, Is there any rest api available.

You can create an active group for a collection of switches:

Group:Switch:OR(ON, OFF) 	Lights 				"All Lights [(%d)]" 								<light>				(All)

Add your items to that group and you can switch them all on or off at the same time.

I’m not aware personally of a way to group something so that one item in the group turns off and the other on. That sounds more like a rule to me. I know you can create scripts that have a set of actions that you use often and trigger those but that is more for if you have the same actions that get called multiple places throughout your code to save on work.

There is an api: http://docs.openhab.org/configuration/restdocs.html

1 Like

Search the forum for postings that discuss “scenes”. There have been many examples posted with multiple approaches.