Skip to content

Commit d533f5a

Browse files
authored
Group calculations done based on Group Item's system unit.
Depends on openhab/openhab-core#4563 Signed-off-by: Andrew Fiddian-Green <[email protected]>
1 parent c1c1e7f commit d533f5a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

configuration/items.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,9 @@ Group:DateTime:LATEST LastSeen "Last Seen [%1$tY.%1$tm.%1$tY %1$tH:%
531531
Group:Number:COUNT("OFFLINE") OfflineDevices "Offline Devices [%d]" // e.g. "2"
532532
```
533533

534-
The first four examples above compute the number of active lights and store them as group state.
535-
However, the second group is of type switch and has an aggregation function of `OR`.
534+
The first four examples above compute over the active lights in the group.
535+
The first example simply calculates the number of lights in the Group that are `ON`.
536+
The second example if for a Group of type Switch and has an aggregation function of `OR`.
536537
This means that the state of the group will be `ON` as soon as any of the member lights are turned on.
537538
The third uses `AND` and sets the Group state to `ON` if all of its members have the state `ON`, `OFF` if any of the Group members has a different state than `ON`.
538539
The fourth uses `XOR` where the Group state is only `ON`, if exactly one light is `ON`.
@@ -542,6 +543,8 @@ Sending a command to a Group causes the command to be sent to all Group members.
542543
An example of this is shown by the second group above; sending a single `ON` or `OFF` command to that group turns all lights in the group on or off.
543544

544545
The fifth example computes the average temperature of all room temperature Items in the group.
546+
The calculation converts all values to the Unit of the Group Item.
547+
So if the Item has the Unit `CELSIUS` then all member Item values are converted to `CELSIUS` before the calculation is done.
545548

546549
Assuming we have a Group containing three timestamps: `now().minusDays(10)`, `now()` and `now().plusSeconds(30)`.
547550
The `EARLIEST` function returns `now().minusDays(10)`, the `LATEST` function returns `now().plusSeconds(30)`.

0 commit comments

Comments
 (0)