Custom Thing definition

Please help.
I have a thing that return 3 values in one line, i want add custom channels to thing to split values - is it possible?

Thing device m8_p34         [hostname="192.168.53.188", port="34", password="sec", refresh="5"]

String  m8p34_i2c   "i2c [%s]"   { channel="megad:device:in:m8_p34:i2c" }
returns: temp:24.17/press:765.63/hum:39.797

I want to define custom channel “i2cTemp” with transformation rule to get first value from line:

Thing device m8_p34         [hostname="192.168.53.188", port="34", password="sec", refresh="5"]
{
    Channels:
		State Number : i2cTemp "Temperature" [ transformationPattern="JS:megad_i2c_1.js"  ]
}

Number  m8p34_i2cTemp   "i2c [%.1f °C]"    { channel="megad:device:in:m8_p34:i2cTemp" }

But Item m8p34_i2cTemp is NULL, where is mistake?

Trasformation rule:

(function(msg){
    //temp:22.60/press:766.68/hum:39.463
    //     =====
    
    return msg.split("/")[0].split(":")[1];
})
(input)

The binding needs to support this. If it doesn’t then you can’t do it. If it does, you should find the documentation for how to do it in the binding’s readme.

That’s an MQTT only feature AFAIK. But you can use a “profile” instead. A profile sits in between a Channel and an Item. And if you use the “Script profile” (don’t know the exact name) you can execute a transformation basically.