[SOLVED] Fritz Box 7490 - Outgoing Call TR064 Binding

Hello,

at first, please excuse my bad english.

My Problem is, that i’m not able to create a trigger which closes all Rolllershutter items when a outboundcall by a special number goes out.

All rules i found, are triggers by incoming calls.
I tried to adapt these rules, but I did not manage it.

Maybe someone has an example from which I can orientate myself?!

Thanks in advance

Chris

Is there no solution to my problem, or does nobody want to help me?
I can not get it myself, I’m really desperate. :frowning:

Show your item definitions for your fritzbox and your rule, so that the community can have a look at it.

This are my Files.
The problem is I can not get the number from the outgoing call. :frowning:

//Fritz.Items
Switch fboxRinging “Phone ringing [%s]” {fritzboxtr064=“callmonitor_ringing” }
Switch fboxRinging_Out “Phone ringing [%s]” {fritzboxtr064=“callmonitor_outgoing” }
Call fboxIncomingCall “Incoming call: [%1$s to %2$s]” {fritzboxtr064=“callmonitor_ringing” }
Call fboxOutgoingCall “Outgoing call: [%1$s to %2$s]” {fritzboxtr064=“callmonitor_outgoing” }
Number FritzTestNumb “FBox Test Number [%s]”
String FritzTestTXT “FBox Test Text [%s]”


//Fritz.Sitemap

{
Frame label=“FritzBox” {
Switch item=fboxRinging_Out
Switch item=fboxRinging
Text item=fboxOutgoingCall
Text item=fboxIncomingCallResolved
Text item=FritzTestNumb
Text item=FritzTestTXT }


//Fritz.Rules
rule “Alarm Call”

when

Item fboxRinging_Out changed from OFF to ON

then

// Get Outbound Dates
val outCall = fboxOutgoingCall.state as StringListType
val callNumber = outCall.getValue(1)

// Die Daten in die Items eintragen
FritzTestNumb.postUpdate(CallNumber)

if (FritzTestNumb.state == 123456){

}

end

What should I do more? :pensive:

please post the log.Here you can see the full string of fboxOutgoingCall.state

Sorry for the late respond. That should work:

rule "Alarm Call"
when
    Item fboxRinging_Out changed from OFF to ON
then
    val outCall = fboxOutgoingCall.state as StringListType
    val callNumber = outCall.getValue(0)
    if (callNumber == "0123456789"){
        // do something
    }
end

Hello, Thank U, but it
it doesn’t work. The same mistakes I always got in my attempts. It’s somehow due to the ‘% 2 $ s’ specifier. have a look at the LOG.

Outgoing number: 28287xxx
Destination Number: 01577xxxx
I want to tap the outgoing number

LOG:

2018-04-01 10:12:34.382 [INFO ] [tzboxtr064.internal.PhonebookManager] - Trying to resolve number 01577191xxxx to name comparing 7 characters

2018-04-01 10:12:34.387 [INFO ] [tzboxtr064.internal.PhonebookManager] - found name match Christian in phonebook by comparing 0379191xxxxxx with 0379191

==> /var/log/openhab2/events.log <==

2018-04-01 10:12:34.420 [vent.ItemStateChangedEvent] - fboxOutgoingCall changed from NULL to 015771xxxxxx,28287xxxx
2018-04-01 10:12:34.425 [vent.ItemStateChangedEvent] - fboxRinging_Out changed from NULL to ON

2018-04-01 10:12:42.517 [vent.ItemStateChangedEvent] - fboxOutgoingCall changed from 0157719xxxxx,2828xxx to

2018-04-01 10:12:42.525 [vent.ItemStateChangedEvent] - fboxIncomingCall changed from NULL to

2018-04-01 10:12:42.536 [vent.ItemStateChangedEvent] - fboxIncomingCallResolved changed from NULL to

2018-04-01 10:12:42.541 [vent.ItemStateChangedEvent] - fboxRinging_Out changed from ON to OFF

2018-04-01 10:12:42.545 [vent.ItemStateChangedEvent] - fboxRinging changed from NULL to OFF

==> /var/log/openhab2/openhab.log <==

2018-04-01 10:12:42.688 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value ‘’ of item fboxOutgoingCall with format ‘%1$s to %2$s’: {}

java.util.MissingFormatArgumentException: Format specifier ‘%2$s’

at java.util.Formatter.format(Formatter.java:2525) [?:?]

at java.util.Formatter.format(Formatter.java:2455) [?:?]

at java.lang.String.format(String.java:2940) [?:?]

I tested my solution again on my system and it works as expected.
You can switch between the outgoing number and destination number by altering the line val callNumber = outCall.getValue(0) to
val callNumber = outCall.getValue(1).
I have the same warning in my log, but it shouldn’t effect the rule, because it’s only a matter of the User Interface and on my sitemap fboxOutgoingCall is displayed correctly anyhow. I think, it shows up because the state of fboxOutgoingCall is set to null or '', when there is no call, so there is no first and second string to be displayed. Again, it shouldn’t be the root of your problem.

Is your rule loaded correctly? Sometimes it is a problem, when you copy something from the forum, that you have the wrong quotes (“ ” instead of " ").

Try to add some more logging, to locate the fault. Like this:

rule "Alarm Call"
when
    Item fboxRinging_Out changed from OFF to ON
then
    logInfo("Alarm Call", "Alarm Call rule triggered...")
    val outCall = fboxOutgoingCall.state as StringListType
    logInfo("Alarm Call", outCall.toString)
    val callNumber = outCall.getValue(0)
    logInfo("Alarm Call", callNumber.toString)
    if (callNumber == "0123456789"){
        logInfo("Alarm Call", "The numbers match...")
    }
end

Can’t help, but i am interested in the use case. What’s your use case? You are inside your home and want to start a function by an outgoing call to a special number. Why?

There is a Alarmsystem which calls me by a special number. So when the Alarm triggers, all light should be switched on, the Rollershutters should go open, and so on :wink:

The rule did’t trigger the switches in the If declaration, although the log command is executed.

my rule:
if (callNumber == “2828xxxx”){
logInfo(“Alarm Call”, “The numbers match…”)
ITT9.sendCommand = (ON)
ITT8.sendCommand = (ON)
}

Sitemap:
ITT = Switches
Frame label=“Dachboden” {
Switch item=ITT5
Switch item=ITT7
Switch item=ITT8
Switch item=ITT9
}

item:
Switch ITT8 “Licht Schreibtisch” [“Lighting”]{ culintertechno=“type=raw;address=F0000F000F;commandOn=FF;commandOff=F0” }

What’s that (see the bold)?

2018-04-01 12:39:21.691 [INFO ] [se.smarthome.model.script.Alarm Call] - Alarm Call rule triggered…

2018-04-01 12:39:21.697 [INFO ] [se.smarthome.model.script.Alarm Call] - 015771xxxx,2828xxx

2018-04-01 12:39:21.703 [INFO ] [se.smarthome.model.script.Alarm Call] - 2828xxx

2018-04-01 12:39:21.708 [INFO ] [se.smarthome.model.script.Alarm Call] - The numbers match…

2018-04-01 12:39:21.713 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Alarm Call’: An error occurred during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.BusEvent.sendCommand(org.eclipse.smarthome.core.items.Item,org.eclipse.smarthome.core.types.Command) on instance: null

Your syntax is for sendCommand is wrong.
It has to be:

ITT8.sendCommand(ON)

Oh *****! That’s it!
Now it works … THX sooo much, all of U

Ah, i see. Thank you.