You don’t have to use Profiles. You can do the transformation directly in your Thing. It looks like you’re using configuration files, so maybe check my lights.things example code part way through this post.
In either case, make sure you have installed the JSONPATH Transformation Service!
Hi, i installed the Transformation. When i configure the Item by Hand it workes.
Here is my Thing File
Bridge mqtt:broker:04448dbf25 "MqttBroker" [ host="192.168.178.41", port=1883, secure=false /* username="", password="", clientID="openhab2"/*/ ]
{
Thing topic Trockner "Trockner over MQTT" @ "Geräte" {
Channels:
Type string : reachable "Reachable" [ stateTopic="tele/Trockner/LWT" ]
Type switch : power "Power" [ stateTopic="stat/Trockner/POWER", commandTopic="cmnd/Trockner/POWER" ]
Type number : powerload "Power load" [ stateTopic="tele/Trockner/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Power"]
Type number : voltage "Line voltage" [ stateTopic="tele/Trockner/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Voltage"]
Type number : current "Line current" [ stateTopic="tele/Trockner/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Current"]
Type number : totaltoday "Total energy today" [ stateTopic="tele/Trockner/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Today"]
Type number : totalyest "Total energy yesterday" [ stateTopic="tele/Trockner/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Yesterday"]
Type number : total "Total energy total" [ stateTopic="tele/Trockner/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Total"]
Type number : rssi "WiFi Signal Strength" [ stateTopic="tele/Trockner/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]
}
}
In OH2 i used the item files and i want to do the same in OH3
in OH2 it looks like this
Number MiAqara_Bad_temp "Temperatur Bad [%d °C]" <temperature> (BadTemp,gTemp) { channel="mqtt:topic:0x00158d00044db0bc:temp" }
in OH3 it looks like this?
Number TrockneroverMQTT_Voltage "Spannung" {channel="mqtt:topic:04448dbf25:Trockner:voltage"[profile="transform:JSONPATH", function="$.ENERGY.Voltage", sourceFormat="%s"]}