The rule is a crackers idea. If you update a modbus connected Item to some new value … what do you think is going to happen a half-second later when the next modbus poll happens.
Ditch that, delete it.
The WARN message has nothing to do with the rule. You’ve obviously found the Transformation part of the binding notes. That’s good, that’s the part we should make work - the “magic” then happens automatically between modbus and your Item.
You need to make a divide by 10 javascript, and put it in the /conf/scripts folder of your openHAB.
In the data Thing corresponding to your Item’s channel, you add a readTransform= parameter specifying the type of transformation and the name of your script. It’s in the docs.
I am no coding specialist…
but i found that in the docs:
" transform/divide10.js :
// Wrap everything in a function (no global variable pollution)
// variable "input" contains data passed by openhab
(function(inputData) {
// on read: the polled number as string
// on write: openHAB command as string
var DIVIDE_BY = 10;
return parseFloat(inputData) / DIVIDE_BY;
})(input)
Is this the java script you thinking about ?
I put it with nano in to the /conf/folder
But how should i add that readTransform= parameter to the thing ?
You need to put the little srcipt into /conf/scripts/
Again, it’s in the docs, further down the examples.
You add a readTransform= to each data thing that needs the read divide by 10. All of them share the same script.
How did you add/edit the modbus data things for your configuration? You must do it the same way. It’s just another parameter for a data thing.
Guessing you are using PaperUI, find the ‘read transform’ box and put in it
JS(divide10.js)
The JS parts tells openHAB it’s javascript, because there are several types of transformations
The divide10.js is the name of your file in /conf/scripts/
Ok,
as far as I can see in the paperUi item “Abluft” does have the same settings like “Zuluft” but “Abluft” Shows decimal point but “Zuluft” does not.
Can you tell me where to find the file for items made with paperUi to have a closer look?
Now one comes the next thing.
I want add some Switches to set the speed of the Vents. I can set them 0 - 1 - 2 - 3, Off - Low - Middle - High.
This is written here in the Fans seed Register