Effects of readOnly in thing-description - state-description

Hi all,
can you help me understand the effects of the readOnly-Attribute of a channel-type inside the thing description?

<state min="12" max="30" step="0.5" pattern="%.1f %unit%" readOnly="false"></state>

I’m currently developing a binding. I would like to achieve, that only my binding is able to update the items that are linked to certain channels.
I tried to verified it by creating a rule with an “update the state of …” targeting an item linked to a readOnly channel. But regardless of the readOnly-Attribute, the item can be changed by executing the rule.

I would expect that this is not possible.

Best,
Frederic

I believe it only adds a hint to the UI for the default widget to present for that Item.

That is counter to what Items are and how Items work. Bindings are not supposed to even be aware of nor have access to the Items. If the Items are binary, a Contact is an Item type that cannot be commanded.

But you cannot prevent any Item from being updated.

For something like you describe, perhaps an Action would be a more appropriate approach. That way they can only interact with those Channels through an Action. But that doesn’t necessarily work for all use cases.

Thanks for the clarification, Rich!

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.