How To: Node Red / FritzBox – View Caller List in Dashboard

In addition to the caller ID, you can also view the caller log of the Fritzbox in NodeRed.

How to do this is explained in the following article.

Hints for our lovely english readers: Basically, many of the articles on Nerdiy.de are translations from the original german articles. Therefore, it may happen here and there that some illustrations are not available in english and that some translations are weird/strange/full of mistakes or generally totaly wrong. So if you find some obvious (or also not obvious) mistakes don't hesitate to leave us a hint about that in the comment section. 
Also please don't get confused, that instead of a "dot" often a "comma" is used as decimal separator. 🙂


Safety instructions

I know the following hints are always a bit annoying and seem unnecessary. But unfortunately, many people who knew it "better" from carelessness lost their eyes, fingers or other things or hurt themselves. In comparison, a loss of data is almost not worth mentioning, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Even the coolest project is worth no injury or other annoyance. https://www.nerdiy.de/en/sicherheitshinweise/

Affiliate links / advertising links

The links to online shops listed here are so-called affiliate links. If you click on such an affiliate link and shop via this link, Nerdiy.de receives a commission from the online shop or provider concerned. The price doesn't change for you. If you do your purchases via these links, you will support Nerdiy.de in being able to offer further useful projects in the future. 🙂


Requirements

Helpful Articles:
Of course NodeRed should already be installed so that you can take over this configuration.
How to prepare a RaspberryPi and then install NodeRed on it is described in the following articles.

The following articles describe what to do to prepare the RaspberryPi:

Required material:

In the following list you will find all the parts you need to go thorugh this article.


Log in to the NodeRed configuration interface

Before you can edit your NodeRed configuration you must - if activated - first log in to the NodeRed configuration interface.

View of the login screen. Here you have to enter the login details that you entered during the configuration of the login. Information about this can be found in the article NodeRed - User Login Setup.

Install FritzBox-Node

So that NodeRed can communicate with your FritzBox you have to install the node “node-red-contrib-fritz”. How to install Nodes is described in the article NodeRed – Install New Nodes.


Enter FritzBox node configuration

So that the just installed FritzBox node can communicate with your FritzBox, you have to specify your FritzBox login data in the configuration of the node.

Klickt dazu auf die Node “Fritz!Box Callmonitor”. Daraufhin öffnet sich ein neues Fenster in dem Ihr in der Zeile “Device” “Add new fritzbox-config” in der Drop-Down-Liste auswählen könnt. Wählt dies aus und klickt dann auf das Stift-Icon rechts davon. Click on the node “Fritz! Box Call Monitor”. This opens a new window in which you can select “Add new fritzbox-config” in section “Device”. Select this and then click on the pencil icon to the right of it.
In the now opening window you have to enter the login data to your FritzBox. So first the name, so that the configuration does not remain nameless and then the user name and the password. If the FritzBox is in your private network you can leave the information at Host like displayed. Only if you access a remote FritzBox you have to modify the URL to FritzBox. Then you should also ensure that this connection is encrypted by HTTPS. In this case, the hook must be set to “Is SSL connection”. Once you have entered everything you confirm this by clicking on “Add”.
This will redirect you back to the previous window. The new FritzBox configuration is already selected. You just have to confirm the window by clicking on “Done”.

Node code to display the caller list in the dashboard

For this example, you need the dashboard node in addition to the FritzBox node. The dashboard will then display a table of recent calls. After inserting the node code listed below, do not forget to position the dashboard element correctly on the dashboard.

For more information on handling dashboard nodes, see NodeRed – Creating a User Interface with Dashboard Nodes

Node structure in the NodeRed configuration.

The code below is the code from the function node of the listed node configuration. In it you can change the table output and, for example, also change how many of the last entries are shown.
Change the “10” in the line “for (var i = 0; i <10; i ++)” to the desired value.

var IO=[];
var Datum=[];
var Nummer=[];

    for (var i = 0; i<10; i++) { if(msg.payload.Call[i].Type==1) { //Eingehender Angenommener Anruf IO[i]=">";
            Datum[i]=msg.payload.Call[i].Date;
            Nummer[i]=msg.payload.Call[i].Caller;
        } else if(msg.payload.Call[i].Type==2)
        {
            //Eingehender Nicht-Angenommener Anruf
            IO[i]=">>";
            Datum[i]=msg.payload.Call[i].Date;
            Nummer[i]=msg.payload.Call[i].Caller;
        } else if(msg.payload.Call[i].Type==3)
        {
            //Ausgehender Nicht-Angenommener Anruf
            IO[i]="<<";
            Datum[i]=msg.payload.Call[i].Date;
            Nummer[i]=msg.payload.Call[i].Called;
        }
    }
msg.payload.IO=IO;
msg.payload.Datum=Datum;
msg.payload.Nummer=Nummer;
return msg;

Unfortunately, I could not insert the NodeCode directly here because the HTML code contained in it somewhat “confuses” the look of the website.

You can find the NodeCode here in the Nerdiy-Git:


Alternative version

Here is a slightly improved version of the flow shown above.

This allows the accepted, missed and made calls to be displayed in separate tables.

You can find the NodeCode here in the Nerdiy-Git:


I hope everything worked as described. If not or you have any other questions or suggestions, please let me know in the comments. Also, ideas for new projects are always welcome. 🙂

Fab

P.S. Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you appreciate it that I share these information with you, I would be happy about a small donation to the coffee box. 🙂

Buy Me a Coffee at ko-fi.com

12 comments

  1. Hallo, ich wollte gerade den Node importieren, leider bekomme ich den Fehler:

    SyntaxError: Unexpected string in JSON at position 825
    038;&=”” i<20);=""

    Was kann ich da tun?

    1. Hey ET,
      ich habe das Problem behoben. Leider hat der Code auch in diesem Fall die Formatierung der Webseite beeinträchtigt. Ich habe den zweiten Code nun auch auf GitHub hochgeladen. 🙂
      Danke für den Hinweis und beste Grüße
      Fab

  2. Hallo Fab,
    Danke für das Hochladen, importieren hat geklappt.
    Leider ist im Node collectData noch ein Fehler (for Schleife…).
    Kannst du nochmal drüber schauen?

    Gruß
    ET

    1. Hey ET,
      sorry, hätte den Code nochmal checken sollen. Habe ihn korrigiert und getestet. Müsste nun funktionieren. Würde mich trotzdem über eine Rückmeldung freuen. 🙂
      Beste Grüße
      Fab

  3. Moin, ist auch möglich den aktuellen Anruf anzuzeigen ?
    Also wer gerade anruft ? (Dann kann man überlegen ob man ran geht, wenn man sieht wer es ist 😉 )

    Gruß
    Stefan

  4. Hallo, der Flow funktionierte bisher tadellos, inzwischen kommt aber nur noch eine Fehlermeldung. 401 Error unauthorisierter Zugriff, jemand eine Idee was man da tun kann?

Leave a Reply

Your email address will not be published. Required fields are marked *