To make full use of the device, you should use the rules below. With just the template: * the *Learn* button toggles socket group 1 * The *All On/Off* button toggles socket group 1
### Simple rule This rule switches the state of all switchable socket groups, and publishes a timestamp Json object to MQTT when the *Learn* button is pressed. A socket group that's ***on*** will switch ***off***, a socket group that's ***off*** will switch ***on***
```console Backlog Rule1 ON Button3#state DO Power0 toggle ENDON ON Button4#state DO Publish stat/%topic%/Learn {"timestamp":"%timestamp%"} ENDON; Rule1 ON; ```
### More sophisticated Ruleset This ruleset will switch all switchable socket groups ***off*** if, and only if, all switchable socket groups are ***on***. In all other cases, all switchable socket groups will be switched ***on***. It also publishes the same MQTT as the Simple rule above when pressing the *Learn* button.
```console Backlog Rule1 ON Power1#Boot DO Add1 %value% ENDON ON