While developing the AirZone binding, @Jetblack31 brought to my attention that it is possible to control all HVAC zones at once by using a special value for the zone id (0)
Quite obviously, the binding end user could create groups with all zone channels and use that to control all its zones at once, but it can be quite tedious as there are at least 6 different channels that can be controlled for all zones at once.
As a result, I’m considering adding support for this special zone id, in which case the created Thing will only offer Write Only channels.
By Write Only, I mean that the channels will not have any meaningful value because there is no way to get a value for all zones. I mean, what’s the “all zones” value for “On/Off” or “Setpoint Temperature”?
So they will have the value from the latest command they have received and stick with that.
Or should I revert them to Under, Null, something else after the command has been received?
Is this “write only channels thing” something that has been done before?
Or is there a better way to offer such functionality?
I’m not sure it’s the best approach for this specific use case. Usually I see something like this implemented as an Action instead of a Channel. So in general:
- Incoming instantaneous event: Event Channel
- Bi-directional state: State Channel
- Outgoing instantaneous event: Rule Action
But a rule action isn’t super useful for this particular use case. You can’t put that on a sitemap (for example).
You could provide a aggregation functions as a Channel config similar to those available for Groups.
I wonder if the state of the Item should remain
NULL instead. Why pretend there is a state when there isn’t one. You’d have to disable autoupdate from the binding (which I understand it possible).
I’m interested to see what other ideas people have. It’s not a common use case but it seems like an interesting one.
Thank you @obones for developing the Airzone binding and taking into account my feedback.
In my view, the states of the zone 0 items should remain UNDEF.
The Airzone Cloud web interface offers the possibility of issuing commands to all zones (to change on/off, mode, setpoint). Each time a change is made to all zones, the setting comes back to UNDEF (eg. setpoint equals “–”, no mode selected… ).
I think we should stick to that for the binding.
I have done this a few times. Don’t update a state update of the channel and use autoupdate veto in the resource file, like here: https://github.com/openhab/openhab-addons/blob/8e187263990cf9801820dda98058cf9925a0ac75/bundles/org.openhab.binding.nikohomecontrol/src/main/resources/OH-INF/thing/thing-types.xml#L207
In the example, the typical use case is a push button that does not carry a state in itself.
Thanks, I’ll go with that approach.