Skip to content

iobroker-community-adapters/ioBroker.tr-064

Repository files navigation

Logo

ioBroker.tr-064

Number of Installations Number of Installations NPM version

Test and Release Translation status Downloads

This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers. For more details and for information how to disable the error reporting see Sentry-Plugin Documentation! Sentry reporting is used starting with js-controller 3.0.

Info

This adapter reads main information from AVM Fritz!Box, like call list or number of messages on answering machine. Based on this AVM documentations

Needed Settings in your Fritzbox:

  • You need to change the Login to "Use Username and password"
    • The maximum relevant password length for FritzBox is 32 characters! FritzBox cuts the password silently in the UI. Please make sure to enter only the 32 relevant characters in the adapter configuration
  • Create a user and allow him to "control the Fritzbox and settings"
  • Enable Application Access (on Network tab). Click flow in german: Netzwerk ->Heimnetzfreigaben -> Zugriff fĂĽr Anwendungen -> aktiviert
  • If you want to use the "ring" function you need to set additional settings (see below)

Initial Creation

This adapter was initially created by @soef at https://github.com/soef/ioBroker.tr-064 but not maintained any more, so we moved it to iobroker-community so that bugs could be fixed. thanks @soef for his work.

How to migrate from tr-064-community (intermediate version and name)

If you move from tr-064-community adapters you can easily copy whole device list or settings by:

  • Go in admin to objects and enable expert mode
  • Look for an object tree which is called system.adapter.tr-064-community.0 (where 0 is the instance, if you had multiple instances select the right one)
  • On the very right of this line is a button with a pencil, click on it
  • On the window you get select "raw (experts only)" and there copy the NATIVE part of the json
  • then open system.adapter.tr-064.0 (where 0 is the instance, if you had multiple instances select the right one)
  • paste the copied native part in there in native
  • save the changes
  • start the adapter
  • check configuration if anything was restored correctly

Features

Simple states and functions

  • turn on/off wifi for 2.4GHz and 5GHz,
  • turn on/off guest wifi,
  • reboot Fritz!Box,
  • start WPS process,
  • reconnect Internet
  • external ip address

ring (dial a number)

  • When using an internal number (like **610) the ring state will let ring that internal phone. E.g.: **610[,timeout]
  • When using an external number, the ring state will connect you to the external number. The Fritz!Box will call the external number and your default phone will ring, when the called phone is picked up. The default phone can be configured in the Fritz!Box under: Telefonie/Anrufe/[Tab]Wahlhilfe/Wählhilfe verwenden . Please also make sure to choose "Verbindung mit dem Telefon ISDN- und Schnurlostelefone"

toPauseState

  • Values: ring, connect, end
  • Can be used to pause a video player on an incoming call (ring), or on pick up the phone (connect).
  • Resume can be done on the end value.

Presence

To monitor the presence of persons in your home, so to control once anyone of your family/roommate is leaving or arriving, you can use this adapter as follows:

  • Enter the Adapter options and switch to the 'Devices' tab
  • Add all devices (like smart phones) of your family/roommate members accordingly, and confirm with 'Save'.
  • For each device, the adapter will now create a folder structure under the ioBroker Objects of the adapter, typically in the folder "tr-064.0.devices"
  • Now once anyone is arriving or leaving, this adapter will get the information accordingly. For example, the state "tr-064.0.devices.xxx.active", where xxx is the device name, will indicate if the specific device is available or not, so if the person is present or not. User feedback is that this works reliable for iOS devices as well, like with iPhones. For iPhones, user feedback is that it takes up to 10 minutes until the Fritz!Box notices that a person left and is no longer connected with WiFi, and it takes up to 1 minute until the Fritz!Box will notice the presence again.

Also, a script was published by the ioBroker community which uses this adapter information to trigger actions (e.g. everyone left home, so turn off everything automatically, see number of persons currently being present, or person status in general, via VIS, etc.). See ioBroker forum thread (in German)

AB - Anrufbeantworter (answering machine)

Can be switched on/off. The state cbIndex can be set, to address # of the answering machine.

Call monitor

The call monitor will create realtime states for every inbound and outbound call. If the phone book is enabled (default), numbers will be resolved to Names There ist also a state indicating a ringing phone.

Phone book

  • The phone book, if enabled, will be used to get the name of callers phone number.
  • Further there are three states to resolve a number or a name. If available you will also get the image URL of the contact. e.g.: if you set the state phonebook.number all 3 states, name, number and image will be set to the found contact. Note, searches by name will first compare the complete name, if not found, part of is used.

Call lists

Output formats:

  • json
  • html

Call lists are:

  • all calls
  • missed calls
  • inbound calls
  • outbound calls

Call count: The call count can be set to 0. The next call will increment 1.

The html output can be configured by a template.

command & commandResult state

With the command state you can call every tr-064 command from this documentation. e.g.

command = {
    "service": "urn:dslforum-org:service:WLANConfiguration:1",
    "action": "X_AVM-DE_SetWPSConfig",
    "params": {
        "NewX_AVM-DE_WPSMode": "pbc",
        "NewX_AVM-DE_WPSClientPIN": ""
    }
};

The command state should be set to a JSON of the above Lines. So { ... } (without command = and line breaks) The callback of the call will set the commandResult state.

Here you will find an example how to switch the answering machine in the Fritzbox on and off by using the command state. For testing you can just copy & paste the string into the state tr-064.0.states.command

Switch the answering machine on: {"service": "urn:dslforum-org:service:X_AVM-DE_TAM:1","action": "SetEnable", "params": {"NewIndex": "0","NewEnable": "1"}}

Switch the answering machine off: {"service": "urn:dslforum-org:service:X_AVM-DE_TAM:1","action": "SetEnable", "params": {"NewIndex": "0","NewEnable": "0"}}

A detailed description of the actions and parameters for TAM you can find here https://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/x_tam.pdf (link is contained in the AVM documentation above).

Enable call monitor

To use the call monitor feature it must be first enabled in the AVM Fritz!Box. To enable the call monitor dial #96*5* and the TCP/IP Port 1012 will be opened. To close the port dial #96*4*.

Changelog

WORK IN PROGRESS

  • (mcm1957) Adapter requires node.js >= 18 and js-controller >= 5 now
  • (mcm1957) Dependencies have been updated

4.2.18 (2023-01-04)

  • (Apollon77) Prepare for future js-controller verisons

4.2.17 (2022-09-16)

  • (simatec/Apollon77) Prevent duplication of entries in configuration
  • (Apollon77) Make sure active status of devices in jsonDeviceList is correct

4.2.16 (2022-03-21)

  • (Apollon77) Fix info logs on callee/caller
  • (Apollon77) Add special handling for potential broken external image links in phonebook
  • (Apollon77) Prevent some crash cases reported by Sentry

4.2.15 (2021-12-08)

  • (bluefox) fix crash case (Sentry IOBROKER-TR-064-35)

4.2.14 (2021-07-21)

  • (Apollon77) Further optimizations for js-controller 3.3

4.2.13 (2021-07-12)

  • (Apollon77) Optimize for js-controller 3.3 and prevent warnings (you pot. need to delete datapoints if you still see errors, they will be recreated)

4.2.12 (2021-04-16)

  • (Apollon77) prevent html template for call lists to be overwritten by default one
  • (Apollon77) fix crash case (Sentry IOBROKER-TR-064-2M)

4.2.11 (2021-03-12)

  • (Apollon77) fix id-reset detection for single calls

4.2.10 (2021-03-11)

  • (Apollon77) better handle caller id resets by reboots/FW updates to also update list specific counter and log when this happened

4.2.9 (2021-03-10)

  • (Apollon77) try to better handle calllist resets on FW updates
  • (Apollon77) Make sure jsonDeviceList do not get deleted on start
  • (Apollon77) Better handle not initialized calllist templates

4.2.8 (2021-03-09)

  • (Apollon77) Optimize customized HTML templates if state is empty

4.2.7 (2021-03-08)

  • (Apollon77) Allow customized HTML templates again

4.2.6 (2021-02-18)

  • (Apollon77) Fix crash case (IOBROKER-TR-064-20)
  • (Apollon77) Get calllists working again

4.2.4 (2021-02-02)

  • (Apollon77) Prevent crash case (Sentry IOBROKER-TR-064-1T)

4.2.3 (2021-01-16)

  • (Apollon77) Crash case prevented (Sentry IOBROKER-TR-064-1N)

4.2.2 (2020-12-25)

  • (Apollon77) Crash case prevented (Sentry IOBROKER-TR-064-1K)

4.2.1 (2020-11-13)

  • (Apollon77) try to fix pot. not working disabling commands

4.2.0 (2020-11-09)

  • (Apollon77) Crash case prevented (Sentry IOBROKER-TR-064-15, IOBROKER-TR-064-16)
  • (Apollon77) Try to solve error 500 problem with offline devices
  • (SliX185) Add IPv6 states
  • (foxriver76) optimizations
  • (Apollon77) Fix initialization if ip/host

4.1.0 (2020-09-17)

  • (Apollon77) Fix crash case (Sentry IOBROKER-TR-064-14)
  • (bazidibavaria) added tablesort to device search
  • (bazidibavaria) added Fritzbox link to admin

4.0.13 (2020-08-17)

  • (Apollon77) Crash prevented (Sentry IOBROKER-TR-064-10)

4.0.12 (2020-08-06)

  • (Apollon77) Crash prevented (Sentry IOBROKER-TR-064-Y)

4.0.11 (2020-07-26)

  • (Apollon77) Crash prevented (Sentry IOBROKER-TR-064-W)

4.0.9 (2020-07-01)

  • (Apollon77) handle cases correctly when no hosts are existing on device (Sentry IOBROKER-TR-064-R)

4.0.8 (2020-06-20)

  • (Apollon77) Make sure states are only subscribed if initialization is done (Sentry IOBROKER-TR-064-J)

4.0.7 (2020-06-09)

  • (Apollon77) Fix Admin UI to allow setting poll Interval correctly again

4.0.4 (2020-06-05)

  • (Apollon77) Make sure adapter do not crash of no calls were returned (Sentry IOBROKER-TR-064-D)
  • (Apollon77) Make sure adapter do not crash when invalid parameter are provided (Sentry IOBROKER-TR-064-B)
  • (Apollon77) https is not supported right now (Sentry IOBROKER-TR-064-E)

4.0.3 (2020-05-11)

  • (Apollon77) Make sure adapter do not crash of no calls were returned (Sentry IOBROKER-TR-064-7)
  • (Apollon77) Make sure adapter do not crash when providing a non string to "ring" state (Sentry IOBROKER-TR-064-8)

4.0.1 (2020-04-23)

  • (Apollon77) handle case where no Phone deflections are available (Sentry IOBROKER-TR-064-1/2)

4.0.0 (2020-04-12)

  • (Apollon77) update dependencies, use auto decrypt features with js-controller 3.0
  • (foxriver76) make callmonitor compatible with js-controller 3.0

3.1.4 (2020-01-26)

  • (Apollon77) fix error and check some other code check comments
  • (Apollon77) Add proper meta data for buttons

3.1.1 (2020-01-25)

  • (bluefox) Configuration dialog was improved
  • (bluefox) Soef library was removed

3.0.0 (2020-01-24)

  • (Apollon77) Switch Name back to tr064 because ewe got it from npmjs
  • (maeb3) Enhance call handling and fix wrong data for currently active calls
  • (Apollon77) Remove unused state phonebook.ringing

2.0.3 (2019-12-17)

  • (Jey Cee) fix delete last device from list

2.0.2 (2019-12-16)

  • requires js-controller v2
  • (foxriver76) no longer use adapter.objects
  • (Apollon77) several fixes, Call lists working again, Phonebook fixed and many more

1.1.0 (2019-11-10)

  • (jey cee) added Admin v3 support

1.0.0 (2019-04-01)

  • (ldittmar) first version for the community

License

The MIT License (MIT)

Copyright (c) 2023-2024 ioBroker Community Developers [email protected]
Copyright (c) 2015-2023 soef [email protected], ioBroker-Community-Developers

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.