ioBroker.knx
ioBroker.knx copied to clipboard
Do not set write:true by default as workaround for Status Objects
It has in several Issues and on the Forum been explained that common.write is set to true at import for KOs that has the Transmit Flag (Ü) but not Write Flag. Reason should be that it is a workaround to manually trigger a GroupValueRead with the use of writing something to the Object.
But it's not really logical that a KNX readonly object has to have write permissions in ioBroker! After some testing, I found actually out it seems it's not necessary to write-enable the objects.
It's already possible to write something to a read-only object in ioBroker, either using:
- the Expert Mode in Admin
- or when using a script.
So, if it's no other important use-cases where the workaround setting write:true is required, I would suggest that the import function is changed to avoid setting write to for KOs that doesn't have write enabled.
Originally posted by @chefkoch009 in https://github.com/ioBroker/ioBroker.knx/issues/67#issuecomment-524615736 "I've seen the problem. Short explanation: on KNX a KO can send a value by itself on the Bus (Ü-Flag) or you can trigger it by sending a groupValue-Read (L-Flag). But ioBroker can Change the value or read a value. But in the read- Case you are Not able to trigger a READ. So the question for me was, how to make a read-trigger possible vor ioBroker. It Happens, If the READ AND WRITE Flags in the ioBroker objects are Set. That means If you Set the read-flag to false and the WRITE flag to true, then you will have the expected behaviour.
Read=true, WRITE=true =>you are able to trigger a groupValue READ Read=false,WRITE =true=> write the given value on KNX-bus Read=true, WRITE=false=> receive a value-change, but Not able to trigger a read
At the Moment i don't know how realize that in a better way.....so i'll be happy about suggestions."
As reference: Writing to read-only objects using Expert Mode in Admin has been discussed in https://github.com/ioBroker/ioBroker.admin/issues/583
@Videonisse I disaree to your proposal to change the knx adapter for the purpose you mentioned. To enable write flag in iobroker is of course logical and enables other adapters to change the state values which is required fr at least more thna 10 iobroker project setups. To achieve this by scripting seems for your expert a reasonable way but we should not loose other iobroker user which are not so advanced in using scriots etc.
@RESDE Okey, if this workaround is needed for other adapters to trigger a GroupValueRead on the KNX-bus, then it should of course continue to be supported.
But I assume it must be more of an exception and not needed as standard? (maybe you could give some examples where it's needed?)
If the workaround is not needed for most ioBroker installations, I would suggest it could be enabled via a setting in the KNX Adapter Settings and be disabled as default. Then it's not confusing regular users and everyone who needs it can enable it and just do a new import.
Could this be a feasible path forward?
I found another point of view of this current workaround; some of the Object Roles can/should not be used because they require that the read/write settings are correct.
Is that also the reason why all Status objects that are identified as a Group Address Pair during Import, always has Role = State?
What other consequences does it have when all Status objects are default set to write and read = true, instead of the correct behaviour based on ioBroker core documentation?
For example the Roles:
- Sensor (Boolescher Wert, schreibgeschützt)
- Botton/Tasten (Boolscher Wert, nur Schreiben)
- Value/Werte (Zahlen, schreibgeschützt)
- Indicator/Indikatoren (Boolean, schreibgeschützt)
See Documentation: https://www.iobroker.net/#de/documentation/dev/stateroles.md?sensorboolescherwertschreibgeschtzt