Provide OH3 value from CallLIst

Hello,

The Channel Call List from Binding TR 064 provides this information after the end of a connection and expands the 7-day list that is stored in openHAB 3 as item ‘FritzBox_CallList7’:

2022-11-25 15:41:15.966 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'FritzBox_CallList7' changed from [{"localNumber":"654321","remoteNumber":"0301234567","date":"2022-11-24T18:21:00+01","type":3,"duration":5},
{"localNumber":"654321","remoteNumber":"01727654321","date":"2022-11-24T18:19:00+01","type":1,"duration":2},
....
]

The list is sorted in descending order, most recent connection first.

How can I now filter out the values “type” and “duration” of the last connection within a rule in order to then transfer them to existing items?

I hope you can help me.

“Last” meaning “most recent” i.e. first in the list?
Raw data appears to be JSON, so I’d use transform JSONPATH in a rule with something like $.[0].type

“Last” means “last connection” and you got it right, it’s the newest one in the list.

However, I am not familiar with JSONPATH. Could she complete the following rule?

rule "Anruf beendet"
when
    Item fritzCallRinging changed from DIALING to IDLE
then

here your idea please!

end

Suggested examples

The openHAB JSONPATH Transformation Service is an optional add-on, you will need to install it.