[SOLVED] Paper UI - Incoming value transformation

I just moved from text configuration more and more to user paper ui. so far so good. i started confuring MQTT thing, mostly generic mqtt binding. how do i apply the transformation in channel configuration ? i would like to use a javascript transformation strored in tranform.

Any supported transformation service can be used.what that mean ? for a test.js(data) how the parameters have to look like ?

thanks in advance

Lars

Please also consult the binding documentation page, not only Paper UI. There are some examples of how to use a transformation. You need the transformation name, that can also be found in the documentation.

Hi David,

i do know how to use it in the binding in an items file, but not in paper ui. i tried and it did not work, can you point me to the description ? i can’t find it

thanks in advance

You mean Thing file? Or are you talking about mqtt1 where you defined in an item file? The syntax to mqtt is similar but instead of transname(Argument) you write transname:argument. But that is shown as description below the field on paper UI, so I don’t really understand your problem right now.

JS:test.js
Should do the job

thanks! worked!

Please tick the solution post, thank.

how can show my rssi state in

Do you use tasmota ?

yes i use tasmota

Topic: tele/sonoff-xxxxxx/STATE
Tranformation: JSONPATH:$.Wifi.RSSI

tanks my friend

Hello Guys
I’m struggling to get the paper UI to transform from a Json Path to a DateTime value. I’ve got my topic configured and working and value transformation setup as follows:
JSONPATH:$.Time
but the value displayed on my control window is S%. I’m assuming this is because my “Time” value arrives as “2019-03-02T11:02:21” which includes seconds, how do i instruct Openhab to trim the second values using paper UI?
I’ve seen a lot of example where people have used scripts to do this but I’m hesitant to do this as I’ve already encountered issues using scripts together with the paperUI config approach.

What is the item?
What UI do you use?
Can you post the thing and channel, please?

Its a sonoff basic switch with tasmota firmware,
Im configuring through PaperUI
I’m using an mqtt bridge to connect to it
Channel type DateTime
Topic is tele/Sonoff_XXXX/STATE
Incoming value transformation " JSONPATH:$.Time "

Is it possible to combine multiple transformers like:
JSONPATH:$.water_tank_temperature > then > JS:C2F.js

Yes in the snapshots that’s possible. Concatenate them with the mathematical intersection “∩” character. That should be part of the documentation, is it not?

I have a troubles with json data and converting it to the rgb channel. I try to use this expression :
JSONPATH:$.pwm.0,JSONPATH:$.pwm.1,JSONPATH:$.pwm.2
But in logs i see errors.

My incoming json data is “pwm” :{“0”:1,“1”:10,“2”:100}
Please help with correct expression for transformation from json topics to rgb.

That’s not possible with JSONPATH. You would use the javascript transformation instead and write a small conversion in javascript. Remember that this is an expensive operation (spinning up a javascript engine inside the java virtual machine) so the values shouldn’t change too frequently.

Thank you, @David_Graeff i suppouse to do this using rules is better way.