Jsonpath help - condition in path mqtt binding

Need your help with proper channel setup for extracting right value
i can receive many jsons on one mqtt topic ;( - the clue is to split based on “id:” field and capture some of the fields belonging to given id. i Created a think and its working with Incoming Value Transformations: JSONPATH:$.zoneUpdate.armed

but i don’t know how to catch ID:0 and ID:x to different channels in mqtt binding. Any help will be more than welcome
i tried with $.zoneUpdate[?(@.id==1)].armed but with now luck :frowning:

{
“zoneUpdate”: {
“id”: 0,
“name”: “czujka ruchu pir”,
“status”: “online”,
“sensorStatus”: “normal”,
“tamperEvident”: true,
“shielded”: false,
“bypassed”: false,
“armed”: true,
“isArming”: false,
“alarm”: false,
“subSystemNo”: 2,
“linkageSubSystem”: [
2
],
“detectorType”: “passiveInfraredDetector”,
“stayAway”: false,
“zoneType”: “Instant”,
“accessModuleType”: “localTransmitter”,
“moduleChannel”: 1,
“zoneAttrib”: “wired”,
“deviceNo”: 2,
“abnormalOrNot”: false
}
}

Thank you - not sure how to catche the id:0 inside the json not in the mqtt topic itself.

i can post only to one topic “AXPRO” and i get jsons with few different id:x

REGEX:({“zoneUpdate”:{“id”:0")∩JSONPATH:$.zoneUpdate.armed it not working ;(

You don’t. JSONPATH doesn’t support that. That’s why you set up separate Channels which all subscribe to that one topic. Then you use the REGEX to cause that Channel to only match messages with id=0 (for example) and then the full message gets passed to the JSONPATH.

Note, the restrictions on REGEX still apply. The pattern must match the entire message and the first matching Group is what gets returned.

REGEX:(.*"id": 0.*)∩JSONPATH:$.zoneUpdate.armed it not working

Be carefule with the spaces between the : and 0.