Fibaro System Rest API
Fibaro System Rest API
Fibaro System Rest API
FGHC Rest API Functions FHCR API is a tool to help developers everywhere create amazing applications
using unlimited capabilities of our system. Fibaro provides a simple RESTful API
where each type of resource has a URL that you can interact with. All resources
are encoded as JSON objects.
Using this website, you will get to know what kind of functions are available, find
out how to use them and what are their responses. We hope this will help you to
truly use Fibaro as you want it, by making new apps, websites and many others,
integrating our system into something else or just playing around.
The interface between your apps and the Home Center will evolve over time, but
we will do our best to maintain backwards compatibility and will inform you
timely before we roll out updates.
You may refer to Fibaro in plain text but you are not allowed to use Home
Center name and branding or to use Fibaro in any logo or graphics. What you
are allowed to do is to experiment and have fun.
Conditions of use
You are free to develop any kind of application you can imagine with Fibaro
system. There are just a few rules and restrictions you need to keep in mind:
You may not distribute the documentation shown in this document except by
links to the site itself or, if you use another method, these conditions of use
must be attached.
We want all your apps to work with our API to form a rich ecosystem of
interoperable applications, so it is a condition of access to our API
documentation that you do not use it to develop or distribute any systems or
devices which interpret the Fibaro API.
Make sure it is very clear from all you do that your app belongs to you and not
to Fibaro. Do not use any Home Center or Fibaro branding trademarks or trade
dress in any logo or graphics.
If you receive our API developer materials, you cannot claim ownership or IP
rights in any improvements of that material or in any of the APIs either with
respect to us or to other Fibaro app developers.
Please don’t make any applications that are obscene, not compliant with laws
and regulations, offensive or discriminatory or that infringe someone else’s
rights.
So, just as a reminder, before you can start having fun, you agree that by using
the API provided here to you, you accept these terms of use.
You can simply discover the current status of any variable by getting a response,
check it and make a change just by sending its the new value. That’s the basic
idea of a RESTful interface. All responses and new values are sent and returned
in JSON (JavaScript Object Notation) with UTF8 encoding so it’s easy to
generate or parse.
Fibaro is a bi-directional wireless system. This means that the signal is not only
sent to the receivers but also the receivers send the confirmation of its
reception. This operation confirms their status, which checks whether they are
active or not. Safety of the Fibaro System transmission is comparable to the
safety of transmission in data bus wired systems.
Fibaro operates in the free bandwidth for data transmission. The frequency
depends on radio regulations in individual countries. Each Fibaro network has its
own unique network identification number (home ID), which is why it is possible
to co-operate two or more independent systems in a single building without any
interference. In addition, each device gets its own ID – Node ID. Each, newly
added device gets two ID numbers – HOME ID and Node ID. Home ID is the
same for all devices within the network, while Node ID is unique for a given
node. If another controller (secondary master) is added to the network, it gets
the same HOME ID as the main controller.
Getting started
Make sure you have your Fibaro Home Center working properly. In case of
problems please go here, we will help you as soon as possible.
The fastest way to learn how to build apps which control our system is to use
the simple test web app built into the main controller. This lets you directly input
commands and send them.
First you need is to discover Home Center IP address. You can use Fibaro Finder
or just type in IP address into your web browser.
The simplest thing you can do with a FHCR API resource URL is GET it. (When
using REST API via HTTP, you “read” something by using the HTTP GET method).
Once you have the IP visit the following address in your web browser.
This website contains a list of available functions grouped into the categories.
You can simply click one of theme to expand a list of associated functions and
methods with short descriptions.
Now you can select one operation by clicking it. It will show its Response Class,
model and model schema. Detailed description is available at this website under
“API” section. “Try it out” button lets you test selected operation on your
connected Fibaro Home Center controller.
To retrieve a specific resource you can also append its identifier to the end of
the URL. The example below shows retrieving a specific device using the HTTP
GET method.
http://192.168.77.80/api/devices/1771
Document organization
API functions are divided into five main categories. Each of them contains
function URL, description, available methods, response with table of variables
and example.
o General API
o Settings API
o Panels API
o Plugins API
o Other
Glossary terms
Timestamp – a way to track time as a running total of seconds. This count starts
at the Unix Epoch on January 1st, 1970 at UTC.
The FHCR API consists of a set of commands that can be called over a REST web
service. The API commands fall into one of 4 categories, depending on the HTTP
method used:
Method: GET
Used for: Reading specific data from the Home Center controller.
Method: PUT
Method: POST
Method: DELETE
Commands using PUT and POST methods will normally require a message body
to be attached to the request. The message body must be formatted using
JSON. More details and examples for formatting the message body can be found
in the documentation for each command.
Response codes
200 OK
Unauthorized – authentication
401
required
Data types
Type Description
Note:
As you can see, by default a lot of data types are displayed as strings. It's
necessary to add a specified custom header to get the correct RESTful requests
data types as described in following example.
Example:
General settings
URL: /api/settings/info
Version of installed
softVersion String
software
Version of Z-wave
zwaveVersion String
software
Status of server in
serverStatus Number
seconds
Default interface
DefaultLanguage String
language
Availability of beta
updateBetaAvailable Boolean
version update
Newest version of
newestBetaVersion String
beta
Example:
"serialNumber": "HC2-000584",
"mac": "38:60:77:4e:5c:11",
"softVersion": "3.590",
"beta": false,
"zwaveVersion": "3.42",
"serverStatus": 1404743890,
"defaultLanguage": "en",
"sunsetHour": "21:08",
"sunriseHour": "04:51",
"hotelMode": false,
"updateStableAvailable": false,
"temperatureUnit": "C",
"updateBetaAvailable": true,
"newestBetaVersion": "3.591",
"batteryLowNotification": true,
"smsManagement": false
}
Backups
URL: /api/settings/backups
Methods: GET
id Number Backup id
Timestamp in
timestamp Number
seconds
Backup description
description String
created by the user
Example:
{
"id": 9,
"timestamp": 1405506755,
"devices": 143,
"rooms": 5,
"scenes": 10,
"description": "alpha->3.903"
}
Location
URL: /api/settings/location
Network time
ntp Boolean
protocol status
Selected
temperatureUnit String
temperature unit
Example:
{
"houseNumber": 3,
"timezone": "Europe/Warsaw",
"ntp": true,
"ntpServer": "",
"date":
{
"day": 16,
"month": 7,
"year": 2014
},
"time":
{
"hour": 15,
"minute": 11
},
"latitude": 52.425035319943,
"longitude": 16.9306182861328,
"city": "Poznan",
"temperatureUnit": "C",
"windUnit": "km/h",
"timeFormat": 24,
"dateFormat": "dd.mm.yy"
}
Network settings
URL: /api/settings/network
Home Center IP
ip String
address
Remote access
remoteAccess Boolean
availability status
Example:
{
"dhcp": true,
"ip": "192.168.100.45",
"mask": "255.255.254.0",
"gateway": "192.168.100.1",
"dns": "192.168.100.1",
"remoteAccess": true
General
Devices
URL: /api/devices
Description: Returns a list of devices, containing the main controller, all added
devices, virtual devices and plugins as well, including all their parameters,
properties and actions. Number of available data depends on the selected
device.
Response: Gets an array of objects containing all devices and their parameters.
id Number Device ID
Xml configuration
configXml Boolean
status
Time of last
modifier Number
modification
properties:
Z-Wave chip
zwaveCompany String
producer
Z-Wave protocol
zwaveInfo String
type and version
Wake up time in
wakeUpTime Number
seconds
Polling time in
pollingTimeSec Number
seconds
Battery level in
batteryLevel Number
percent
Alarm exclusion
alarmExclude String
status
Conditions of arming
armConditions String
an alarm
Arming delay in
armDelay String
seconds
Arming timestamp in
armTimeTimestamp String
seconds
Check if device is
configured String
configured
Check if device is
dead String
dead
ID of email
emailNotificationID String
notification
Status of usage in
fibaroAlarm String
Fibaro Alarm
Manufacturer of the
manufacturer String
device
Template of
parametersTemplate String
paramaters
Type of push
pushNotificationType String
notification
ID of the remote
remoteGatewayId String
gateway
Type of sms
smsNotificationType String
notification
Template usage
useTemplate String
status
actions:
Perform device
reconfigure Number
reconfiguration
Example:
{
"id": 1898,
"name": "1897.0",
"roomID": 0,
"type": "com.fibaro.FGMS001",
"baseType": "com.fibaro.motionSensor",
"enabled": true,
"visible": true,
"parentId": 1897,
"remoteGatewayId": 0,
"viewXml": false,
"configXml": false,
"interfaces":
[
"battery",
"zwave",
"zwaveWakeup"
],
"properties":
"zwaveCompany": "Fibargroup",
"zwaveInfo": "3,3,67",
"zwaveVersion": 2.6,
"wakeUpTime": 4000,
"pollingTimeSec": 0,
"batteryLevel": 100,
"alarmDelay": "0",
"alarmExclude": "false",
"alarmTimeTimestamp": "0",
"armConditions":
{
"auto": false,
"devices":
{
"id": 1898,
"propertyName": "value",
"propertyValue": "0"
}
],
"time": 0
},
"armConfig": "0",
"armDelay": "0",
"armError": "{}",
"armTimeTimestamp": "0",
"armed": "false",
"batteryLowNotification": "true",
"configured": "true",
"dead": "false",
"deviceControlType": "0",
"deviceIcon": "90",
"emailNotificationID": "0",
"emailNotificationType": "0",
"endPointId": "0",
"fibaroAlarm": "false",
"interval": "0",
"lastBreached": "1405522313",
"liliOffCommand": "",
"liliOnCommand": "",
"log": "",
"logTemp": "",
"manufacturer": "",
"markAsDead": "true",
"model": "",
"nodeId": "97",
"parametersTemplate": "270",
"productInfo": "1,15,8,0,16,1,2,6",
"pushNotificationID": "0",
"pushNotificationType": "0",
"remoteGatewayId": "0",
"saveLogs": "true",
"smsNotificationID": "0",
"smsNotificationType": "0",
"useTemplate": "true",
"value": "false"
},
"actions":
"forceArm": 0,
"meetArmConditions": 0,
"reconfigure": 0,
"setArmed": 1,
"setInterval": 1
},
"created": 1405516322,
"modified": 1405516322,
"sortOrder": 121
Sections
URL: /api/sections
id Number Section ID
{
"id": 2,
"name": "Floor",
"sortOrder": 2
}
Rooms
URL: /api/rooms
Description: Returns a list of rooms, their names, icons, sort orders, etc.
id Number Room ID
defaultSensors:
Main temperature
temperature Number
sensor
Main humidity
humidity Number
sensor
Example:
"id": 1,
"name": "bathroom",
"sectionID": 1,
"icon": "room_bathroom",
"defaultSensors":
{
"temperature": 1701,
"humidity": 1777,
"light": 0
},
"defaultThermostat": 0,
"sortOrder": 1
}
Scenes
URL: /api/scenes
id Number Section ID
Ability to be
killable Boolean
interrupted
Number of running
runningInstances Number
instances
Example:
{
"id": 20,
"type": "",
"properties": "",
"roomID": 0,
"iconID": 5,
"enabled": true,
"autostart": false,
"protectedByPIN": false,
"killable": true,
"runningInstances": 0,
"isLua": false,
"liliStartCommand": "",
"liliStopCommand": "",
"sortOrder": 119
}
Users
URL: /api/users
id Number Section ID
Rights to edit
deviceRights Array
devices
Notifications sending
sendNotification Boolean
status
Example:
{
"id": 1919,
"name": "test",
"type": "user",
"email": "test@test.pl",
"hasGPS": false,
"deviceRights":
[
],
"sceneRights":
[
],
"hotelRoom": 0,
"sendNotifications": false,
"tracking": 0,
"usePin": false,
"useOptionalArmPin": false,
"initialWizard": true
}
Global variables
URL: /api/globalVariables
Example:
"name": "var1",
"value": "1",
"readOnly": false,
"isEnum": false
RGB programs
URL: /api/RGBPrograms
Methods: GET, DELETE, POST, PUT
id Number Program ID
Example:
"id": 1,
"name": "Fireplace"
}
Tracking schedules
URL: /api/trackingSchedules
Description: Returns a list of weekly tracking schedules divided into four parts
of the day.
Current weather
id Number
condition code
Example:
{
"id": 2,
"MondayMorningHour": "6",
"MondayMorningHourTo": "12",
"MondayMorningTime": "0",
"MondayDayHour": "12",
"MondayDayHourTo": "18",
"MondayDayTime": "0",
"MondayEveningHour": "18",
"MondayEveningHourTo": "24",
"MondayEveningTime": "0",
"MondayNightHour": "24",
"MondayNightHourTo": "6",
"MondayNightTime": "0"
Linked devices
URL: /api/linkedDevices
Time of last
modified Number
modification
Array of linked
devices Array
devices
Linked device ID
id Number
number
Example:
{
"id": 3,
"roomID": 1,
"type": "heating",
"deviceID": 1716,
"devices":
[
"id": 1854,
"innerType": ""
}
],
"created": 1405605040,
"modified": 1405605040,
"sortOrder": 111
Virtual devices
URL: /api/virtualDevices
Description: Returns a list of virtual devices, their source codes, properties and
actions.
Virtual device ID
id Number
number
Time of last
modified Number
modification
properties:
ip String IP address
port Number Port number
Status of being
favourite Boolean
favourite
actions:
Example:
{
"id": 167,
"properties":
{
"deviceIcon": 0,
"ip": "",
"port": 0,
"currentIcon": "0",
"mainLoop": "",
"saveLogs": "1",
"rows":
[
{
"type": "button",
"elements":
[
{
"id": 1,
"lua": true,
"waitForResponse": false,
"caption": "Scene activation",
"name": "Button11",
"empty": false,
"msg": "HC2 = Net.FHttp("192.168.100.45") HC2:setBasicAuthentication("admin
"buttonIcon": 0,
"favourite": false,
"main": true
}
]
},
{
"type": "button",
"elements":
[
{
"id": 2,
"lua": true,
"waitForResponse": false,
"main": false
}
]
}
]
},
"actions":
{
"pressButton": 1,
"setSlider": 2,
"setProperty": 2
},
"created": 1405599778,
"modified": 1405599778,
"sortOrder": 117
}
iOS devices
URL: /api/iosDevices
Methods: GET
Unique device
udid String
identifier
Push notifications
push Boolean
status
Example:
"id": 1739,
"name": "iPod (Tom Jones)",
"udid": "2185A2FE-BBFF-4B83-8BDC-56508C0BF39B",
"push": true
}
VoIP devices
URL: /api/voip
Description: Returns a list of VoIP clients associated with Home Center end
their parameters.
Example:
"voipDevices":
[
{
"id": 2,
"sipDisplayName": "admin",
"sipUserID": "555",
"deviceIcon": "91"
}
]
}
Icons
URL: /api/icons
Methods: GET
Type of assigned
deviceType String
icon
Example:
"id": 7,
"deviceType": "com.fibaro.binarySwitch",
"iconSetName": "alarm"
Panels
SMS notifications
URL: /api/panels/sms
Methods: GET, PUT
Number of available
smsCount Number
sms
Array of added
phones Array
phones
id Number Phone ID
{
"smsCount": 0,
"phones":
[
{
"id": 3574,
"number": "4855555525255",
"alarm": false
}
]
}
Location
URL: /api/panels/location
id Number Location id
Time of last
modified Number
modification
Example:
History panel
URL: /api/panels/history
Methods: GET
Response:
id Number Event ID
Example:
{
"id": 2,
"deviceID": 269,
"timestamp": 1409204323,
"value": "26.0"
},
{
"id": 1,
"deviceID": 268,
"timestamp": 1409204323,
"value": "23.0"
}
Notifications panel
URL: /api/panels/notifications
id Number Notification ID
name String Notification name
Example:
{
"id": 1,
"name": "not1"
}
Heating panel
URL: /api/panels/heating
properties:
Manual mode
handTemperature Number
temperature
Manual mode
handTimestamp Number
timestamp
Example:
{
"id": 1,
"name": "zone1",
"properties":
{
"handTemperature": 22,
"handTimestamp": 1405172970,
"vacationTemperature": 18
}
}
AC panel
URL: /api/panels/cooling
properties:
Manual mode
handTemperature Number
temperature
Manual mode
handTimestamp Number
timestamp
Example:
{
"id": 2,
"name": "zone1",
"properties":
{
"handTemperature": 20,
"handTimestamp": 1405172970,
"vacationTemperature": 24
}
}
Humidity panel
URL: /api/panels/humidity
properties:
Manual mode
handHumidity Number
humidity level
Manual mode
handTimestamp Number
timestamp
Holiday mode
vacationHumidity Number
humidity level
Example:
{
"id": 1,
"name": "zone1",
"properties":
{
"handHumidity": 30,
"handTimestamp": 1405172970,
"vacationHumidity": 50
}
}
Alarm panel
URL: /api/panels/alarm
id Number Alarm ID
properties:
Drenchers panel
URL: /api/panels/drenchers
Adjusted water
adjustWater Number
percentage
Number of cycles
cycles Number
per day
id Number Sprinkler ID
Manual time of
manualTime Number
enable
days Array ?
cycles Array ?
Time of next
nextDrenching Number
drenching
{
"adjustWater": 0,
"rainDelay": 0,
"cycles": 1,
"drenchers":
[
{
"id": 1613,
"name": "1612.0",
"mode": "off",
"dead": "false",
"manualTime": 0,
"days":
[
],
"cycles":
[
],
"nextDrenching": 0,
"state": "true"
}
]
Favorite colors
URL: /api/panels/favoriteColors
id Number Preset ID
Example:
{
"id": 1,
"r": 125,
"g": 44,
"b": 125,
"w": 0
}
URL: /api/panels/fibaroAlarm
Description: Returns Fibaro Alarm settings list, its properties, conditions, etc.
Array of triggered
triggerActions Array
actions
id Number Action ID
Status of being
isPredefined Boolean
predefined
Status of being
isActive Boolean
active
properties:
Arrau of alarm
properties Array
properties
{
"lastAlarmTime": 0,
"triggerActions":
[
{
"id": 2,
"name": "Lights On",
"isPredefined": true,
"isActive": false,
"properties":
{
"conditions":
[
"type": "com.fibaro.binarySwitch",
"properties":
[
{
"name": "isLight",
"value": "1"
}
]
},
"type": "com.fibaro.multilevelSwitch",
"properties":
[
"name": "isLight",
"value": "1"
}
]
}
}
Energy panel
URL: /api/panels/energy
Methods: GET
Response: ?
Temperature panel
URL: /api/panels/temperature
Methods: GET
Description: Returns Temperature panel data
Response: ?
Events panel
URL: /api/panels/event
IP/api/panels/event?from=xxx&to=yyy
Methods: GET
Description: Returns events history from defined time, device states, state
changes, their old and new values, etc.
id Number Event ID
Device property
propertyName String
name
Example:
"id": 8126,
"type": "DEVICE_EVENT",
"timestamp": 1404723546,
"deviceID": 1701,
"deviceType": "com.fibaro.temperatureSensor",
"propertyName": "value",
"oldValue": 28.6,
"newValue": 26.7
}
Plugins
Plugins types
URL: /api/plugins/types
Methods: GET
Array of plugin’s
types Array
types
Number of plugin
category Number
category
Status of being
installed Boolean
installed
Example:
{
"types":
[
{
"category": 0,
"plugins":
[
{
"type": "com.fibaro.dscAlarm",
"iPad",
"iPhone",
"AndroidPhone",
"config"
],
"predefined": true,
"version": "1.0",
"url": "panels/external-alarm.html?type=com.fibaro.dscAlarm",
"installed": true
}
],
"installed": 6
]
}
Plugins installed
URL: /api/plugins/installed
Methods: GET
Plugin predefinition
predefined Boolean
status
Example:
{
"name": "com.fibaro.satelAlarm",
"predefined": true
}
Other
Login status
URL: /api/loginStatus
Type of logged in
type String
user
Example:
{
"status": true,
"userID": 2,
"username": "admin",
"type": "superuser"
}
Password reminder
URL: /api/passwordForgotten
Methods: GET
Correct response:
{
"status": "OK"
Example:
IP/api/passwordForgotten?login=xxx
Refresh states
URL: /api/refreshStates
Methods: GET
Example:
{
"status": "IDLE",
"last": 38,
[
],
"changes":
[
]
}
Network discovery
URL: /api/networkDiscovery/arp
Methods: PUT
Response:
Debug scene
URL: /api/scene/ID/debugMessages
ID – scene ID
Methods: GET
Example:
{
"timestamp": 1406036436,
"type": "DEBUG",
"txt": "Helloworld!"
}
Call Action
URL: /api/devices/deviceID/action/actionName
Methods: POST
Weather status
URL: /api/weather
Methods: GET
Current weather
ConditionCode String
condition code
Current humidity
Humidity String
level
Previous humidity
PreviousHumidity String
level
PreviousTemperatur Previous
String
e temperature
Current weather
WeatherCondition String
condition
Selected
TemperatureUnit String
temperature unit
Example:
{
"ConditionCode": "34",
"Humidity": "45",
"PreviousConditionCode": "30",
"PreviousHumidity": "48",
"PreviousTemperature": "27",
"PreviousWeatherConditionConverted": "cloudy",
"PreviousWind": "24.14",
"Temperature": "28",
"WeatherCondition": "rain",
"WeatherConditionConverted": "clear",
"Wind": "27.36",
"saveLogs": "1",
"TemperatureUnit": "C"
Diagnostics
URL: /api/diagnostics
Methods: GET
Percentage of free
memory Number
RAM memory
Percentage of used
used Number
space
Percentage of CPU
utilization that
user String occurred while
executing at the user
level
Percentage of CPU
utilization that
occurred while
nice String
executing at the user
level with nice
priority
Percentage of CPU
utilization that
system String occurred while
executing at the
system level
Percentage of time
that the CPU was
idle and the system
idle String
did not have an
outstanding disk I/O
request.
Example:
{
"memory": 62,
"storage":
[
{
"name": "system",
"used": 40
},
{
"name": "recovery",
"used": 22
],
"cpuLoad":
"cpu0":
{
"user": "291016",
"nice": "116",
"system": "237122",
"idle": "43946780"
}
},
{
"cpu1":
{
"user": "316296",
"nice": "324",
"system": "286170",
"idle": "45617346"
}
}
]
}