I am using OpenHab with Zigbee2MQTT as Bridge to my zigbee devices.
As an example this remote control:
Thing topic tradfriRemote2 "Tradfri Remote 2" {
Type string : tradfriRemote2 [stateTopic="zigbee2mqtt/remote-tradfri-2", transformationPattern="JSONPATH:$.action" ]
Type number : battery [stateTopic="zigbee2mqtt/remote-tradfri-2", transformationPattern="JSONPATH:$.battery" ]
}
Sometimes these zigbee things (or let it be zigbee2mqtt) don’t send the complete mqtt message, so e.g. sometimes it sends the battery status only, without a “action” part in the mqtt message. This causes error messages in the log everytime:
2024-10-17 12:06:27.025 [WARN ] [t.generic.ChannelStateTransformation] - Executing the JSONPATH-transformation failed: Invalid path '$.action' in '{"battery":80,"linkquality":21,"update":{"installed_version":604241925,"latest_version":604241925,"state":"idle"}}'. Pattern: '$.action'. Value: '{"battery":80,"linkquality":21,"update":{"installed_version":604241925,"latest_version":604241925,"state":"idle"}}'
It does not harm anything but I generally don’t like error messages in my logfiles Do you have any idea how I could avoid these parsing issues?