Hello everyone,
on the basis of Openhab 3.1 I have now achieved a working result. I still don’t have the option to save incoming and outgoing phone numbers with names. Under the link
I found an example from @Bredmich, but this refers to the binding Fritzbox TR-064 1.9.0 SNAPSHOT.
My attempts to save the calls in dummy items or in existing ones have always failed. Preferably I would build the code into the existing rules, but other variations are also accepted.
If someone can help me on the subject, I would be very happy.
Greetings
Item:
Group gCALLMONITOR "Call Monitor" ["Equipment"]
Call fritzIncomingCall "Eingehender Anruf [von %2$s an %1$s]" (gCALLMONITOR) ["Point"] { channel="avmfritz:fritzbox:xxx_xx_xxx_x:incoming_call" }
Call fritzActiveCall "Aktiver Anruf [von %1$s]" (gCALLMONITOR) ["Point"] { channel="avmfritz:fritzbox:xxx_xx_xxx_x:active_call" }
Call fritzOutgoingCall "Ausgehender Anruf [von %2$s an %1$s]" (gCALLMONITOR) ["Point"] { channel="avmfritz:fritzbox:xxx_xx_xxx_x:outgoing_call" }
String fritzCallRinging "Status [%s]" (gCALLMONITOR) ["Point"] { channel="avmfritz:fritzbox:xxx_xx_xxx_x:call_state" }
String fritzIncomingCallCallee "Eingehender Anruf - Angerufener [%s]" (gCALLMONITOR) ["Point"] { channel="avmfritz:fritzbox:xxx_xx_xxx_x:incoming_call" [profile="transform:PHONEBOOK", phonebook="tr064_3Afritzbox_3A1"] }
String fritzIncomingCallCaller "Eingehender Anruf - Anrufer [%s]" (gCALLMONITOR) ["Point"] { channel="avmfritz:fritzbox:xxx_xx_xxx_x:incoming_call" [profile="transform:PHONEBOOK", phonebook="tr064_3Afritzbox_3A1", phoneNumberIndex=1, matchcount="8"] }
String fritzActiveCallCaller "Aktiver Anruf - Anrufer [%s]" (gCALLMONITOR) ["Point"] { channel="avmfritz:fritzbox:xxx_xx_xxx_x:active_call" [profile="transform:PHONEBOOK", phonebook="tr064_3Afritzbox_3A1"] }
String fritzOutgoingCallCallee "Ausgehender Anruf - Angerufener [%s]" (gCALLMONITOR) ["Point"] { channel="avmfritz:fritzbox:xxx_xx_xxx_x:outgoing_call" [profile="transform:PHONEBOOK", phonebook="tr064_3Afritzbox_3A1"] }
String fritzOutgoingCallCaller "Ausgehender Anruf - Anrufer [%s]" (gCALLMONITOR) ["Point"] { channel="avmfritz:fritzbox:xxx_xx_xxx_x:outgoing_call" [profile="transform:PHONEBOOK", phonebook="tr064_3Afritzbox_3A1", phoneNumberIndex=1, matchcount="8"] }
Rules:
rule “Eingehender Anruf”
when
Item fritzCallRinging changed to RINGING
then
// die Rufnummern mit avmfritz Binding zerlegen
val incCall = fritzIncomingCall.state as StringListType
val ourNumber = incCall.getValue(0)
val callerNumber = incCall.getValue(1)
var String msg = "Eingehender Anruf: " + fritzIncomingCallCaller.state + " (" + callerNumber + ") auf " + ourNumber
logInfo("FRITZ!Box", msg)
end
rule “Ausgehender Anruf”
when
Item fritzCallRinging changed to DIALING
then
// die Rufnummern mit avmfritz Binding zerlegen
val outCall = fritzOutgoingCall.state as StringListType
var String calledNumber = outCall.getValue(0)
var String ourNumber = outCall.getValue(1)
var String msg = "Ausgehender Anruf: " + fritzOutgoingCallCallee.state + " (" + calledNumber + ") über " + ourNumber
logInfo("FRITZ!Box", msg)
end
rule “Verbindung aufgebaut - ausgehend”
when
Item fritzCallRinging changed from DIALING to ACTIVE
then
logInfo(“FRITZ!Box”, “Ausgehender Anruf: Verbindung hergestellt”)
end
rule “Verbindung hergestellt - eingehend”
when
Item fritzCallRinging changed from RINGING to ACTIVE
then
logInfo(“FRITZ!Box”, “Eingehender Anruf: Verbindung hergestellt”)
end
rule “Verbindung unterbrochen”
when
Item CallStatfritzCallRinging changed from ACTIVE to IDLE
then
logInfo(“FRITZ!Box”, “Aktiver Anruf: Verbindung unterbrochen”)
end