Hello, I’ve something kinda weird with jsonpath transform in a rule
i’ve a sonoff mqtt item SONOFF_LAMPE_RGB_1_State
Depending on what was its last action, it could be
Case 1
SONOFF_LAMPE_RGB_1_State received update State= {“Time”:“2018-08-23T07:14:10”,“Uptime”:“0T11:24:29”,“Vcc”:3.385,“POWER”:“OFF”,“Dimmer”:100,“Color”:“FF00000000”,“HSBColor”:“0,100,100”,“Channel”:[100,0,0,0,0],“CT”:499,“Scheme”:0,“Fade”:“ON”,“Speed”:1,“LedTable”:“ON”,“Wifi”:
{“AP”:1,“SSId”:“NotAGoodWifi”,“RSSI”:100,“APMac”:“D8:32:14:D8:A5:11”}}
Or
Case 2
SONOFF_LAMPE_RGB_1_State received update State= {“POWER”:“OFF”}
I’ve got error when doing transform(“JSONPATH”, “$.CT”, json) on case 2
that’s ok, could be better if avoidable
But mainly I was expecting this to receive NULL or an empty string, but that’s not the case.
How to detect that the path “CT” is not found by the “JSONPATH” transform ?
Thank you
Aymeric