I receive this string of data from my MQTT input:
{“z1”:{“cool”:82,“heat”:67},“z2”:{“cool”:77,“heat”:67},“z3”:{“cool”:76,“heat”:68}}
It represents three zones of a HVAC unit and the set points for cooling and heating in those zones.
I’m trying to extract zone1’s cooling set value to display in the BASIC UI with this items config:
String zone1cool "zone1cool"
{
mqtt="<[NikMQTT:dhstddit/feeds/zone:state:JSONPATH($.z1.cool)]"
}
I get this error:
2018-04-22 21:37:18.007 [ERROR] [.mqtt.internal.MqttMessageSubscriber] - Error processing MQTT message.
org.openhab.core.transform.TransformationException: Invalid path ‘$.z1.cool’ in ‘{“z1”:{“cool”:82,“heat”:67},“z2”:{“cool”:77,“heat”:67},“z3”:{“cool”:76,“heat”:68}}’
at org.openhab.core.transform.TransformationHelper$TransformationServiceDelegate.transform(TransformationHelper.java:67) [207:org.openhab.core.compat1x:2.2.0]
at org.openhab.binding.mqtt.internal.MqttMessageSubscriber.processMessage(MqttMessageSubscriber.java:138) [222:org.openhab.binding.mqtt:1.11.0]
at org.openhab.io.transport.mqtt.internal.MqttBrokerConnection.messageArrived(MqttBrokerConnection.java:556) [208:org.openhab.io.transport.mqtt:1.11.0]
at org.eclipse.paho.client.mqttv3.internal.CommsCallback.deliverMessage(CommsCallback.java:475) [208:org.openhab.io.transport.mqtt:1.11.0]
at org.eclipse.paho.client.mqttv3.internal.CommsCallback.handleMessage(CommsCallback.java:379) [208:org.openhab.io.transport.mqtt:1.11.0]
at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:183) [208:org.openhab.io.transport.mqtt:1.11.0]
at java.lang.Thread.run(Thread.java:748) [?:?]
I’d appreciate help in understanding what needs to happen and what I don’t understand correctly.
Ultimately, I’d like to display zone1 2 and 3 cooling set points and heating set points from this string of data. What’s the best way to do this in BasicUI? Set up Items for each: z1cooling, z1heating, etc… or is there another method to do this?
thank you for the help.