Hi All,
After upgrading from OH2 to OH3 I noticed some of my MQTT items were not able to transform:
2021-11-02 16:10:01.356 [WARN ] [rest.core.item.EnrichedItemDTOMapper] - Failed transforming the state '0.14' on item 'mqtt_topic_radiation_dose' with pattern 'JSONPATH($.dose):%f.5 mSv/h': Cannot format state '0.14' to format '%f.5 mSv/h'
2021-11-02 16:10:01.386 [WARN ] [rest.core.item.EnrichedItemDTOMapper] - Failed transforming the state '21.06' on item 'mqtt_topic_radiation_cpmTotal' with pattern 'JSONPATH($.cpmTotal):%d CPM': Cannot format state '21.06' to format '%d CPM'
2021-11-02 16:10:01.403 [WARN ] [rest.core.item.EnrichedItemDTOMapper] - Failed transforming the state '18' on item 'mqtt_topic_radiation_cpmMinuteAverage' with pattern 'JSONPATH($.cpmMinuteAverage):%d CPM': Cannot format state '18' to format '%d CPM'
Even after Installed the MQTT binding and the JSONPath transform, this error remained.
I have read the documentation, but I cannot discern where I went wrong. Hope yall can help me see the error through the chars
rads.things
Bridge mqtt:broker:3525be49 [ host="127.0.0.1", secure=false ]
{
Thing mqtt:topic:radiation
{
Channels:
Type number : cpmTotal "cpmTotal: " [ stateTopic="/radiation", transformationPattern="JSONPATH:$.CPMTotal" ]
Type number : cpmMinuteAverage "cpmMinuteAverage: " [ stateTopic="/radiation", transformationPattern="JSONPATH:$.cpmMinuteAverage" ]
Type number : dose "RadDosage: " [ stateTopic="/radiation", transformationPattern="JSONPATH:$.dose" ]
}
}
rads.items
Number mqtt_topic_radiation_cpmTotal "cpmTotal: [JSONPATH($.cpmTotal):%d CPM]" <radiation_round> (gRadiationCPM) {channel="mqtt:topic:radiation:cpmTotal"}
Number mqtt_topic_radiation_cpmMinuteAverage "cpmMinuteAverage: [JSONPATH($.cpmMinuteAverage):%d CPM]" <radiation_round> (gRadiationCPM) {channel="mqtt:topic:radiation:cpmMinuteAverage"}
Number mqtt_topic_radiation_dose "dose: [JSONPATH($.dose):%f.5 mSv/h]" <radiation_triangular> (gRadiationDose) {channel="mqtt:topic:radiation:dose"}
this is how the payload is structured (copied from the ESPās serial console)
MQTT Connected
Connecting to as ESP-5c:cf:7f:5a:3e:b3-48
Connected to MQTT broker
topic is: /radiation
Publish ok
{"CPMTotal":13.71,"cpmMinuteAverage":10.00,"dose":0.09}
{"CPMTotal":13.71,"cpmMinuteAverage":10.00,"dose":0.09}
Publish OK!
itās probably something obvious but dyslexia/dyscalculia is making those minor differences hard to discern for me.