… actually, the JSONPATH transformation is working with the numeric filter. I verified by enabling DEBUG on the JSONPATH bundle. The NULL is actually presented on the linked string item. There is a warning in the openhab.log from the JSONPATH bundle:
2023-01-22 14:42:07.641 [DEBUG] [ternal.JSonPathTransformationService] - about to transform '{"elements":[{"begin":"2023-01-22T23:00:00+01:00","end":"2023-01-23T00:00:00+01:00","price":15.356},{"begin":"2023-01-23T00:00:00+01:00","end":"2023-01-23T01:00:00+01:00","price":14.896},{"begin":"2023-01-23T01:00:00+01:00","end":"2023-01-23T02:00:00+01:00","price":14.9}],"next_offset":null}' by the function '$..[?(@.price<15)]'
2023-01-22 14:42:07.642 [DEBUG] [ternal.JSonPathTransformationService] - transformation resulted in '[{"begin":"2023-01-23T00:00:00+01:00","end":"2023-01-23T01:00:00+01:00","price":14.896},{"begin":"2023-01-23T01:00:00+01:00","end":"2023-01-23T02:00:00+01:00","price":14.9}]'
2023-01-22 14:42:07.642 [WARN ] [ternal.JSonPathTransformationService] - JsonPath expressions with more than one result are only supported for Boolean, Number and String data types, please adapt your selector. Result: [{"begin":"2023-01-23T00:00:00+01:00","end":"2023-01-23T01:00:00+01:00","price":14.896},{"begin":"2023-01-23T01:00:00+01:00","end":"2023-01-23T02:00:00+01:00","price":14.9}]
The item I linked to the channel is of type string. So what’s the deal with the “selector”?
Fun fact: when the numeric filter is returning a single JSON element, the linked string item is presenting it just fine. So any hint how to access the filtered multiple JSON elements by a linked item?
Edit: the fine difference of single vs. multiple results is the square brackets. Also the missing quotes. So single results is indeed a string, but multiple results is a JSON still?!
'{begin=2023-01-23T03:00:00+01:00, end=2023-01-23T04:00:00+01:00, price=14.759}'
vs.
[{"begin":"2023-01-23T00:00:00+01:00","end":"2023-01-23T01:00:00+01:00","price":14.896},{"begin":"2023-01-23T01:00:00+01:00","end":"2023-01-23T02:00:00+01:00","price":14.9},{"begin":"2023-01-23T02:00:00+01:00","end":"2023-01-23T03:00:00+01:00","price":14.84},{"begin":"2023-01-23T03:00:00+01:00","end":"2023-01-23T04:00:00+01:00","price":14.759},{"begin":"2023-01-23T04:00:00+01:00","end":"2023-01-23T05:00:00+01:00","price":14.988}]
Thanks