i need help für my project “output of the callername” over “text to speech” via marytts.I use the FritzboxTR064-Binding on OH2. All items work, but the rule doesnt work. I copied it from the Binding-wiki. I think that is not all what i need. I use follow entries:in the rules file:
rule "Phone is ringing"
when
// fboxRinging is a switch item which switches to ON if call is detected
Item fboxRinging changed from OFF to ON
then
say("hello") // my testtext , work
logInfo("Anrufermeldung", "Generating caller name message...") // logentrie is ok
// fboxIncoming call receives numbers/name of incoming call
val CallType incCall = fboxIncomingCall.state as CallType
var callerName = incCall.destNum //destNum is external number OR resolved Name if no
//phonebook entry exists
say("test") // another testtext, doesnt work
// do something with callerName
// here i wish to say the callerName, how?
I dont find.any information about this in all discussions. An entrie - say(“hello”) - after the “then” section work, an entrie after the varibles declaration dont work.
I think it is missing entries like
import org.openhab.library.tel.types.CallType
???
Can anyone help me to understand the function and correct my code? I want output the var callerName per marytts in the kind of say(callerName) What is the correct syntax for the handover
of the var “callerName” and which parts are missing in the code?
Rule:
rule "Jemand ruft an"
when
Item fboxRinging changed from OFF to ON
then
val incCall = fboxIncomingCallResolved.state as StringListType
val callerNumber = incCall.getValue(1)
var strTemp = callerNumber.toString as String
postUpdate(fboxlastIncomingCall, strTemp)
//Samsung-TV Ton aus
sendCommand(TV_Mute, ON)