Exclamation point mark in jsonpath?

Hello,

my tasmota zigbee box is sending me some messages like this one:
tele/zbbridge/remoteikea1/SENSOR = {“remoteikea1”:{“Device”:“0x0C0D”,“Name”:“remoteikea1”,“FC80!03”:“00”,“Endpoint”:2,“LinkQuality”:112}}

I try to setup my thing with this line
Type number : Option1short “Option1-short” [stateTopic=“tele/zbbridge-p/remoteikea1/SENSOR” , transformationPattern=“REGEX:(.Endpoint":2.)∩JSONPATH:$.remoteikea1.FC80!03” ]

but it is not working, I have tried to replace !03 with an asterisk but same issue : not working

I have tried to \x21 the !, but it is not working too :frowning_face:

Any idea to use ! in a JSONPATH ?

Thanks

I suppose all quote marks (“ and ”) are actually straight quotes (").

One problem I see in the above is that your topic example

tele/zbbridge/remoteikea1/SENSOR

Differs from the stateTopic in your thing definition

tele/zbbridge-p/remoteikea1/SENSOR

So is the exclamation mark the actual problem?

yes it is, bad obfuscation :slight_smile:

I have found my issue, I’m using files to setup my items, and a previous bad duplicated line was kept in OH even if it was fixed in source files.

I’ve renamed all the items, restored the name and tada it is solved.
Still need to add more regex to filter last noisy warning messages for unhandled messages.

So question mark seems to work fine,

Thanks for your help

You have to write the path slightly different. And please be aware that REGEX pattern must pass the whole string, not only a part of it (so don’t forget the asterisks *)

transformationPattern="REGEX:(.*Endpoint.: 2.*)∩JSONPATH:$.remoteikea1['FC80!03']" ]

Hello Udo_Hartmann,

This is my full things channel line:

Type number : Option1short "Option1-short" [stateTopic="tele/zbbridge-p/remoteikea1/SENSOR" , transformationPattern="REGEX:(.*Endpoint\":2.*)∩REGEX:(.*FC80!01.*)∩JSONPATH:$.remoteikea1.FC80!01" ]

I could replace the " with a . but I’ve prefered escape the double quote

since I have cleaned the old bad setup in cache, everything is working fine

Thanks for your feedback :slight_smile:

1 Like