Development

Since version 0.1.163 there is a minimal XML-RPC server included.
The methods described below are the first ones I have defined, I use them in a web client I have build.
More will follow soon.

DomotiGa XML-RPC API Documentation Version 0.01

Method Description

system.listMethods
returns list of methods.
param: none

Example response:

<methodResponse> 
<params> 
<param> 
<value><array> 
<data> 
<value><string>system.listMethods</string></value> 
<value><string>system.methodHelp</string></value> 
<value><string>system.methodSignature</string></value> 
<value><string>system.program_version</string></value> 
<value><string>system.pid</string></value> 
<value><string>system.hostname</string></value> 
<value><string>data.newmessages</string></value> 
<value><string>data.sunmoon</string></value> 
<value><string>mode.get_housemode</string></value> 
<value><string>mode.get_mutemode</string></value> 
<value><string>globalvar.list</string></value> 
<value><string>device.list</string></value> 
<value><string>device.listswitch</string></value> 
<value><string>device.listdim</string></value> 
</data> 
</array></value> 
</param> 
</params> 
</methodResponse>

system.methodHelp
returns help for method.
param: method (string)

system.methodSignature
no function

system.program_version
returns version of domotiga
param: null

Example response:

<methodResponse> 
<params> 
<param> 
<value><string>0.1.163</string></value> 
</param> 
</params> 
</methodResponse>

system.pid
returns process id of domotiga
param: null

Example response:

<methodResponse> 
<params> 
<param> 
<value><string>6876</string></value> 
</param> 
</params> 
</methodResponse>

system.hostname
returns hostname of domotiga server
param: null

Example response:

<methodResponse> 
<params> 
<param> 
<value><string>server</string></value> 
</param> 
</params> 
</methodResponse>

api.version
returns version of api
param: null

Example response:

<methodResponse>
<params> 
<param> 
<value><string>0.01</string></value> 
</param> 
</params> 
</methodResponse>

data.newmessages
returns new mails, calls and voicemails
param: null

Example response:

<methodResponse> 
<params> 
<param> 
<value><array> 
<data> 
<value><string>0</string></value> 
<value><string>0</string></value> 
<value><string>0</string></value> 
</data> 
</array></value> 
</param> 
</params> 
</methodResponse>

data.sunmoon
returns sun and moon data
param:null

Note: currently only reports sunrise and sunset

Example response:

<methodResponse> 
<params> 
<param> 
<value><array> 
<data> 
<value><string>6:49</string></value> 
<value><string>18:50</string></value> 
</data> 
</array></value> 
</param> 
</params> 
</methodResponse>

mode.get_housemode
returns the house mode
param: null

Example response:

<methodResponse> 
<params> 
<param> 
<value><string>vacation</string></value> 
</param> 
</params> 
</methodResponse>

mode.get_mutemode
returns the mute mode
param: null

Example response:

<methodResponse> 
<params> 
<param> 
<value><boolean>1</boolean></value> 
</param> 
</params> 
</methodResponse>

globalvar.list
returns a list of global variables
param: null

Example response:

<methodResponse> 
<params> 
<param> 
<value><array> 
<data> 
<value><string>Second</string></value> 
<value><string>Minute</string></value> 
<value><string>Hour</string></value> 
<value><string>Day</string></value> 
<value><string>Month</string></value> 
<value><string>Weekday</string></value> 
<value><string>Time_Of_Day</string></value> 
<value><string>Year</string></value> 
<value><string>Sunrise</string></value> 
<value><string>Sunset</string></value> 
<value><string>Sunrise_Twilight</string></value> 
<value><string>Sunset_Twilight</string></value> 
<value><string>Season</string></value> 
<value><string>House_Mode</string></value> 
<value><string>Mode_Set</string></value> 
<value><string>Last_User</string></value> 
<value><string>Mute</string></value> 
<value><string>Dark</string></value> 
<value><string>Weekend</string></value> 
</data> 
</array></value> 
</param> 
</params> 
</methodResponse>

device.list
returns a list of devices
param: null

Only devices which are enabled and have hide flag unset are displayed.
Returns select set of their fields.
Format is a struct with a string for each device, fields are separated with ';;'

Fields are returned in this order:

Device id

Icon (with current status)

Name

Location

Value1

Label1

Value2

Label2

Value3

Label3

Value4

Label4

Last seen

Example response:

<methodResponse> 
<params> 
<param> 
<value><struct> 
<member><name>Porch Light</name> 
<value><string>1;;light-off.png;;Porch Light;;Frontdoor;;Off;;;;;;;;;;;;;;;;13:05:40</string></value> 
</member> 
<member><name>Power Usage</name> 
<value><string>2;;energy.png;;Power Usage;;MeterCabinet;;5145563;;kWh;;120;;Watt;;;;;;;;;;15:22:27</string></value> 
</member> 
<member><name>Laundryroom Light</name> 
<value><string>3;;light-off.png;;Laundryroom Light;;Laundryroom;;Off;;;;;;;;;;;;;;;;2008-10-16 20:04:51</string></value> 
</member> 
</struct></value> 
</param> 
</params> 
</methodResponse>

device.listswitch
returns a list of devices which can be switched
param: null

Returns select set of values, will change for sure in the future!
Format is a struct with a string for each device, fields separated with ';;'

Fields are returned in this order:

Device id

Icon (with current status)

Name

Value1

Example response:

<methodResponse> 
<params> 
<param> 
<value><struct> 
<member><name>Porch Light</name> 
<value><string>1;;light-off.png;;Porch Light;;Off</string></value> 
</member> 
<member><name>DomotiGa Server</name> 
<value><string>34;;light-on.png;;DomotiGa Server;;On</string></value> 
</member> 
<member><name>Close-in Boiler</name> 
<value><string>35;;light-on.png;;Close-in Boiler;;On</string></value> 
</member> 
</struct></value> 
</param> 
</params> 
</methodResponse>

device.listdim
returns a list of devices which can be dimmed
param: null

Same as device.listswitch response.

V0.02 Changes

Added:

system.program_uptime
returns the program uptime
param: null

Example response:

<methodResponse> 
<params> 
<param> 
<value><string>6 days, 12 hrs, 1 min, and 28 secs.</string></value> 
</param> 
</params> 
</methodResponse>

V0.03 Changes

Added:

module.restart
reload config and restart module modulename
param: modulename (string)

Returns TRUE or FALSE.

Example response:

<methodResponse> 
<params> 
<param> 
<value><boolean>TRUE</boolean></value> 
</param> 
</params> 
</methodResponse>

send.email
send e-mail to address param1, with subject param2 and body param3

Returns TRUE or FALSE.

Example response:

<methodResponse> 
<params> 
<param> 
<value><boolean>TRUE</boolean></value> 
</param> 
</params> 
</methodResponse>

send.tweet
send tweet with param1 as contents

send.sms
send sms to param1, with param2 as contents

set.housemode
set house mode to param1

set.mutemode
set mute mode to param1

device.setdevice
"set device param1 with value param2

set.alarmpin
set alarm pin to param1

set.alarmmode
set alarm mode to param1

play.sound
play sound param1 with volume param2

voicetext.speak
speak text param1 with voice param2

pachube.list
get pachube device list in eeml

V0.04 Changes

rrdtool.listgraphs
get list of rrdtool graph images in group param1

rrdtool.updategraphs
update rrdtool graph images in group param1 for range param2

V0.05 Changes

display.ledmessage
display message param2 on display with id param1

V0.06 Changes

av.setcontrol
set audio/video param1 with command param2, value param3, address param4

av.getcontrol
get audio/video param1 setting param2, address param3

V0.07 Changes

rrdtool.createrrds
create rrdtool database for device id param1

V0.08 Changes

Added methods for open-zwave wrapper.

zwave.removenodes
zwave - remove all nodes

zwave.createnode
zwave - create node.

zwave.setids
zwave - set ids.

zwave.basicreport
see zwave.basicreport in 0.13 changes

zwave.allqueried
zwave - all queried.

V0.09 Changes

cmdr.culsimulate
cmdr inject cul packet in simulator.

cmdr.culqueuecommand
cmdr queue cul command.

cmdr.plcbustxcommand
cmdr plcbus queue command.

V0.10 Changes

globalvar.del
delete global variable param1.

V0.11 Changes

Added methods for thermostat functions.

thermostat.listscenario
thermostat list all scenarii.

thermostat.getscenario
thermostat get active scenario.

thermostat.setscenario
thermostat set scenario.

thermostat.derogateheating
thermostat change requested temperature for a heating.

V0.12 Changes

events.runactions
run all actions from event with id param1

events.runaction
run action with id param1

V0.13 Changes

zwave.basicreport
this method doesn't exist anymore and is renamed to zwave.setvalue

zwave.setvalue
set zwave device value, param1 = homeid, param2 nodeid, param3 = instanceid, param4 = value_no, param5 = value

device.getstate
returns device state (same as Value1 like On/Off/Dim xx/Temp etc) of device with name in param1

V0.14 Changes

calendar.setplanning
set occupancy planning

calendar.getplanning
get occupancy planning

V0.15 Changes

squeezebox.setvolumeplayer
set volume param2 for player with id param1

squeezebox.getvolumeplayer
get volume from player with id param1

squeezebox.stopplayer
stop player with id param1

squeezebox.playplayer
start player with id param1

squeezebox.nextnumberplayer
play next number on player with id param1

squeezebox.prevnumberplayer
play previous number on player with id param1

squeezebox.getcurrentnumberplayer
get current number from player with id param1

squeezebox.getalbums
get albums from squeezeserver

squeezebox.getmodeplayer
get mode player from player with id param1

squeezebox.getplayerid
get player id for player param1

squeezebox.getplayername
get player name for player param1

squeezebox.getisplayer
get player type from player with id param1

squeezebox.clearplaylistplayer
clear playlist player for player with id param1

squeezebox.addalbumtoplaylistplayer
add album param2 to playlist for player with id param1

squeezebox.getcurrentartistplayer
get current artist for player with id param1

squeezebox.getplayerisconnectedtoserver
is player with id param1 connected to server

Debug XML-RPC

XML-RPC responses can be debugged with for example the xml-rpc php debugger found here:
http://gggeek.raprap.it/debugger/
Download and use it in your on lan, because the public version will log the traffic.

Related Resources

Comment

    Updated by: rdnzl, Updated 22 days ago
    Access count: 728 since 2011-08-25

    Attached Files