How to transform your modbus data on openhab3(UI-driven!)

Hello all

I started with OH3 from scratch on a RPI4 2gb. I have some experience with OH2.x (filebased). I already have a running modbus binding on OH3 but I cant get my head around how to transform a modbus data thing through UI-driven configuration.
It’s actually quite simple, I want to divide it by 10.

I installed the Javascript Transformation 3.0.0.
My idea was to change the “default” Read Transform to “JS(divide10.js)”.
But then I dont know where to put the divide10.js script.
Or i am terribly wrong and too filebased minded…

So if you could point my thing in the right direction you would make my day.

Kind regards

Solved it myself

Through visual studio code I added the divide10.js script in the transform folder.

In the OH3 UI you can call the script by just filling in the script name. Without any brackets.

I had to reboot my raspberry pi because all my things where greyed out the first time I added the script to my modbus thing… Then it worked.

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