MQTT working but still getting JSON transform state errors

  • Platform information:
    • Hardware: Synology
    • OS: _DSM6.2
    • Java Runtime Environment: V8
    • openHAB version:2.5.0-snapshot running in Docker
      *MQTT binding 2.5.0
    • Issue of the topic:

i managed to get my temperature sensors up and running in openhab

my sensor is sending this

{
“Battery” : 100,
“RSSI” : 6,
“description” : “”,
“dtype” : “Temp”,
“id” : “6659”,
“idx” : 288,
“name” : “Temperatuur tuin”,
“nvalue” : 0,
“stype” : “TFA 30.3133”,
“svalue1” : “26.1”,
“unit” : 3
}

i made a thing with these settings(all from the gui, no config files)

MQTT state topic
domoticz/out/tuin/temperature

Transform values
Incoming value transformations
JSONPATH:$.svalue1

Outgoing value format
%.1f

LINKED ITEM with string profile

JSONPATH (transform:JSONPATH)
Configuration:

JSONPath expression
$.svalue1

State Formatter
%s

everything seems to work and i got my temp item which updates regularly
The problem is my log gets flooded with this message

2019-06-23 16:28:43.264 [WARN ] [ofiles.JSonPathTransformationProfile] - Could not transform state ‘26.1’ with function ‘$.svalue1’ and format ‘%s’

it seems to have problems transforming the temperature value (i guess string) into something else.
The strange thing is that the value is displayed nicely so it is declared properly.
what can be causing this issue.

seems to be really simple

Have you applied your transform twice, once in the MQTT Thing and once in the Item’s channel profile?

it looks that way. i tried other ways that did not work

i selected default profile and follow profile but with those the temp does not change anymore

Well obviously you cannot JSON transform it twice identically in succession.

The existing transform profile has a restriction that it will not parse the transform’s string output to non-string Item types.
Guessing you want your temperature to be a Number type Item, I’d abandon that method.

Follow type profile serves no useful purpose here.

Fortunately MQTT binding supports transforms on the channel. Just pick the channel type that matches your target Item type, probably number.

ok. so standard channel and link that channel using jsonpath profile.

i will try tonight.
thanks

I was suggesting exactly the opposite, no profile, and apply the transform to a channel under the MQTT Thing.

1 Like

OK.
i have created a channel and filled in the transform info.
i then created a link and used the default(what is the difference with follow)

it seems to work.(temps change)
tried it the other way around but leaving the channel empty did not work.