But how to convince the item to show the percentage value correctly?
I tried Pattern "%s %%". It shows “4 %”, but with an error message Could not transform state '4' with function 'JS:transform/MultiplyBy100.js' and format '%s'.
From a recent post, I found hints regarding JavaScript returns a String only:
This has been improved for OH3, the profile framework should now attempt to parse the transform’s string output into the Item type, e.g. “3.0” should be usable with a Number Item, just as you can do someNumber.postUpdate("3.0") and expect the framework to parse it.
This new feature should be included in the milestone
The output of the javascript that you are using in your transform profile is numeric only.
If you want that to be a percentage in your Number:Dimensionless type Item, you’ll need to append the units string " %" to your javascript result before returning it.
I don’t think that’s the source of the error though. When showing ius error messages, please show the whole log line as it includes some hint about message source.
Adding the item type to dimmer → error message is gone. Thx.
The KNX channel type is “number” with group adress 5.001:10/5/30, no other log message entry.
What is challenging for me: it took 6 hours so far to handle that percentage character issue.
It seems that everything depends on everything…
KNX DPT
if changed, restart is necessary. No hint in the UI, only in the KNX binding docs
KNX channel type
which can´t be changed
Item type
Item profile
Following rossko57´s advice - I played with the Javascript, added the " %" before returning.
Weird is that the changed script is not reliably recognized even after restarting openhab.
Isn´t there some file system checking implemented to update any cache? Why is it file system based and not integrated in the UI?
Gave up with that one, too complicated at the moment
Item state description
In the item overview, the percent is not shown, but in the details (see below)