Some details about the auto update behavior…
There is an AutoUpdateGenericBindingProvider
(binding name: autoupdate
) that is responsible for optionally doing the post-command update of an item. In the typical case, bindings have no direct interaction with the autoupdate behavior although a binding may update the item state itself independent of any autoupdate configurations.
However, if any binding provider implements the AutoUpdateBindingProvider
interface, then it provides an autoUpdate(itemName)
method that returns a Boolean value indicating if a specific item should be autoupdated or not. The following binding providers implement the interface and provide varying implementations for the autoUpdate
function.
- AlarmDecoderGenericBindingProvider (always returns true)
- AutoUpdateGenericBindingProvider (parses {autoupdate=“”} binding configs, default is true)
- HDanywhereGenericBindingProvider (always returns false)
- IhcGenericBindingProvider (always returns null)
- InsteonPLMGenericBindingProvider (always returns true)
- KNXGenericBindingProvider (derived from datapoint configuration)
- PlugwiseGenericBindingProvider (always returns false)
- RFXComGenericBindingProvider (always returns null)
- ZWaveGenericBindingProvider (always returns false)
If a binding returns null, it appears to me this is a no-op and has no effect on the autoupdate behavior. If the binding returns false, then this means the binding is requesting that autoupdate be disabled (but the request may be overridden by other binding providers). If the binding returns true, this will enable autoupdate for all items.
When multiple AutoUpdateBindingProvider
binding providers exist, the behavior is interesting and potentially surprising. According to the Javadocs, the AutoUpdateBinding…
"Iterates through all registered AutoUpdateBindingProvider
s and
checks whether an autoupdate configuration is available for itemName
.
If there are more then one AutoUpdateBindingProvider
s providing
a configuration the results are combined by a logical OR. If no
configuration is provided at all the autoupdate defaults to true
and an update is posted for the corresponding State."
As stated earlier, a null value is ignored (represents neither true nor false).
(Warning: I haven’t done runtime testing of the following information yet, so there may be inaccuracies!)
It appears to me that if one of the binding providers that returns true for all items is present (Insteon and AlarmDecoder), then autoupdate will be enabled for all items regardless of any {autoupdate=“false”} binding config on an item. This is globally true even for items completely unrelated to those binding providers.
For binding providers that always return false, that behavior can be overridden by an item autoupdate binding config. However, it seems that this also globally changes the default autoupdate binding behavior to be disabled rather than enabled. For example, if a item has no autoupdate binding config and the ZWave addon is present, then the item (which may be completely unrelated to ZWave) will have it autoupdate behavior disabled. Without the ZWave component it would be enabled by default.
If my analysis is correct, then I’d recommend that any binding provider implementing ‘AutoUpdateBindingProvider’ should check if the item being queried in the autoUpdate
function is an item associated with their binding and return null for any that are not. However, if a item command is processed by multiple bindings, there still may be surprising interactions.