The tr064 Plugin

Author: Christian Mayer
Available since: 0.11.0

Todo

automatic screenshot creation (from dummy data)

Description

The plugin is an interface to routers that implement the TR-064 protocol, like the widely used Fritz!Box. The calllist widget from this plugin displays a call list that contains the name of the callers (when known to the router) as well as the records of the answering machine.

../../../../_images/calllist.png

Settings

For a general understanding of how the configuration files are structured and what elements and attributes are it is recommended to read this section first: Pages and structure of CometVisu.

The behaviour and appearance of the powerspectrum plugins can be influenced by using certain attributes and elements. The following tables show the allowed attributes and elements and their possible values. The screenshots show, how both can be edited in the editor.

Attributes underlined by ….. are mandatory, all the others are optional and be omitted.

Allowed attributes in the calllist-element

Element

Attribute

Name

Content

Description

calllist

device

string

ID/Name of the device as used in the hidden configuration.

max

decimal

Maximum number of entries to fetch from the router.

columns

string

By semicolon separated list of column types (allowed types: caller, date, name, nameOrCaller, tam, type)

TAM

string

Icon for telephone answering machine.

TAMColor

string

TAMwait

string

Icon for waiting for telephone answering machine.

TAMwaitColor

string

TAMplay

string

Icon for playing the telephone answering machine.

TAMplayColor

string

TAMstop

string

Icon for stopping the telephone answering machine.

TAMstopColor

string

typeIncoming

string

Icon for incoming call.

typeIncomingColor

string

typeMissed

string

Icon for missed call.

typeMissedColor

string

typeOutgoing

string

Icon for outgoing call.

typeOutgoingColor

string

typeActiveIncoming

string

Icon for active incoming call.

typeActiveIncomingColor

string

typeRejectedIncoming

string

Icon for rejected incoming call.

typeRejectedIncomingColor

string

typeActiveOutgoing

string

Icon for active outgoing call.

typeActiveOutgoingColor

string

typeUnknown

string

Icon for unknown call type.

typeUnknownColor

string

refresh

decimal

Sets the update rate for the call list in seconds

../../../../_images/en_config_widgets_plugins_tr064_index_editor_attributes.png

Attributes in the editor (simple view) [1]

Allowed child-elements and their attributes

Element

Attribute

Structure

Name

Content

Description

calllist
  • layout

colspan

decimal

Amount of columns this widget should be wide.

colspan-m

decimal

Overrules the amount of columns on a medium screen.

colspan-s

decimal

Overrules the amount of columns on a small screen.

rowspan

decimal

Amount of rows this widget should be high.

x

string

Horizontal position of the widget for 2D pages.

x-s

string

Horizontal position of the widget for 2D pages on a small screen.

x-m

string

Horizontal position of the widget for 2D pages on a medium screen.

y

string

Vertical position of the widget for 2D pages.

y-s

string

Vertical position of the widget for 2D pages on a small screen.

y-m

string

Vertical position of the widget for 2D pages on a medium screen.

z

string

Reserved for future use.

width

string

Width for the widget for 2D pages.

width-s

string

Width for the widget for 2D pages on a small screen.

width-m

string

Width for the widget for 2D pages on a medium screen.

scale

true or false

Enable/Disable scaling layout values relative to backdrop on 2d pages (default: true).

scale-s

true or false

Enable/Disable scaling layout values relative to backdrop on 2d pages on a small screen (default: true).

scale-m

true or false

Enable/Disable scaling layout values relative to backdrop on 2d pages on a medium screen (default: true).

Element

Attribute

Structure

Name

Content

Description

calllist
  • label

  • icon

name

string

Name of the icon registration.

type

string

flavour

string

Selection of a display variant. See also Flavour.

color

string

Color of the icon in CSS notation (e.g. #1188FF).

styling

string

Change the color of the displayed value depending on its value. See also Styling

class

string

Add this value to the CSS class so that it can be formatted by a user provided style sheet.

calllist
  • label

    • #text

string

Text to display a label for the widget.

Element

Attribute

Structure

Name

Content

Description

calllist
  • address

transform

string

Transformation of the bus system value to be shown.

mode

disable, read, write or readwrite

“disable” deactivates the communication, “read” will only fetch data from the backend, “write” will only write to it and an address with “readwrite” will be both, read from and written to.

variant

string

format-pos

decimal

Position for format string when multiple addresses are used.

selector

string

Only MQTT: JSON selector

qos

decimal

Only MQTT: QoS

retain

true or false

Only MQTT: retain flag

ignore-error

true or false

Only MQTT: ignore decode errors.

calllist
  • address

    • #text

string

The GA (like: 12/0/7) for KNX-backends, the item name for openHAB-backend or the MQTT topic

../../../../_images/en_config_widgets_plugins_tr064_index_editor_elements.png

Element in the editor

XML syntax

Alternatively it is possible to manually add the tr064 plugin entry to the visu_config.xml.

Caution

In the config only the UTF-8 charset is allowed. So an editor that is set to UTF-8 mode must be used.

The minimale example code for the calllist widget to create the shown screenshot is:

<?xml version="1.0" encoding="UTF-8"?>
<meta>
    <plugins>
        <plugin name="tr064" />
    </plugins>
</meta>
<page name="TR-064" type="text">
    <calllist device="fritzbox">
        <label>calllist</label>
    </calllist>
</page>
calllist, einfaches Beispiel

calllist, einfaches Beispiel

...
<meta>
    <plugins>
        <plugin name="tr064"/>
    </plugins>
</meta>
...
<calllist device="fritzbox">
    <label>calllist</label>
</calllist>

Prerequisites / setup of the server

To be able to use the plugin the server must support PHP with the extension of the SoapClient package.

On debian based systems it means that the php-soap package must be installed.

Setup of the Fritz!Box

To get access to the call list of the Fritz!Box a user with according permissions must be created (or an existing user account must be used). This is possible on the user page:

../../../../_images/fritzbox_overview.png

The user itself needs the rights to access the call list:

../../../../_images/fritzbox_user.png

The plugin needs to know the credentials to be able to use this user. This uses the “hidden configuration” infrastructure which can be accessed by the CometVisu manager [2].

../../../../_images/hidden_config_en.png

The used name must be given in the calllist widget in the attribute device.

The key and value pairs of the hidden configuration” are:

Key

Value

Example

uri

The URI to access the TR-064 interface

https://192.168.0.1:49443/

user

The username for the TR-064 access

CometVisuTestUser

pass

The password for the TR-64 access

pa3bvNM4j9z4

selfsigned

Allow self signed certificates when true

false

Apart from the manager it is possible to edit the file config/hidden.php manually and add a line like:

<?php
// File for configurations that shouldn't be shared with the user
$hidden = array(
  'fritzbox' => array('uri' => 'https://192.168.0.1:49443/', 'user' => 'CometVisuTestUser', 'pass' => 'pa3bvNM4j9z4')
);
?>

Hint

When the connection to the router is secured by SSL (i.e. the URI starts with https) it is usual that selfsigned must be set to true as a router in the home network will work usually with a self signed certificate.

The error message {"faultstring":"Could not connect to host","faultcode":"HTTP"} can be a hint that selfsigned should be set to true.

Footnotes