Fritzbox call overview

Where does this come from?

Hello Sidamos,
sorry - I thought it were part of the binding doku of fritzboxtr064.
There, at the end you can find a rule to resolve the phonenumber.
But the item I ment (or that part of the rule) was copied from a rule based on that of the doku:

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
    logInfo("Anrufermeldung", "Generating caller name message...")
    
    val incCall = fboxIncomingCall.state as StringListType
    val callerNumber = incCall.getValue(1)
    val incCallResolved = fboxIncomingCallResolved.state as StringListType
    val callerName = incCallResolved.getValue(1)
	if (callerName.startsWith("Name not found for"))
  {
    // Den Namen mit Unbekannt fĆ¼llen
    callerName = "Unbekannt"
  }
    // do something with callerName
	val tmpCallName   = callerName.removeStart("yourNumber##")
		postUpdate(fbox_LastInCallName, tmpCallName)
	val tmpCallNum0   = callerNumber
		postUpdate(fbox_LastInCall, tmpCallNum0)	
end

I think most of the binding-users use a similar ruleā€¦
For this one you need two more (string-)items:
fbox_LastInCallName
fbox_LastInCall
As I said - works for meā€¦ :slight_smile:
and thanks again.
Klaus

Hi Klaus.
I use your rule ā€œPhone is ringingā€. Works great. But i get this info in logview after saveing:

2019-03-01 01:17:42.095 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model ā€˜Anrufbeantworter.rulesā€™, using it anyway:

Assignment to final variable

2019-03-01 01:17:42.105 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model ā€˜Anrufbeantworter.rulesā€™

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

Any ideas?
Thanks and greetings,
Markus

I think callerName should be declared as var because a value is assigned a second time with
callerName = ā€œUnbekanntā€

Hello Manuel and Markus,
sorry, I stuck in work this week.
I think Manuel got it - it must be a var(iable) and not a fixed value.
As I told before, IĀ“m not a developer - I just copied it from some other kind user, that got it made :slight_smile:
nice weekend
Klaus

Hello,
Nice Work! :slight_smile:
I tried the installation with the github files.

The fritzbox.sh script does not work for me.

IĀ“m getting this error message from the script:

lock obtained
downloading message list for TAM 0...wget: missing URL
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.
0 bytes.
downloading call list...wget: missing URL
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.
0 bytes.

That is strange. What wget do you have?

$ wget --version
GNU Wget 1.20.3 built on linux-gnu.

Hello Sidamos,

I have:

wget --version
GNU Wget 1.18 built on linux-gnueabihf.

It seems that the URL variable is empty (as wget says).

I added a echo - line for the variable and get no output on the console:

function downloadMissingTamMessages() {
  tamidx=0
  while [ $tamidx -lt $TAM_COUNT ]; do 
    if [ ! -f $TMP/tam${tamidx}.xml ]; then
      echo -n "downloading message list for TAM $tamidx..."
      URL=$(soapCall "$BASEURL/upnp/control/x_tam" "urn:dslforum-org:service:X_AVM-DE_TAM:1" GetMessageList NewURL "<NewIndex>${tamidx}</NewIndex>")
      **echo -n "Test $URL"**
      wget --quiet -O - $URL | awk '/<Message>/,/<\/Message>/ { printf $0 } /<\/Message>/ { print }'>$TMP/tam${tamidx}.xml 
      echo "$(stat -c%s $TMP/tam${tamidx}.xml) bytes."
    fi

    tamidx=$(expr $tamidx + 1)
  done
}

Now I got it.

After adding an echo line to the soapCall() function:

echo ā€œtest $RESPONSEā€

I could see what is wrong:

test <HTML><HEAD><TITLE>401 Unauthorized (ERR_NONE)</TITLE></HEAD><BODY><H1>401 Unauthorized</H1><BR>ERR_NON

IĀ“ve changed the Password for the user to something which contains no special characters. Now it works.
IĀ“m no bash pro, but maybe somebody could add a debug line in the script on github?

I only change the UID and Secret vars and the path to the text file. The 16 bytes in the text file are:
{ā€œpidā€œ:ā€œlogoutā€œ}

First, I would like to mention that I really like this project and that this comment is not meant to criticize your work.
So I decided to integrate this call log in my Habpanel configuration.

But Iā€˜m getting the same error as mentioned above. I donā€˜t see any mistake of mine so I would be happy to hear some ideas how to fix this issue.

Hi guys,

today I tried to implement this nice call overview with the FritzBox on my system.
Due to the very good explanation and all the files I was successful.
On a normal PC I see the call overview but on an Android tablet with the usage of Habmin App it donĀ“t.
Does someone know that the ā€œautomatic updateā€ script provided by vbier does not work with this App? Or are there known limitations?

Thank you.
Tobi

Hi.
I am running openhab in windows any idea how to run this script??
executeCommandLine(ā€œsudo /path/to/your/script/name_of_your_script.shā€)
i cant make it work under windows.

An sh script isnā€™t going to run in Windows.

You might be able to rename it to [scriptName.bat] and get it to work. But youā€™d probably have to modify or replace the commands in the file, too.

I give up 3 days i am trying without success. Nobody here running openhab on windows with this script??? maybe a windows tool to download the call list from the fritzbox??
So looking now my panel


The call list off course its a repeat from incomingcall item.
Thanks
Nikos

Has anyone already adapted this to OH 3?

From the first look, it seems one has to use the AVMFritz and the TR064 binding together now?

But the AVMFritz binding has no channels at all for the FritzBox. I upgraded from 2.5.9 to 3.0.1.

Have a look here:

1 Like

Thank you, this is helpful.

Hi,

I am using VolkerĀ“s Script to reload the call list in the HABPanel for years in Openhab 2.x.
Now after migrated to OH 3.x this is no longer working.
I get an error ā€˜millisā€™ is not a member of ā€˜java.time.ZonedDateTimeā€™

But I donĀ“t know how to replace the expression in the rule for OH 3.
in OH2 it was
ListDate.postUpdate(now.millis)

Can someone guide me please?
Thank you.

Tobias