ok, apologies for the delay, I was home late yesterday and did not switch on the laptop.
Ok, so here is the item:(I did away with the transform on a site label , as you all recommended):from the .items file
/* Diagnostics */
String i_TRV_Lounge_Diag1 { channel="mqtt:topic:b_MQTT_Broker:t_TRV_Lounge:c_Diagnostics" [profile="transform:JSONPATH", function="<jsonPath>", sourceFormat="$.[\'Motor current below expectation\']"] }
…the item contents and the transformation error (both from openhab.log,file:
2020-01-13 10:44:19.319 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'TRV.items'
2020-01-13 10:44:19.523 [WARN ] [ofiles.JSonPathTransformationProfile] - Could not transform state '{
"Motor current below expectation": false,
"Motor current always high": false,
"Motor taking too long": false,
"discrepancy between air and pipe sensors": false,
"air sensor out of expected range": false,
"pipe sensor out of expected range": false,
"low power mode is enabled": false,
"no target temperature has been set by host": false,
"valve may be sticking": false,
"valve exercise was successful": false,
"valve exercise was unsuccessful": false,
"driver micro has suffered a watchdog reset and needs data refresh": false,
"driver micro has suffered a noise reset and needs data refresh": false,
"battery voltage has fallen below 2p2V and valve has been opened": false,
"request for heat messaging is enabled": false,
"request for heat": false
}' with function '<jsonPath>' and format '['Motor current below expectation']'
I have not linked the item to a sitemap label as yet because I’m just trying to get the item definition working.
Other item definitions of the transform JSON source strain I tried were:
** No period/dot after the $
String i_TRV_Lounge_Diag1 { channel="mqtt:topic:b_MQTT_Broker:t_TRV_Lounge:c_Diagnostics" [profile="transform:JSONPATH", function="<jsonPath>", sourceFormat="$[\'Motor current below expectation\']"] }
and
** Use double quotes instead of single
String i_TRV_Lounge_Diag1 { channel="mqtt:topic:b_MQTT_Broker:t_TRV_Lounge:c_Diagnostics" [profile="transform:JSONPATH", function="<jsonPath>", sourceFormat="$.[\"Motor current below expectation\"]"] }
and
** Remove period/dot and use double quotes
String i_TRV_Lounge_Diag1 { channel="mqtt:topic:b_MQTT_Broker:t_TRV_Lounge:c_Diagnostics" [profile="transform:JSONPATH", function="<jsonPath>", sourceFormat="$[\"Motor current below expectation\']"] }
and
** Remove period/dot and use single quotes
String i_TRV_Lounge_Diag1 { channel="mqtt:topic:b_MQTT_Broker:t_TRV_Lounge:c_Diagnostics" [profile="transform:JSONPATH", function="<jsonPath>", sourceFormat="$[\"Motor current below expectation\']"] }
Rather bizzrely, the last definition above “works” as in throws no error, but yields a strange string…
M. { "Motor current below expectation": false, "Motor current always high"
mmm???