Here is documentation on API methods.
First here are the specifications (JSON RPC 2.0) : http://www.jsonrpc.org/specification
Access to the API is via the url : URL_JEEDOM/core/api/jeeApi.php
Here is an example of configuring a Json object that can be used in the body of a request made by an HTTP agent:
json
{
"jsonrpc": "2.0",
"id": "007",
"method": "event::changes",
"params": {
"apikey": "",
"datetime": "0"
}
}
‘’
Return pong, test communication with Jeedom
Returns the version of Jeedom
Returns the Jeedom datetime in microseconds
Returns a configuration value.
Json settings :
string key : configuration value key to return
string plugin : (optional), configuration value plugin
string default : (optional), value to return if the key does not exist
Saves a configuration value
Json settings :
string value : value to record
string key : configuration value key to save
string plugin : (optional), plugin of the configuration value to save
Returns the list of changes since the datetime passed in parameter (must be in microseconds). You will also have in the response the current datetime of Jeedom (to be reused for the following query)
Json settings :
Returns the list of all plugins
Json settings :
int activateOnly = 0 (only returns the list of activated plugins)
int orderByCaterogy = 0 (returns the list of plugins sorted by category)
Returns the list of all objects
Returns the list of all objects, with for each object all its equipment and for each equipment all its commands as well as their states (for commands of type info)
Returns an object with all its equipment and for each equipment all its commands as well as their states (for commands of type info)
Json settings :
Returns the specified object
Settings:
Returns an object, its equipment and for each equipment all its commands as well as the cell states (for info type commands)
Returns the specified object
Settings:
int id (empty if it is a creation)
string name
int father_id = null
int isVisible = 0
int position
array configuration
array display
Returns the global summary for the key passed in parameter
Settings:
Returns the summary for the object id
Settings:
int id : object id
string key : (optional), key of the desired summary, if empty then Jeedom returns the summary for all the keys
Returns the list of all equipment
Returns a device and its commands as well as their states (for info type commands)
Settings:
Returns the specified equipment
Settings:
Returns all equipment belonging to the specified type (plugin)
Settings:
Returns all equipment belonging to the specified object
Settings:
Returns an equipment table according to the parameters.
The return will be of the form array ('eqType1' ⇒array ('id'⇒…,' cmds' ⇒ array (….)), 'eqType2' ⇒array ('id'⇒…,' cmds' ⇒ array (….))….,id1 ⇒ array ('id'⇒…,' cmds '⇒ array (….)), id2 ⇒ array (' id'⇒…, 'cmds' ⇒ array(….))..)
Settings:
string \ [] eqType = table of the types of equipment required
int \ [] id = table of desired custom equipment IDs
Returns the registered / created equipment
Settings:
int id (empty if it is a creation)
string eqType_name (type of script, virtual equipment…)
string name
string logicalId = ‘’
int object_id = null
int eqReal_id = null
int isVisible = 0
int isEnable = 0
array configuration
int timeout
array category
Returns the list of all commands
Returns the specified command
Settings:
Returns all commands belonging to the specified equipment
Settings:
Execute the specified command
Settings:
int id : command id or id array if you want to execute multiple commands at once
\ [options ] List of command options (depends on the type and subtype of the command)
Returns the statistics on the order (only works on info and historical orders)
Settings:
int id
string startTime : start date of statistics calculation
string endTime : end date of statistics calculation
Returns the trend on the order (only works on info and historical orders)
Settings:
int id
string startTime : trend calculation start date
string endTime : trend calculation end date
Returns the order history (only works on info and historical orders)
Settings:
int id
string startTime : history start date
string endTime : history end date
Returns the specified object
Settings:
int id (empty if it is a creation)
string name
string logicalId
string eqType
string order
string type
string subType
int eqLogic_id
int isHistorized = 0
string unit = ‘’
array configuration
array template
array display
array html
int value = null
int isVisible = 1
array alert
Allows you to send a value to a command
Settings:
int id
string value : valeur
datetime string : (optional) datetime value
Returns the list of all scenarios
Returns the specified scenario
Settings:
Returns the export of the scenario as well as the human name from the script
Settings:
Allows you to import a scenario.
Settings:
int id : id of the scenario in which to import (empty if creation)
string humanName : human name of the scenario (empty if creation)
array import : scenario (from the export scenario field::export)
Changes the state of the specified scenario.
Settings:
int id
string state: \ [Run, stop, enable, disable ]
Allows you to retrieve a log
Settings:
string log : name of the log to retrieve
string start : line number on which to start reading
string nbLine : number of lines to recover
Allows to write in a log
Settings:
string log : name of the log to retrieve
string type : log type (debug, info, warning, error)
string message : text message to write
string logicalId : logicalId of the generated message
Get the Jeedom logs list
Settings:
Empty a log
Settings:
Allows you to delete a log
Settings:
Get the value of a variable stored in the datastore
Settings:
string type : type of stored value (for scenarios it is scenario)
id linkId : -1 for the global (value for the default scenarios, or the scenario id)
string key : value name
Stores the value of a variable in the datastore
Settings:
string type : type of stored value (for scenarios it’s scenario)
id linkId : -1 for global (value for default scenarios, or the scenario id)
string key : value name
mixed value : value to record
Returns the list of all messages
Allows to write in a log
Settings:
string type : log type (debug, info, warning, error)
string message : message
string action : action
string logicalId : logicalId
Delete all messages
Try to match a request with an interaction, execute the action and respond accordingly
Settings:
query (request phrase)
int reply_cmd = NULL : Command ID to use to respond, if not specify then Jeedom returns the answer to you in the json
Returns the complete list of all interactions
Stop Jeedom
Restart Jeedom
Lets you know if the global state of Jeedom is OK
Lets launch a Jeedom update
Allows you to launch a backup of Jeedom
List of USB ports and names of USB keys connected to it
Installation / Update of a given plugin
Settings:
Deletion of a given plugin
Settings:
Returns information on the plugin dependency status
Settings:
Force installation of plugin dependencies
Settings:
Returns information about the status of the plugin daemon
Settings:
Force the demon to start
Settings:
Force demon stop
Settings:
Change the management mode of the daemon
Settings:
Returns a list of all installed components, their versions and associated information
Allows you to check for updates
Allows you to update Jeedom and all plugins
Settings:
Force the (re) start of the Jeedom DNS
Forces the DNS Jeedom to stop
Returns all elements of the timeline
Returns all the folders (category) of the timeline
Returns all the elements of the requested folder
Settings:
Return Jeedom DNS status
Here is an example of using the API. For the example below i use this php class which simplifies the use of the API.
Retrieving the list of objects :
`{.php}
$jsonrpc = new jsonrpcClient('#URL_JEEDOM#/core/api/jeeApi.php', #API_KEY#);
if ($ jsonrpc-> sendRequest ( 'jeeObject::all ', array())){
print_r ($ jsonrpc-> getResult ());
}else{
echo $ jsonrpc-> getError ();
}
‘’
Execution of an order (with the option of a title and a message)
`{.php}
$jsonrpc = new jsonrpcClient('#URL_JEEDOM#/core/api/jeeApi.php', #API_KEY#);
if ($ jsonrpc-> sendRequest ( 'cmd::execCmd ', array (' id' => #cmd_id#, 'options '=> array (' title '=>' Cuckoo ',' message '=>' It works')))){
echo 'OK';
}else{
echo $ jsonrpc-> getError ();
}
‘’
The API is of course usable with other languages (just a post on a page)