HowTo: Node Red / FritzBox – View call notification on incoming phone calls

Falls Ihr in Eurem Zuhause neben einem RaspberryPi mit NodeRed auch noch eine FritzBox beheimatet, könnte der folgende Artikel interessant für Euch sein.

In diesem wird erklärt, wie Ihr per NodeRed Auf potentielle Anrufe reagieren könnt. Als Beispiel wird hierbei eine Nachricht auf dem Dashboard angezeigt sobald ein Anruf auf der FritzBox eingeht.

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.
RaspberryPi – Setting up for Nerdiys!
RaspberryPi – The first configuration
RaspberryPi – Controlling the RaspberryPi via SSH
NodeRed – Installing NodeRed on the RaspberryPi
NodeRed – Install New Nodes
NodeRed – Import and Export Node Code

Required tools:
-none-

Required material:

In the following list you will find all the parts you need to implement 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 also communicate with your FritzBox, you have to specify your FritzBox login data in the configuration of the node.

Click on the node “Fritz! Box Call Monitor”. This opens a new window in which you can select “Add new fritzbox-config” in the line “Device”. Select this and then click on the Pen 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 at “fritz.box”. Only if you access a remote FritzBox you have to enter the URL to the desired 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 for caller notification

On the call to your FritzBox you can react with all sorts of actions. For example, you could also switch a lamp on when a call comes in. In this example, a call will display a pop-up-message on the dashboard with the caller number and the time of the call.

Copy the Node code below and import it into your NodeRed installation.

Example of the pop-up-message on the dashboard when a call is incoming.
Node Configuration.

Node-Code:

[{"id":"13066853.acf578","type":"function","z":"5ebf035f.49459c","name":"","func":"\nif (msg.payload.type==\"INBOUND\")\n{\n    var output=\"\";\n    output+=\"Anrufer: \"+msg.payload.caller+\" am \"+msg.payload.timestamp;\n    msg.payload=output;\n    return msg;\n}\n","outputs":1,"noerr":0,"x":510,"y":300,"wires":[["c49fb24f.fdfa9"]]},{"id":"c49fb24f.fdfa9","type":"ui_toast","z":"5ebf035f.49459c","position":"dialog","displayTime":"25","highlight":"","outputs":1,"ok":"OK","cancel":"","topic":"Aktueller Anruf","name":"Aktueller Anruf","x":700,"y":300,"wires":[[]]},{"id":"2d4a3414.8a1a4c","type":"comment","z":"5ebf035f.49459c","name":"Aktuellen Anruf anzeigen","info":"","x":270,"y":260,"wires":[]},{"id":"7665017.2302b","type":"fritzbox-callmonitor","z":"5ebf035f.49459c","device":"b6df4765.5508a8","name":"","topic":"","x":300,"y":300,"wires":[["13066853.acf578"]]},{"id":"b6df4765.5508a8","type":"fritzbox-config","z":"5ebf035f.49459c","name":"FasbFritzBox","host":"fritz.box","port":"49000","ssl":false}]

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

2 comments

  1. Hallo
    Super Beispiele Danke
    Ich soll eine Alarmliste anfertigen, auf Node-Red. Ich suche ein Node, dass eine Liste generiert und in der man auch Alarme mit einem Zeitstempel generieren kann und diesen gegebenenfalls auch löschen kann. Hast du ein entsprechendes Beispiel? Oder ist das ein Ding der Unmöglichkeit? Hoffe auf eine schnelle Antwort 🙂

    Danke dir schon im voraus

    1. Hey Reichlin,
      eine Node habe ich leider nicht dazu. Aber man kann sowas recht leicht selber bauen. Hast du schonmal mit einer Function Node gearbeitet?
      Darin kann man eigenen JavaScript eintragen und somit direkt programmieren.
      Hier könnte man in einem einfachen Array verschiedene Alarmereignisse speichern und ggf. auch löschen. Wenn es sehr viele Einträge werden könnte man auch mit einer Datenbank arbeiten. 🙂
      Beste Grüße
      Fabian

Leave a Reply

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