Hello,
i configure my openhab2.4 in my raspy3B+.
I use only paper UI, and i can’t use a service trasformation for Modbus input.
Is there a solution to transform modbus data (in my case I have to divide the number by 2) without having to write code ?? I’m a newbie in programming.
Thank you all.
The short answer is no. This is going to require a little bit of code. You can create a Rule or you can create a JS Transformation.
The Modbus docs include an example for divide by 10. It’s not that hard to adapt; have a try and come back for help if you need it.
thank you very much for helping.
My problem, following the guide, is that on Raspberry I don’t know where to find the file to compile, of which the beautiful guides speak.
Also to add tags to items, I used restAPI which does it automatically.
I don’t know which file you are talking about. There is no compilation involved here.
transform overview:
You create a text file, called dividebytwo.js
or something like, and put it in your openHAB /transform/
folder.
You’ll need a text editor of some kind to put javascript into that file. That’s the script that will take the raw data from the binding, do something to it, and return a value to the binding. There’s no compiling, this script gets interpreted at runtime.
Then you add a read transform parameter to your binding data Thing that describes the kind of transformation you want to make - JS
- and the file you want it to use - dividebytwo.js
Um, okay. There are no tags involved here.
thank’s. i try it.
with notepad i have creata a file “dividebytwo” and put it in folder /trasform/ (OK, i make it with windows,
).After with paperUi i have write it:
.
but don’t work… what i havn’t understand???
Thank’s a lot
Okay, you need to give it some content as well - the actual javascript.
The docs include an example for divide-by-ten. You can modify that for divide-by-two.
When doing this sort of thing, you should keep an eye open for relevant messages in your openhab.log
and events.log
files.
thank’s a lot.
i don’t know why, but i have resaved a file, and now work!!!
!!
thank you very much