HowTo: NodeRed - Control and read out FRITZ DECT 200 socket using NodeRed

The FRITZ!Box is not only a very good router for the home network. Equipped with the right Smart Home accessories, it can also become the Smart Home center of your house or apartment. Everything you need is already installed in the FRITZ!Box. New sensors or actuators are simply wirelessly connected to the FRITZ!Box via the DECT standard.

One possible actor is the FRITZ!DECT 200 socket. After you have connected it to the Fritz Box, you can control it via the Fritz Smart Home App or according to defined rules or times.

If you want a little more and more individual control, you can also control the socket using Node Red.

This article describes what you have to do to integrate a FRITZ!DECT 200 smart home socket into your Node Red environment.


Safety instructions

I know the following notes are always kind of annoying and seem unnecessary. Unfortunately, many people who knew "better" have lost eyes, fingers or other things due to carelessness or injured themselves. Data loss is almost negligible in comparison, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Because even the coolest project is not worth injury or other trouble.
https://www.nerdiy.de/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 make a purchase via this link, Nerdiy.de will receive a commission from the relevant online shop or provider. The price does not change for you. If you make your purchases via these links, you support Nerdiy.de in being able to offer other useful projects in the future. 🙂 


Requirements

Helpful articles:
So that you can install new nodes Node Red already installed of course.
How to prepare a RaspberryPi and then install Node Red on it is described in the following articles.

In the following lists you will find all the parts you need to implement this article.

Required tool:

NumberLink
1xScrewdriver set  Buy at Amazon
1xSD card reader  Buy at Amazon

Required material:

NumberLink
1x AVM FRITZ!DECT socket 200  Buy at Amazon
1x Raspberry Pi  Buy at Amazon
1x Raspberry Pi power supply  Buy at Amazon
1x Raspberry Pi case  Buy at Amazon
1x Micro SD card 64GB  Buy at Amazon


Log into the NodeRed configuration interface

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

View of the login dialog. Here you have to enter the login data that you specified during the configuration of the login. You can find information about this in the article NodeRed - set up user login.

Read out the AIN of your FRITZ!DECT 200 socket and enter it in Node Red

In order for the Node Red code below to work, you must enter the correct AIN in your Node Red configuration. The AIN is the identification number of your FRITZ DECT Smart Home device, which you need to be able to control or read it specifically. How you can find out the AIN using the FritzBox configuration interface is in the article Fritz Box – Find out the AIN of your SmartHome device described.


Install the appropriate FritzBox node

Damit Node Red mit der verbundenen Steckdose kommunizieren kann, müsst Ihr die Node “node-red-contrib-fritzapi” installieren. Wie Ihr Nodes installiert ist im Artikel NodeRed – Install new nodes described.

You should also have already installed and configured the dashboard node. This is used to display the retrieved data on the dashboard. You can find information about this in the following article.


Node Red code for controlling the FRITZ DECT 200 Smart Home socket

With the Node Red code linked below you can control your Fritz DECT 200 socket and retrieve its data. The temperature, measured power and the switching status are displayed on the Node Red Dashboard, but can of course also be processed internally.

View of the flow in the Node Red configuration view.

View of the controls in the Node Red dashboard view.

In order for the Node Red code to work, the connection between Node Red and your FritzBox should already be configured.

You can find more information about this in the article

In order to be able to use the Node Red code, you still have to enter the AIN of your Fritz DECT Repeater.

The AIN is the identification number via which the repeater is addressed. How you can find out this AIN is in the article Fritz Box – Find out the AIN of your SmartHome device described.

How you can import the NodeCode linked below into your NodeRed environment is in the article NodeRed - import and export node code described.

As always, you can find the Node Red code in the Nerdiy Git repository under the following link:


Have fun with the project

I hope everything worked as described for you. If not or you have questions or suggestions please let me know in the comments. I will then add this to the article if necessary.
Ideas for new projects are always welcome. 🙂

PS 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 think it's cool that I share the information with you, I would be happy about a small donation to the coffee fund. 🙂

Buy Me a Coffee at ko-fi.com       

16 comments

  1. Thanks for the instructions, unfortunately that doesn't work as desired, but tried it with a Fritzdect 210.
    Debug: device not ready
    And
    Disconnected with error

    1. Da gibt es ein Timing-Problem: Die Node “Get socket state” läuft mit einer Wiederholrate von 1s. Das ist für meine Fritz!Box 6490 / DECT 200 zu schnell. Ich hab das jetzt auf 5s gestellt und es geht!
      Was “Device not ready” betrifft ist es wohl ähnlich. Mach ich Änderungen und deploye diese, dauert es einige Sekunden bis diese Meldung verschwindet. Dann kommt sie auch nicht mehr wieder.
      Mir scheint, die Node “Fritz!Box” versucht sich in kurzen Abständen mit der FB zu verbinden und die braucht dann ihre Zeit. Evtl. könnte man da was verbessern aber ich habe nichts gefunden, wie man die Anfrage zeitlich verändern könnt.

  2. Kleiner Bug in der Darstellung der “socket energy”:

    The counter values delivered as payload do not have the unit KWh but Wh.

    This means that for a specification in the usual unit kWh, it must still be divided by 1000.

  3. Ein weiterer Bug steckt in der Anzeige des “Online Status”: Auf die Anzeige “Online Status” wird das Ergebnis von “Get State” ausgegeben und dadurch wird der Schalt Status und nicht der Online Status als “online” oder “offline” angezeigt. Abhilfe: Einen weiteren “Outlet” node hinzufügen, mit diesem “Get presence status” abholen und auf “Online Status” ausgeben.

  4. Ich würde gerne meine DECT200 in mein Node Red einbinden. Aber egal was ich wo eingebe, ich bekomme keine Verbindung zu meiner Fritzbox/DECT. Die Outlet-Node ist noch immer mit dem roten Ring und der Meldung “login failed” geschmückt.
    The following sentence is not really helpful in this regard:

    I haven't found any information on how to get out of this impasse. I would be very happy if someone could contribute a helpful tip.

  5. Wow, the named sentence was omitted, here it is delivered later:

    In order for the Node Red code to work, the connection between Node Red and your FritzBox should already be configured.

  6. Hello
    ICH bin Grün hinter den Ohren
    habe die FRITZ!DECT 210
    habe die AIN geändert

    Glaub fast alles rauf gespielt was geht aber gehen tut nicht´s

    wie das geht?? Node Red und Eurer FritzBox einstellen???

    6 Stunden Später muss ich wohl aufgeben!! ;(

    Mir ist hilfe gerne was wert aber ich mag es auch verstehen HILFE

    1. Hi Jürgen,
      hast du die Verbindung zu deiner FritzBox denn schon konfiguriert? Das müsstest du auch noch machen. Der Hinweis dazu ist etwas versteckt im Satz “Damit der Node-Red-code funktioniert sollte die Verbindung zwischen Node Red und Eurer FritzBox schon konfiguriert sein.”. Das hatte ein anderer Benutzer letztes auch schon angemerkt. Ich muss den Hinweis wohl etwas besser sichtbar machen. Wie man die Verbindung zur FritzBox konfigurieren kann habe ich im Artikel https://nerdiy.de/de_de/nodered-fritzbox-anruferliste-im-dashboard-anzeigen/ in dem Absatz “FritzBox-Node-Konfiguration eintragen” beschrieben. 🙂
      Ich hoffe das hilft dir. Ansonsten lasse mir gerne nochmal einen Kommentar dar. 🙂
      Best regards
      Fabian

  7. JUHU irgend wie geht´s // 8 Stunden später!! dect 210 habe ich
    1.) Aktor Identifikationsnummer (AIN) muss zusammen geschrieben sein!! ///
    2.) Host muss : http://192.xxxxxxxx wies bei euch halt ist sein Fritzbox ////
    3.) Benutzer Anlegen ohne dem wurde es auch nichts bei mir////
    4.) KWH stimmen bis jetzt noch nicht aber das hat wer anderer eh schon beschrieben!!
    5.) Wie kann man mehrere neben einander machen ??
    Wenn wer Lust hat mir Node Red beizubringen bitte Melden unter Jürgen Lindinger FB oder Instagram!
    Meine Nerven sind für was anderes ausgelegt

    1. Hi Jürgen,
      schön zu hören, dass es dann doch geklappt hat. 🙂
      Danke für die vielen infos!
      Wenn du mehrere Steckdosen auslesen willst, musst du den kompletten NodeRed Flow nochmal kopieren aber dann die andere AIN der weiteren Steckdose eintragen. 🙂
      Best regards
      Fabian

  8. Hallo und guten Abend Fab,

    zunächst vielen Dank für deine Arbeiten und die tollen Workarounds.
    Ich habe den Flow importiert und die AIN meiner DECT200 eingetragen.
    So weit – so gut, leider steht beim Status immer offline und der Schaltzustand lässt sich nicht ändern hingegen die Temp. und kWh werden angezeigt …
    Wo habe ich hier was falsch gemacht, kannst du helfen.

    Vielen Dank für deine Mühe und einen schönen Abend.
    Axel

  9. Hallo schon wieder 🙂
    ich hab’s gefunden – es liegt tatsächlich am Host fritz.box (nach Änderung in die IP) funktioniert es.

  10. Hmmmm ….
    leider zu früh gefreut – jetzt steht zwar “online” aber den Schaltzustand kann ich im Dashboard immer noch nicht ändern :-/

    Vlt. hast du ja doch noch einen Tip für mich

Kommentar hinterlassen

Your email address will not be published. Erforderliche Felder sind mit * markiert

This site uses Akismet to reduce spam. Learn how your comment data is processed.