Project

General

Profile

JSON-RPC Extension

This page describes the available JSON-RPC Extension, these are normally used by external application to interface with special functionality. For retrieving and/or updates devices, you don't need them.


Available Methods

Method Description
tools.openzwave.get Retrieves OpenZWave information
tools.openzwave.set Sets OpenZWave information, like On, Off, Dim, etc or configuration items
tools.rfxcom.get Retrieve RFXCom information
tools.rfxcom.set Sets RFXCom information, like On, Off, etc
tools.serialport.get Retrieve serialport information of the server


Tools OpenZWave

tools.openzwave.get

Retrieves information about the OpenZWave interface, normally used by the OpenZWave Commander. Currently there are 2 sub commands support, that are list and controller.

list

Description: Retrieves the number of enabled OpenZWave interfaces and their instance identifiers
Method: tools.openzwave.get

Fieldname Description Datatype Mandatory
command Value has to be list String Yes

Returns: JSONObject

Example:

-> {"jsonrpc": "2.0", "method": "tools.openzwave.get", "params": {"command": "list"}, "id": 1}
<- {"jsonrpc": "2.0", "result": {"count": 1, "instance_id: [1]}, "id": 1}

controller

Description: Retrieves OpenZWave controller information for a certain instance identifier. The information contains all Z-Wave information of all the devices and their current values.
Method: tools.openzwave.get

Fieldname Description Datatype Mandatory
command Value has to be controller String Yes
instance_id The instance identifier of the OpenZwave interface, this is retrieved during the list command Integer Yes

Returns: JSONObject

Example:

-> {"jsonrpc": "2.0", "method": "tools.openzwave.get", "params": {"command": "controller", "instance_id": 1}, "id": 1}
<- {"jsonrpc": "2.0", "result": {"instance_id": 1, "running": true, "serialport": "/dev/ttyACM0", "homeid": -62115494, "controllerid": 1, "controllertype": "SUC", "apiversion": "3.41", "sdkversion": "6.02.00", "wrapperversion": "DomoZWave version 2.10", "ozwversion": "OpenZWave version 1.1.r880", "allqueried": true, "statistics": {"sof": 108, "readaborts": 0, "badchecksum": 0, "read": 108, "write": 59, "can": 0, "nak": 0, "ack": 59, "oof": 0, "dropped": 0, "retries": 9, "callbacks": 2, "badroutes": 0, "noack": 12, "netbusy": 0, "notidle": 0, "nondelivery": 3, "routedbusy": 0, "broadcastread": 0, "broadcastwrite": 9}, "count": 8, "nodeinfo": [{"node_id": 1, "basic": "Static Controller", "generic": "Static Controller", "specific": "Static PC Controller", "listening": true, "frequentListening": false, "routing": true, "security": false, "beaming": true, "maxbaudrate": 40000, "manufacturername": "Vision", "productname": "ZU1401 Z-Wave USB Stick", "neighbors": "4, 6, 14, 15, 17, 19", "commandclass": "BASIC", "sdkversion": "6.02.00", "applicationversion": "", "libraryversion": "", "querystage": "Complete", "state": "Timeout", "lastseen": "N/A", "customname": "", "customlocation": "", "statistics": {"sent": 6, "sentfailed": 0, "retries": 2, "received": 0, "receiveddups": 0, "receivedunsolicited": 0, "lastrequestrtt": 0, "lastresponsertt": 0, "sentts": "2014-08-09 14:45:46:940 ", "receivedts": "2014-08-09 14:45:27:688 ", "averagerequesrtt": 0, "averageresponsertt": 0, "quality": 0}, "instances": []}, {"node_id": 2, "basic": "Routing Slave", "generic": "Binary Switch", "specific": "Binary Power Switch", "listening": true, "frequentListening": false, "routing": true, "security": false, "beaming": true, "maxbaudrate": 40000, "manufacturername": "FIBARO System", "productname": "FGWPE Wall Plug", "neighbors": "1, 15, 19", "commandclass": "BASIC, SWITCH_BINARY, SWITCH_ALL, VERSION, ALARM, POWERLEVEL, METER, CONFIGURATION, SENSOR_MULTILEVEL", "sdkversion": "4.54.02", "applicationversion": "22.22", "libraryversion": "3", "querystage": "Complete", "state": "Alive", "lastseen": "08/09/2014 14:45:59", "customname": "", "customlocation": "", "statistics": {"sent": 21, "sentfailed": 0, "retries": 2, "received": 16, "receiveddups": 0, "receivedunsolicited": 0, "lastrequestrtt": 24, "lastresponsertt": 43, "sentts": "2014-08-09 14:45:59:147 ", "receivedts": "2014-08-09 14:45:59:191 ", "averagerequesrtt": 26, "averageresponsertt": 46, "quality": 0}, "instances": [{"instance_id": 1, "values": [{"valuenum": 1, "value": "On"}, {"valuenum": 3, "value": "0.0W"}, {"valuenum": 2, "value": "0.0W"}]}], "config": [{"index": 1, "label": "Always on function", "type": "list", "value": "function inactive", "list": ["function activated", "function inactive"], "help": "Once activated, Wall Plug will keep a connected device constantly ON, will stop reacting to alarm frames and B-button push. \"Always on\" function turns the Plug into a power and energy meter. Also, connected device will not be turned off upon receiving an alarm frame from another Z-Wave device (parameter 35 will be ignored). In \"Always on\" mode, connected device may be turned off only after user defined power has been exceeded (parameter 70). In such a case, connected device can be turned on again by pushing the B-button or sending a control frame. By default, overload protection is inactive. Default setting: 1", "readonly": false, "writeonly": false}], "group": [{"group": 1, "max": 16, "label": "Group 1", "association": []}, {"group": 2, "max": 16, "label": "Group 2", "association": []}, {"group": 3, "max": 1, "label": "Send updates", "association": [1]}]}, {"node_id": 3, "basic": "Routing Slave", "generic": "Binary Switch", "specific": "Binary Power Switch", "listening": true, "frequentListening": false, "routing": true, "security": false, "beaming": true, "maxbaudrate": 40000, "manufacturername": "", "productname": "", "neighbors": "", "commandclass": "BASIC, SWITCH_BINARY, SWITCH_ALL", "sdkversion": "Unknown", "applicationversion": "", "libraryversion": "", "querystage": "Probe", "state": "Dead", "lastseen": "Never", "customname": "", "customlocation": "", "statistics": {"sent": 6, "sentfailed": 4, "retries": 2, "received": 0, "receiveddups": 0, "receivedunsolicited": 0, "lastrequestrtt": 0, "lastresponsertt": 0, "sentts": "2014-08-09 14:45:48:963 ", "receivedts": "2014-08-09 14:45:27:688 ", "averagerequesrtt": 0, "averageresponsertt": 0, "quality": 0}, "instances": []}]}, "id": 1}


tools.openzwave.set

Sets OpenZWave information, like turning on, off and dim devices. Also the controller commands like include and exclude are available.

Description:
Method: tools.openzwave.set

Fieldname Description Datatype Mandatory
command String Yes


Tools RFXCom

tools.rfxcom.get

Retrieves information about the RFXComTRX, RFXComRX and/or RFXComTX interface, normally used by the RFXCom Commander. Currently there are 2 sub commands support, that are list and controller.

list

Description: Retrieves the number of enabled RFXComTRX, RFXComRX and RFXComTX interfaces and their instance identifiers
Method: tools.rfxcom.get

Fieldname Description Datatype Mandatory
command Value has to be list String Yes

Returns: JSONObject

Example:

-> {"jsonrpc": "2.0", "method": "tools.rfxcom.get", "params": {"command": "list"}, "id": 1}
<- {"jsonrpc": "2.0", "result": {"count": 1, "rxcomtrx: [1], "rfxcomrx": [], "rfxcomrx": []}, "id": 1}

controller

Description: Retrieves RFXCom controller information for a certain instance identifier. The information contains all RFXComTRX, RFXComRX and RFXComTX information.
Method: tools.rfxcom.get

Fieldname Description Datatype Mandatory
command Value has to be controller String Yes
rfxcom Value can be rfxcomtrx, rfxcomrx or rfxcomtx String Yes
instance_id The instance identifier of the RFXCom interface, this is retrieved during the list command Integer Yes

Example:

-> {"jsonrpc": "2.0", "method": "tools.rfxcom.get", "params": {"command": "controller", "rfxcom": "rfxcomtrx", "instance_id": 1}, "id": 1}
<- {"jsonrpc": "2.0", "result": {"instance_id": 1, "receivertype": 83, "receivername": "Transceiver 433.92MHz", "protocols": ["ARC", "X10", "Oregon"], "firmwareversion": 87, "hardwareversion": 1, "interface": "serial", "host": "192.168.1.1:10020", "serialport": "/dev/ttyUSB0", "baudrate": 9600, relayenabled": False, "relayport": 10021, "globalx10": False, "oldaddrfmt": False}, "id": 1}


Tools RFXCom

tools.rfxcom.set

Sets information on the RFXComTRX, RFXComRX and/or RFXComTX interface. For the RFXComTRX you e.g. can turn on, off and dim devices, change protocols. The method for all 3 interfaces is the same tools.rfxcom.get, but you need to specify the proper type in your request. The sections below are split into the 3 different RFXCom devices.

RFXComTRX

Description: Sets information on the RFXComTRX interface
Method: tools.rfxcom.get

Fieldname Description Datatype Mandatory
rfxcom Value has to be rfxcomtrx String Yes
function Function to execute, allowed list is lighting1, lighting2, lighting5, lighting6, chime, protocolsetup, curtain, thermostat2, security1, fan, rfy String Yes

Additional fields required to be send, depending on the function:

Function lighting1 / lighting2

Fieldname Description Datatype Mandatory
type String Yes
address String Yes
command String Yes
group Boolean Yes

Function lighting5 / lighting6 / chime / curtain / thermostat2 / security1 / fan / rfy

Fieldname Description Datatype Mandatory
type String Yes
address String Yes
command String Yes

Function protocolsetup

Fieldname Description Datatype Mandatory
mode JSONArray of Byte Yes

Returns: Boolean

Example:

-> {"jsonrpc": "2.0", "method": "tools.rfxcom.set", "params": {"rfxcom": "rfxcomtrx"}, "id": 1}
<- {"jsonrpc": "2.0", "result": true, "id": 1}


Tools SerialPort

tools.serialport.get

Retrieves information about available serialports on the server. Currently only 1 command is support, list.

list

Description: Retrieves the serialport information
Method: tools.serialport.get

Fieldname Description Datatype Mandatory
command Value has to be list String Yes
path The path to the directory of serial devices String Yes
filter The filter pattern to apply to the found list String Yes

Returns: JSONObject

Example:

-> {"jsonrpc": "2.0", "method": "tools.serialport.get", "params": {"command": "list", "path": "/dev", "filter": "ttyS*"}, "id": 1}
<- {"jsonrpc": "2.0", "result": {"count": 2, "serialport": {"/devttyUSBZWave": "/dev/ttyUSB0", "/dev/ttyS0": "/dev/ttyS0"}}, "id": 1}


Resources

    Also available in: PDF HTML TXT