Freebox Binding

This binding integrates the Freebox Revolution to your openHab installation.

Supported Things

This binding supports the following thing types:

ThingThing TypeDescription
serverBridgeThe Freebox Revolution Server.
phoneThingThe phone wired to the Freebox Revolution.
net_deviceThingA network device on the local network.
net_interfaceThingA network interface from a device on the local network.
airplayThingAn AirPlay device in the local network.

Discovery

The Freebox Revolution server is discovered automatically through mDNS in the local network. After a Freebox Revolution is discovered and available to openHAB, the binding will automatically discover phone, network devices / interfaces and AirPlay devices with video capability in the local network. Note that the discovered thing will be setup to use only HTTP API (and not HTTPS) because only an IP can be automatically determined while a domain name is required to use HTTPS with a valid certificate.

Binding configuration

The binding has the following configuration options, which can be set for "binding:freebox":

ParameterNameDescriptionRequired
callbackUrlCallback URLURL to use for playing notification sounds, e.g. http://192.168.0.2:8080no

Thing Configuration

Server

The server bridge thing requires the following configuration parameters:

Parameter LabelParameter IDDescriptionRequiredDefault
Freebox Network AddressfqdnThe IP address / FQDN of the Freebox Server (can include port number).falsemafreebox.freebox.fr
Application tokenappTokenToken generated by the Freebox Server.false
Refresh IntervalrefreshIntervalThe refresh interval in seconds which is used to poll given Freebox Server.false30
Use only HTTP APIuseOnlyHttpUse HTTP API even if HTTPS is available.falsefalse

If the parameter ipAddress is not set, the binding will use the default address used by Free to access your Freebox Server (mafreebox.freebox.fr). The bridge thing will initialize only if a valid application token (parameter appToken) is filled.

Phone

The phone thing requires the following configuration parameters:

Parameter LabelParameter IDDescriptionRequiredDefault
Phone State Refresh IntervalrefreshPhoneIntervalThe refresh interval in seconds which is used to poll given Freebox Server for phone state.false2
Phone Calls Refresh IntervalrefreshPhoneCallsIntervalThe refresh interval in seconds which is used to poll given Freebox Server for phone calls.false60

Network device

The net_device thing requires the following configuration parameters:

Parameter LabelParameter IDDescriptionRequired
MAC AddressmacAddressThe MAC address of the network device.true

Network interface

The net_interface thing requires the following configuration parameters:

Parameter LabelParameter IDDescriptionRequired
IP AddressipAddressThe IP address (v4 or v6) of the network interface.true

AirPlay device

The airplay thing requires the following configuration parameters:

Parameter LabelParameter IDDescriptionRequired
NamenameName of the AirPlay devicetrue
PasswordpasswordAirPlay passwordfalse
Accept all MP3acceptAllMp3Accept any bitrate for MP3 audio or only bitrates greater than 64 kbpsfalse

HTTPS Access

Each Freebox server is now automatically assigned a random domain name (in addition to mafreebox.freebox.fr that can be used inside the local network), and an associated TLS certificate to enable secure access to API. This certificate is also valid for the domain name mafreebox.freebox.fr too. You must validate the certificate chain, by using the following Freebox ECC Root CA and Freebox RSA Root CA:

-----BEGIN CERTIFICATE-----
MIICWTCCAd+gAwIBAgIJAMaRcLnIgyukMAoGCCqGSM49BAMCMGExCzAJBgNVBAYT
AkZSMQ8wDQYDVQQIDAZGcmFuY2UxDjAMBgNVBAcMBVBhcmlzMRMwEQYDVQQKDApG
cmVlYm94IFNBMRwwGgYDVQQDDBNGcmVlYm94IEVDQyBSb290IENBMB4XDTE1MDkw
MTE4MDIwN1oXDTM1MDgyNzE4MDIwN1owYTELMAkGA1UEBhMCRlIxDzANBgNVBAgM
BkZyYW5jZTEOMAwGA1UEBwwFUGFyaXMxEzARBgNVBAoMCkZyZWVib3ggU0ExHDAa
BgNVBAMME0ZyZWVib3ggRUNDIFJvb3QgQ0EwdjAQBgcqhkjOPQIBBgUrgQQAIgNi
AASCjD6ZKn5ko6cU5Vxh8GA1KqRi6p2GQzndxHtuUmwY8RvBbhZ0GIL7bQ4f08ae
JOv0ycWjEW0fyOnAw6AYdsN6y1eNvH2DVfoXQyGoCSvXQNAUxla+sJuLGICRYiZz
mnijYzBhMB0GA1UdDgQWBBTIB3c2GlbV6EIh2ErEMJvFxMz/QTAfBgNVHSMEGDAW
gBTIB3c2GlbV6EIh2ErEMJvFxMz/QTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB
/wQEAwIBhjAKBggqhkjOPQQDAgNoADBlAjA8tzEMRVX8vrFuOGDhvZr7OSJjbBr8
gl2I70LeVNGEXZsAThUkqj5Rg9bV8xw3aSMCMQCDjB5CgsLH8EdZm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
VMvpWfS/X6R4Y3p8/eSio4BNuPvm9r0xp6IMpW92V8SYL0N6TQQxzZYgkLV7TbQI
Hw6v64yMbbF0YS9VjS0sFpZcFERVQiodRu7nYNC1jy8CAwEAAaNjMGEwHQYDVR0O
BBYEFD2erMkECujilR0BuER09FdsYIebMB8GA1UdIwQYMBaAFD2erMkECujilR0B
uER09FdsYIebMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMA0GCSqG
SIb3DQEBCwUAA4ICAQAZ2Nx8mWIWckNY8X2t/ymmCbcKxGw8Hn3BfTDcUWQ7GLRf
MGzTqxGSLBQ5tENaclbtTpNrqPv2k6LY0VjfrKoTSS8JfXkm6+FUtyXpsGK8MrLL
hZ/YdADTfbbWOjjD0VaPUoglvo2N4n7rOuRxVYIij11fL/wl3OUZ7GHLgL3qXSz0
+RGW+1oZo8HQ7pb6RwLfv42Gf+2gyNBckM7VVh9R19UkLCsHFqhFBbUmqwJgNA2/
3twgV6Y26qlyHXXODUfV3arLCwFoNB+IIrde1E/JoOry9oKvF8DZTo/Qm6o2KsdZ
dxs/YcIUsCvKX8WCKtH6la/kFCUcXIb8f1u+Y4pjj3PBmKI/1+Rs9GqB0kt1otyx
Q6bqxqBSgsrkuhCfRxwjbfBgmXjIZ/a4muY5uMI0gbl9zbMFEJHDojhH6TUB5qd0
JJlI61gldaT5Ci1aLbvVcJtdeGhElf7pOE9JrXINpP3NOJJaUSueAvxyj/WWoo0v
4KO7njox8F6jCHALNDLdTsX0FTGmUZ/s/QfJry3VNwyjCyWDy1ra4KWoqt6U7SzM
d5jENIZChM8TnDXJzqc+mu00cI3icn9bV9flYCXLTIsprB21wVSMh0XeBGylKxeB
S27oDfFq04XSox7JM9HdTt2hLK96x1T7FpFrBTnALzb7vHv9MhXqAT90fPR/8A==
-----END CERTIFICATE-----

First copy and paste on your server running openHAB these two public certificates in 2 files named for example /freeboxECC.crt and /freeboxRSA.crt. Then you have to import these two certificate as trusted public certificate for your installed Java Runtime Environment. On Linux server, the command is:

sudo keytool -import -trustcacerts -file /freeboxECC.crt -alias Freebox -keystore $JAVA_HOME/jre/lib/security/cacerts
sudo keytool -import -trustcacerts -file /freeboxRSA.crt -alias Freebox -keystore $JAVA_HOME/jre/lib/security/cacerts
sudo rm /freeboxECC.crt /freeboxRSA.crt

Authentication

You'll have to authorize openHAB to connect to your Freebox. Here is the process described :

Step 1 At binding startup, if no token is recorded in the Freebox Server (bridge) configuration, the following message will be displayed in the OSGi console :

            ####################################################################
            # Please accept activation request directly on your freebox        #
            # Once done, record Apptoken in the Freebox Item configuration     #
            # bEK7a7O8GkxxxxxxxxxxXBsKu/xxxttttwj5bXSssd5gUvSXs4vrpuhZwelEo804 #
            ####################################################################

Step 2 Run to your Freebox and approve the pairing request for openHAB Freebox Binding that is displayed on the Freebox screen

Step 3 Record the apptoken in the Freebox Server (bridge) configuration

Optionally you can log in your Freebox admin console to allocate needed rights to openhab

Once initialized, the thing will generate all available channels.

Channels

The following channels are supported:

ThingChannel Type IDItem TypeAccess ModeDescription
serverfwversionStringRVersion of the Freebox Server firmware
serveruptimeNumberRTime since last reboot of the Freebox Server
serverrestartedSwitchRIndicates whether the Freebox server hase restarted during the last poll period
servertempcpumNumberRActual measured CPU Marvell temperature
servertempcpubNumberRActual measured CPU Broadcom (xDSL) temperature
servertempswitchNumberRActual measured switch temperature
serverfanspeedNumberRActual measured fan speed (rpm)
serverrebootSwitchWReboots the Freebox server
serverlcd_brightnessNumberRWBrightness level of the screen in percent
serverlcd_orientationNumberRWScreen Orientation in degrees (0 or 90 or 180 or 270)
serverlcd_forcedSwitchRWIndicates whether the screen orientation forced
serverwifi_statusSwitchRWIndicates whether the WiFi network is enabled
serverftp_statusSwitchRWIndicates whether the FTP server is enabled
serverairmedia_statusSwitchRWIndicates whether Air Media is enabled
serverupnpav_statusSwitchRWIndicates whether UPnP AV is enabled
serversambafileshare_statusSwitchRWIndicates whether Window File Sharing is enabled
serversambaprintershare_statusSwitchRWIndicates whether Window Printer Sharing is enabled
serverxdsl_statusStringRStatus of the xDSL line
serverline_statusStringRStatus of network line connexion
serveripv4StringRPublic IP Address of the Freebox Server
serverrate_upNumberRCurrent upload rate in byte/s
serverrate_downNumberRCurrent download rate in byte/s
serverbytes_upNumberRTotal uploaded bytes since last connection
serverbytes_downNumberRTotal downloaded bytes since last connection
phonestate#onhookSwitchRIndicates whether the phone is on hook
phonestate#ringingSwitchRIs the phone ringing
phoneany#call_numberStringRLast call: number
phoneany#call_durationNumberRLast call: duration in seconds
phoneany#call_timestampDateTimeRLast call: creation timestamp
phoneany#call_statusStringRLast call: type (ingoing, outgoing, missed)
phoneany#call_nameStringRLast call: called name for outgoing calls. Caller name for incoming calls
phoneaccepted#call_numberStringRLast accepted call: number
phoneaccepted#call_durationNumberRLast accepted call: duration in seconds
phoneaccepted#call_timestampDateTimeRLast accepted call: creation timestamp
phoneaccepted#call_nameStringRLast accepted call: caller name
phonemissed#call_numberStringRLast missed call: number
phonemissed#call_durationNumberRLast missed call: duration in seconds
phonemissed#call_timestampDateTimeRLast missed call: creation timestamp
phonemissed#call_nameStringRLast missed call: caller name
phoneoutgoing#call_numberStringRLast outgoing call: number
phoneoutgoing#call_durationNumberRLast outgoing call: duration in seconds
phoneoutgoing#call_timestampDateTimeRLast outgoing call: creation timestamp
phoneoutgoing#call_nameStringRLast outgoing call: called name
net_devicereachableSwitchRIndicates whether the network device is reachable
net_interfacereachableSwitchRIndicates whether the network interface is reachable
airplayplayurlStringWPlay an audio or video media from the given URL
airplaystopSwitchWStop the media playback

Example

Things

Here is an example with minimal configuration parameters (using default values). It will first connect to mafreebox.freebox.fr using HTTPS (and will failback to HTTP if HTTPS access is not available).

Bridge freebox:server:fb "Freebox Revolution" [ appToken="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ] {
    Thing phone Phone "Phone"
    Thing net_device tv1 "TV living room" [ macAddress="XX:XX:XX:XX:XX:XX" ]
    Thing net_interface tv2 "TV bedroom" [ ipAddress="192.168.0.100" ]
    Thing airplay player "Freebox Player (AirPlay)" [ name="Freebox Player" ]
}

Here is another example overwritting default configuration parameters:

Bridge freebox:server:fb "Freebox Revolution" [ fqdn="abcdefgh.fbxos.fr", appToken="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", refreshInterval=20, useOnlyHttp=false ] {
    Thing phone Phone "Phone" [ refreshPhoneInterval=10, refreshPhoneCallsInterval=120 ]
    Thing net_device tv1 "TV living room" [ macAddress="XX:XX:XX:XX:XX:XX" ]
    Thing net_interface tv2 "TV bedroom" [ ipAddress="192.168.0.100" ]
    Thing airplay player "Freebox Player (AirPlay)" [ name="Freebox Player", password="1111", acceptAllMp3=false ]
}

Items

String Freebox_xdsl_status "Freebox state [%s]" {channel="freebox:server:fb:xdsl_status"}
String Freebox_cs_state "State [%s]" {channel="freebox:server:fb:line_status"}
String Freebox_cs_ipv4 "ipV4 [%s]" {channel="freebox:server:fb:ipv4"}
Number Freebox_cs_rate_up "Upload rate [%d b/s]" {channel="freebox:server:fb:rate_up"}
Number Freebox_cs_rate_down "Download rate [%d b/s]" {channel="freebox:server:fb:rate_down"}
Number Freebox_cs_bytes_up "Uploaded [%d bytes]" {channel="freebox:server:fb:bytes_up"}
Number Freebox_cs_bytes_down "Downloaded [%d bytes]" {channel="freebox:server:fb:bytes_down"}
String Freebox_sys_firmware_version "Version [%s]" {channel="freebox:server:fb:fwversion"}
Switch Freebox_reboot "Reboot freebox" {channel="freebox:server:fb:reboot"}
Switch Freebox_restarted "Restarted" {channel="freebox:server:fb:restarted"}
Number Freebox_sys_uptime "Uptime [%d sec]" {channel="freebox:server:fb:uptime"}
Number Freebox_sys_temp_cpum "Temp cpum [%d °C]" <temperature> {channel="freebox:server:fb:tempcpum"}
Number Freebox_sys_temp_cpub "Temp cpub [%d °C]" <temperature> {channel="freebox:server:fb:tempcpub"}
Number Freebox_sys_temp_sw "Temp sw [%d °C]" <temperature> {channel="freebox:server:fb:tempswitch"}
Number Freebox_sys_fan_rpm "Fan [%d rpm]" <fan> {channel="freebox:server:fb:fanspeed"}
Switch FreeboWifi "Wifi" {autoupdate="false", channel="freebox:server:fb:wifi_status"}
Switch FreeboxFTP "FTP" {autoupdate="false", channel="freebox:server:fb:ftp_status"}
Switch FreeboxUPnPAV "UPnP AV" {autoupdate="false", channel="freebox:server:fb:upnpav_status"}
Switch FreeboxAirMedia "AirMedia" {autoupdate="false", channel="freebox:server:fb:airmedia_status"}
Switch FreeboxSambaFiles "Win File Share" {autoupdate="false", channel="freebox:server:fb:sambafileshare_status"}
Switch FreeboxSambaPrinters "Win Print Share" {autoupdate="false", channel="freebox:server:fb:sambaprintershare_status"}
Number Freebox_lcd_brightness "Brightness [%d %%]" {channel="freebox:server:fb:lcd_brightness"}
Number Freebox_lcd_orientation "Orientation [%d °]" {channel="freebox:server:fb:lcd_orientation"}
Switch Freebox_lcd_forced "LCD Forced" {channel="freebox:server:fb:lcd_forced"}

Switch Freebox_onhook "Phone on hook" {channel="freebox:phone:fb:Phone:state#onhook"}
Switch Freebox_ringing "Phone ringing" {channel="freebox:phone:fb:Phone:state#ringing"}
String Freebox_call_number "Last call [%s]" {channel="freebox:phone:fb:Phone:any#call_number"}
String Freebox_call_name "Name [%s]" {channel="freebox:phone:fb:Phone:any#call_name"}
Number Freebox_call_duration "Duration [%d sec]" {channel="freebox:phone:fb:Phone:any#call_duration"}
DateTime Freebox_call_ts "TimeStamp [%1$tA %1$td %1$tR]" <calendar> {channel="freebox:phone:fb:Phone:any#call_timestamp"}
String Freebox_call_status "Status [%s]" {channel="freebox:phone:fb:Phone:any#call_status"}
String Freebox_accepted_call_number "Last accepted call [%s]" {channel="freebox:phone:fb:Phone:accepted#call_number"}
String Freebox_accepted_call_name "Caller name [%s]" {channel="freebox:phone:fb:Phone:accepted#call_name"}
Number Freebox_accepted_call_duration "Duration [%d sec]" {channel="freebox:phone:fb:Phone:accepted#call_duration"}
DateTime Freebox_accepted_call_ts "TimeStamp [%1$tA %1$td %1$tR]" <calendar> {channel="freebox:phone:fb:Phone:accepted#call_timestamp"}
String Freebox_missed_call_lastnum "Last missed call [%s]" {channel="freebox:phone:fb:Phone:missed#call_number"}
String Freebox_missed_call_name "Caller name [%s]" {channel="freebox:phone:fb:Phone:missed#call_name"}
Number Freebox_missed_call_duration "Duration [%d sec]" {channel="freebox:phone:fb:Phone:missed#call_duration"}
DateTime Freebox_missed_call_ts "TimeStamp [%1$tA %1$td %1$tR]" <calendar> {hannel="freebox:phone:fb:Phone:missed#call_timestamp"}
String Freebox_outcall_lastnum "Last outgoing call [%s]" {channel="freebox:phone:fb:Phone:outgoing#call_number"}
String Freebox_outcall_name "Called name [%s]" {channel="freebox:phone:fb:Phone:outgoing#call_name"}
Number Freebox_outcall_duration "Duration [%d sec]" {channel="freebox:phone:fb:Phone:outgoing#call_duration"}
DateTime Freebox_outcall_ts "TimeStamp [%1$tA %1$td %1$tR]" <calendar> {channel="freebox:phone:fb:Phone:outgoing#call_timestamp"}

Switch TVLivingRoom "TV living room" <television> {channel="freebox:net_device:fb:tv1:reachable"}
Switch TVBedroom "TV bedroom" <television> {channel="freebox:net_interface:fb:tv2:reachable"}

String freebox_player_playurl "URL [%s]" { channel="freebox:airplay:fb:player:playurl" }
Switch freebox_player_stop "Stop playback" { channel="freebox:airplay:fb:player:stop" }