JGKK
(Johannes)
June 20, 2019, 12:14pm
5
The real usefulness of groups is as you already said not in Sitemap as they don’t give you much control but it is in rules and persistence. You can do many things with the availability of the group based rule triggers and so on.
@rlkoshak has few great design patterns to give you some inspiration for use cases of groups.
Edit: Updates for OH 4, inclusion of JS Scripting and Blockly examples, removed the doors example as it’s superfluous.
Please see Design Pattern: What is a Design Pattern and How Do I Use Them for how to read and use DPs.
Problem Statement
One powerful way to consolidate code in rules is to use array/list manipulation operations on the members of a Group. For example, filter down to just those members that are ON, get a list of the labels of those Items that are NULL, etc.
Concept
[image]
T…
Edit: Updated for OH 4
See Design Pattern: What is a Design Pattern and How Do I Use Them for an explanation of what a DP is and how to use them.
Problem Statement
There are several reasons why a home automation enthusiast would want to use openHAB persistence: charting, using historical Item states in rules logic, restore previous values on openHAB restart, detailed analysis, access to the data with external tools, etc.
By default, a persistence add-on will implement a default strategy which…
Please see Design Pattern: What is a Design Pattern and How Do I Use Them to understand the scope and purpose of a design pattern. As with all DPs, the DP is not limited for the use demonstrated in the examples.
Problem Statement
This is going to be one of the more complex design patterns and it depends upon many other design patterns.
First of all, what is a state machine. For the purposes of this DP a state machine is a situation where when certain events occur a new state may be entered. A …
Best regards Johannes