Problem Statement
Sometimes one needs to create a flag, control, switch, or some other control that is not bound to a device or channel. For example, a Switch to override presence detection.
Concept
Create an Item that does not have a binding configuration.
Simple Example
Switch VirtualItem "label" <icon> (groups) // No binding config
See the Sensor Aggregation Design Pattern for a more complicated example. The Virtual Item is Override_Presence in that example.
Advantages and Limitations
Virtual Items are a good way to store state needed by rules and to provide a way to allow the user to modify the behavior of their rules by adjusting parameters stored in Virtual Items. Data stored in Virtual Items can also be persisted and restored on startup unlike global vars and vals.
Related Design Patterns
- Proxy Item: A Proxy Item is a special case for Virtual Items
- Sensor Aggregation: Override_Presence is a Virtual Item
- TimeOfDay: the TimeOfDay Item is a Virtual Item
- Separation of Behaviors: Uses a Virtual Item as the means to trigger the rules where the cross cutting logic is executed