Difference between revisions of "Gateway Module Webservice API"

From OpenMotics
Jump to navigation Jump to search
Line 21: Line 21:
 
User management is enabled when the gateway is in authorized mode (authorized mode can be enabled by pressing the white button on the gateway for more than 5 seconds). If the gateway is not in authorized mode, HTTP status code 401 is returned.
 
User management is enabled when the gateway is in authorized mode (authorized mode can be enabled by pressing the white button on the gateway for more than 5 seconds). If the gateway is not in authorized mode, HTTP status code 401 is returned.
  
:♠ WebInterface.'''create_user'''(username, password)
+
----
 +
==== WebInterface.'''create_user'''(username, password) ====
 
::Create a new user using a username and a password. Only possible in authorized mode.
 
::Create a new user using a username and a password. Only possible in authorized mode.
 
::{|
 
::{|
Line 29: Line 30:
 
* password ('''String''') – Password of the user.
 
* password ('''String''') – Password of the user.
 
|}
 
|}
:♠ WebInterface.'''get_usernames'''()
+
----
 +
==== WebInterface.'''get_usernames'''() ====
 
::Get the names of the users on the gateway. Only possible in authorized mode.
 
::Get the names of the users on the gateway. Only possible in authorized mode.
 
::{|
 
::{|
Line 35: Line 37:
 
|‘usernames’: list of usernames (String).
 
|‘usernames’: list of usernames (String).
 
|}
 
|}
:♠ WebInterface.'''remove_user'''(username)
+
----
 +
==== WebInterface.'''remove_user'''(username) ====
 
::Remove a user. Only possible in authorized mode.
 
::Remove a user. Only possible in authorized mode.
 
::{|
 
::{|
Line 41: Line 44:
 
|username ('''String''') – Name of the user to remove.
 
|username ('''String''') – Name of the user to remove.
 
|}
 
|}
 
 
== Master modules ==
 
== Master modules ==
  
 
These API functions return which modules are known by the OpenMotics master. Discover mode can be used to detect new modules on the bus (this is only for modules attached to the master, power modules use seperate API calls).
 
These API functions return which modules are known by the OpenMotics master. Discover mode can be used to detect new modules on the bus (this is only for modules attached to the master, power modules use seperate API calls).
  
:♠ WebInterface.'''get_modules'''(token)
+
----
 +
==== WebInterface.'''get_modules'''(token) ====
 
::Get a list of all modules attached and registered with the master.
 
::Get a list of all modules attached and registered with the master.
 
::{|
 
::{|
Line 52: Line 55:
 
|‘output’: list of module types (O,R,D) and ‘input’: list of input module        types (I,T,L).
 
|‘output’: list of module types (O,R,D) and ‘input’: list of input module        types (I,T,L).
 
|}
 
|}
:♠ WebInterface.'''module_discover_start'''(token)
+
----
 +
==== WebInterface.'''module_discover_start'''(token) ====
 
::Start the module discover mode on the master.
 
::Start the module discover mode on the master.
 
::{|
 
::{|
Line 58: Line 62:
 
|‘status’: ‘OK’.
 
|‘status’: ‘OK’.
 
|}
 
|}
:♠ WebInterface.'''module_discover_stop'''(token)
+
----
 +
==== WebInterface.'''module_discover_stop'''(token) ====
 
::Stop the module discover mode on the master.
 
::Stop the module discover mode on the master.
 
::{|
 
::{|
Line 64: Line 69:
 
|‘status’: ‘OK’.
 
|‘status’: ‘OK’.
 
|}
 
|}
:♠ WebInterface.'''flash_leds'''(token, type, id)
+
----
 +
==== WebInterface.'''flash_leds'''(token, type, id) ====
 
::Flash the leds on the module for an output/input/sensor.
 
::Flash the leds on the module for an output/input/sensor.
 
::{|
 
::{|
Line 79: Line 85:
 
Below are the API functions for getting and setting the output status.
 
Below are the API functions for getting and setting the output status.
  
:♠ WebInterface.'''get_output_status'''(token)
+
----
 +
==== WebInterface.'''get_output_status'''(token) ====
 
::Get the status of the outputs.
 
::Get the status of the outputs.
 
::{|
 
::{|
Line 85: Line 92:
 
|‘status’: list of dictionaries with the following keys: id,        status, dimmer and ctimer.
 
|‘status’: list of dictionaries with the following keys: id,        status, dimmer and ctimer.
 
|}
 
|}
:♠ WebInterface.'''set_output'''(token, id, is_on, dimmer=None, timer=None)
+
----
 +
==== WebInterface.'''set_output'''(token, id, is_on, dimmer=None, timer=None) ====
 
::Set the status, dimmer and timer of an output.
 
::Set the status, dimmer and timer of an output.
 
::{|
 
::{|
Line 95: Line 103:
 
* timer ('''Integer in (150, 450, 900, 1500, 2220, 3120)''') – The timer value to set, None if unchanged
 
* timer ('''Integer in (150, 450, 900, 1500, 2220, 3120)''') – The timer value to set, None if unchanged
 
|}
 
|}
:♠ WebInterface.'''set_all_lights_off'''(token)
+
----
 +
==== WebInterface.'''set_all_lights_off'''(token) ====
 
::Turn all lights off.
 
::Turn all lights off.
:♠ WebInterface.'''set_all_lights_floor_off'''(token, floor)
+
----
 +
==== WebInterface.'''set_all_lights_floor_off'''(token, floor) ====
 
::Turn all lights on a given floor off.
 
::Turn all lights on a given floor off.
 
::{|
 
::{|
Line 103: Line 113:
 
|floor ('''Byte''') – The id of the floor
 
|floor ('''Byte''') – The id of the floor
 
|}
 
|}
:♠ WebInterface.'''set_all_lights_floor_on'''(token, floor)
+
----
 +
==== WebInterface.'''set_all_lights_floor_on'''(token, floor) ====
 
::Turn all lights on a given floor on.
 
::Turn all lights on a given floor on.
 
::{|
 
::{|
Line 113: Line 124:
 
Below are the API functions for getting and setting the thermostat status.
 
Below are the API functions for getting and setting the thermostat status.
  
:♠ WebInterface.'''get_thermostat_status'''(token)
+
----
 +
==== WebInterface.'''get_thermostat_status'''(token) ====
 
::Get the status of the thermostats.
 
::Get the status of the thermostats.
 
::{|
 
::{|
Line 119: Line 131:
 
|global status information about the thermostats: ‘thermostats_on’,
 
|global status information about the thermostats: ‘thermostats_on’,
 
|}::‘automatic’ and ‘setpoint’ and ‘status’: a list with status information for allthermostats, each element in the list is a dict with the following keys:‘id’, ‘act’, ‘csetp’, ‘output0’, ‘output1’, ‘outside’, ‘mode’.
 
|}::‘automatic’ and ‘setpoint’ and ‘status’: a list with status information for allthermostats, each element in the list is a dict with the following keys:‘id’, ‘act’, ‘csetp’, ‘output0’, ‘output1’, ‘outside’, ‘mode’.
:♠ WebInterface.'''set_current_setpoint'''(token, thermostat, temperature)
+
----
 +
==== WebInterface.'''set_current_setpoint'''(token, thermostat, temperature) ====
 
::Set the current setpoint of a thermostat.
 
::Set the current setpoint of a thermostat.
 
::{|
 
::{|
Line 130: Line 143:
 
|‘status’: ‘OK’.
 
|‘status’: ‘OK’.
 
|}
 
|}
:♠ WebInterface.'''set_thermostat_mode'''(token, thermostat_on, automatic, setpoint)
+
----
 +
==== WebInterface.'''set_thermostat_mode'''(token, thermostat_on, automatic, setpoint) ====
 
::Set the mode of the thermostats. Thermostats can be on or off, automatic or manualand is set to one of the 6 setpoints.
 
::Set the mode of the thermostats. Thermostats can be on or off, automatic or manualand is set to one of the 6 setpoints.
 
::{|
 
::{|
Line 142: Line 156:
 
|‘status’: ‘OK’.
 
|‘status’: ‘OK’.
 
|}
 
|}
:♠ WebInterface.'''get_sensor_temperature_status'''(token)
+
----
 +
==== WebInterface.'''get_sensor_temperature_status'''(token) ====
 
::Get the current temperature of all sensors.
 
::Get the current temperature of all sensors.
 
::{|
 
::{|
Line 150: Line 165:
 
== Other status ==
 
== Other status ==
  
:♠ WebInterface.'''get_last_inputs'''(token)
+
----
 +
==== WebInterface.'''get_last_inputs'''(token) ====
 
::Get the 5 last pressed inputs during the last 5 minutes.
 
::Get the 5 last pressed inputs during the last 5 minutes.
 
::{|
 
::{|
Line 156: Line 172:
 
|‘inputs’: list of tuples (input, output).
 
|‘inputs’: list of tuples (input, output).
 
|}
 
|}
:♠ WebInterface.'''get_pulse_counter_status'''(token)
+
----
 +
==== WebInterface.'''get_pulse_counter_status'''(token) ====
 
::Get the pulse counter values.
 
::Get the pulse counter values.
 
::{|
 
::{|
Line 162: Line 179:
 
|‘counters’: array with the 8 pulse counter values.
 
|‘counters’: array with the 8 pulse counter values.
 
|}
 
|}
:♠ WebInterface.'''get_sensor_humidity_status'''(token)
+
----
 +
==== WebInterface.'''get_sensor_humidity_status'''(token) ====
 
::Get the current humidity of all sensors.
 
::Get the current humidity of all sensors.
 
::{|
 
::{|
Line 168: Line 186:
 
|‘status’: List of 32 bytes, 1 for each sensor.
 
|‘status’: List of 32 bytes, 1 for each sensor.
 
|}
 
|}
:♠ WebInterface.'''get_sensor_brightness_status'''(token)
+
----
 +
==== WebInterface.'''get_sensor_brightness_status'''(token) ====
 
::Get the current brightness of all sensors.
 
::Get the current brightness of all sensors.
 
::{|
 
::{|
Line 178: Line 197:
 
Below are the API functions for getting and setting the OpenMotics Master configuration.
 
Below are the API functions for getting and setting the OpenMotics Master configuration.
  
:♠ WebInterface.'''get_output_configuration'''(token, id, fields=None)
+
----
 +
==== WebInterface.'''get_output_configuration'''(token, id, fields=None) ====
 
::Get a specific output_configuration defined by its id.
 
::Get a specific output_configuration defined by its id.
 
::{|
 
::{|
Line 189: Line 209:
 
|‘config’: output_configuration dict: contains ‘id’ (Id), ‘floor’ (Byte), ‘module_type’ (String[1]), ‘name’ (String[16]), ‘timer’ (Word), ‘type’ (Byte)
 
|‘config’: output_configuration dict: contains ‘id’ (Id), ‘floor’ (Byte), ‘module_type’ (String[1]), ‘name’ (String[16]), ‘timer’ (Word), ‘type’ (Byte)
 
|}
 
|}
:♠ WebInterface.'''get_output_configurations'''(token, fields=None)
+
----
 +
==== WebInterface.'''get_output_configurations'''(token, fields=None) ====
 
::Get all output_configurations.
 
::Get all output_configurations.
 
::{|
 
::{|
Line 198: Line 219:
 
|‘config’: list of output_configuration dict: contains ‘id’ (Id), ‘floor’ (Byte), ‘module_type’ (String[1]), ‘name’ (String[16]), ‘timer’ (Word), ‘type’ (Byte)
 
|‘config’: list of output_configuration dict: contains ‘id’ (Id), ‘floor’ (Byte), ‘module_type’ (String[1]), ‘name’ (String[16]), ‘timer’ (Word), ‘type’ (Byte)
 
|}
 
|}
:♠ WebInterface.'''set_output_configuration'''(token, config)
+
----
 +
==== WebInterface.'''set_output_configuration'''(token, config) ====
 
::Set one output_configuration.
 
::Set one output_configuration.
 
::{|
 
::{|
Line 204: Line 226:
 
|config ('''output_configuration dict: contains ‘id’ (Id), ‘floor’ (Byte), ‘name’ (String[16]), ‘timer’ (Word), ‘type’ (Byte)''') – The output_configuration to set
 
|config ('''output_configuration dict: contains ‘id’ (Id), ‘floor’ (Byte), ‘name’ (String[16]), ‘timer’ (Word), ‘type’ (Byte)''') – The output_configuration to set
 
|}
 
|}
:♠ WebInterface.'''set_output_configurations'''(token, config)
+
----
 +
==== WebInterface.'''set_output_configurations'''(token, config) ====
 
::Set multiple output_configurations.
 
::Set multiple output_configurations.
 
::{|
 
::{|
Line 210: Line 233:
 
|config ('''list of output_configuration dict: contains ‘id’ (Id), ‘floor’ (Byte), ‘name’ (String[16]), ‘timer’ (Word), ‘type’ (Byte)''') – The list of output_configurations to set
 
|config ('''list of output_configuration dict: contains ‘id’ (Id), ‘floor’ (Byte), ‘name’ (String[16]), ‘timer’ (Word), ‘type’ (Byte)''') – The list of output_configurations to set
 
|}
 
|}
:♠ WebInterface.'''get_input_configuration'''(token, id, fields=None)
+
----
 +
==== WebInterface.'''get_input_configuration'''(token, id, fields=None) ====
 
::Get a specific input_configuration defined by its id.
 
::Get a specific input_configuration defined by its id.
 
::{|
 
::{|
Line 221: Line 245:
 
|‘config’: input_configuration dict: contains ‘id’ (Id), ‘action’ (Byte), ‘basic_actions’ (Actions[15]), ‘module_type’ (String[1]), ‘name’ (String[8])
 
|‘config’: input_configuration dict: contains ‘id’ (Id), ‘action’ (Byte), ‘basic_actions’ (Actions[15]), ‘module_type’ (String[1]), ‘name’ (String[8])
 
|}
 
|}
:♠ WebInterface.'''get_input_configurations'''(token, fields=None)
+
----
 +
==== WebInterface.'''get_input_configurations'''(token, fields=None) ====
 
::Get all input_configurations.
 
::Get all input_configurations.
 
::{|
 
::{|
Line 230: Line 255:
 
|‘config’: list of input_configuration dict: contains ‘id’ (Id), ‘action’ (Byte), ‘basic_actions’ (Actions[15]), ‘module_type’ (String[1]), ‘name’ (String[8])
 
|‘config’: list of input_configuration dict: contains ‘id’ (Id), ‘action’ (Byte), ‘basic_actions’ (Actions[15]), ‘module_type’ (String[1]), ‘name’ (String[8])
 
|}
 
|}
:♠ WebInterface.'''set_input_configuration'''(token, config)
+
----
 +
==== WebInterface.'''set_input_configuration'''(token, config) ====
 
::Set one input_configuration.
 
::Set one input_configuration.
 
::{|
 
::{|
Line 236: Line 262:
 
|config ('''input_configuration dict: contains ‘id’ (Id), ‘action’ (Byte), ‘basic_actions’ (Actions[15]), ‘name’ (String[8])''') – The input_configuration to set
 
|config ('''input_configuration dict: contains ‘id’ (Id), ‘action’ (Byte), ‘basic_actions’ (Actions[15]), ‘name’ (String[8])''') – The input_configuration to set
 
|}
 
|}
:♠ WebInterface.'''set_input_configurations'''(token, config)
+
----
 +
==== WebInterface.'''set_input_configurations'''(token, config) ====
 
::Set multiple input_configurations.
 
::Set multiple input_configurations.
 
::{|
 
::{|
Line 242: Line 269:
 
|config ('''list of input_configuration dict: contains ‘id’ (Id), ‘action’ (Byte), ‘basic_actions’ (Actions[15]), ‘name’ (String[8])''') – The list of input_configurations to set
 
|config ('''list of input_configuration dict: contains ‘id’ (Id), ‘action’ (Byte), ‘basic_actions’ (Actions[15]), ‘name’ (String[8])''') – The list of input_configurations to set
 
|}
 
|}
:♠ WebInterface.'''get_thermostat_configuration'''(token, id, fields=None)
+
----
 +
==== WebInterface.'''get_thermostat_configuration'''(token, id, fields=None) ====
 
::Get a specific thermostat_configuration defined by its id.
 
::Get a specific thermostat_configuration defined by its id.
 
::{|
 
::{|
Line 253: Line 281:
 
|‘config’: thermostat_configuration dict: contains ‘id’ (Id), ‘auto_fri’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_mon’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sat’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sun’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_thu’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_tue’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_wed’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘name’ (String[16]), ‘output0’ (Byte), ‘output1’ (Byte), ‘pid_d’ (Byte), ‘pid_i’ (Byte), ‘pid_int’ (Byte), ‘pid_p’ (Byte), ‘sensor’ (Byte), ‘setp0’ (Temp), ‘setp1’ (Temp), ‘setp2’ (Temp), ‘setp3’ (Temp), ‘setp4’ (Temp), ‘setp5’ (Temp)
 
|‘config’: thermostat_configuration dict: contains ‘id’ (Id), ‘auto_fri’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_mon’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sat’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sun’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_thu’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_tue’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_wed’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘name’ (String[16]), ‘output0’ (Byte), ‘output1’ (Byte), ‘pid_d’ (Byte), ‘pid_i’ (Byte), ‘pid_int’ (Byte), ‘pid_p’ (Byte), ‘sensor’ (Byte), ‘setp0’ (Temp), ‘setp1’ (Temp), ‘setp2’ (Temp), ‘setp3’ (Temp), ‘setp4’ (Temp), ‘setp5’ (Temp)
 
|}
 
|}
:♠ WebInterface.'''get_thermostat_configurations'''(token, fields=None)
+
----
 +
==== WebInterface.'''get_thermostat_configurations'''(token, fields=None) ====
 
::Get all thermostat_configurations.
 
::Get all thermostat_configurations.
 
::{|
 
::{|
Line 262: Line 291:
 
|‘config’: list of thermostat_configuration dict: contains ‘id’ (Id), ‘auto_fri’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_mon’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sat’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sun’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_thu’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_tue’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_wed’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘name’ (String[16]), ‘output0’ (Byte), ‘output1’ (Byte), ‘pid_d’ (Byte), ‘pid_i’ (Byte), ‘pid_int’ (Byte), ‘pid_p’ (Byte), ‘sensor’ (Byte), ‘setp0’ (Temp), ‘setp1’ (Temp), ‘setp2’ (Temp), ‘setp3’ (Temp), ‘setp4’ (Temp), ‘setp5’ (Temp)
 
|‘config’: list of thermostat_configuration dict: contains ‘id’ (Id), ‘auto_fri’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_mon’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sat’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sun’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_thu’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_tue’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_wed’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘name’ (String[16]), ‘output0’ (Byte), ‘output1’ (Byte), ‘pid_d’ (Byte), ‘pid_i’ (Byte), ‘pid_int’ (Byte), ‘pid_p’ (Byte), ‘sensor’ (Byte), ‘setp0’ (Temp), ‘setp1’ (Temp), ‘setp2’ (Temp), ‘setp3’ (Temp), ‘setp4’ (Temp), ‘setp5’ (Temp)
 
|}
 
|}
:♠ WebInterface.'''set_thermostat_configuration'''(token, config)
+
----
 +
==== WebInterface.'''set_thermostat_configuration'''(token, config) ====
 
::Set one thermostat_configuration.
 
::Set one thermostat_configuration.
 
::{|
 
::{|
Line 268: Line 298:
 
|config ('''thermostat_configuration dict: contains ‘id’ (Id), ‘auto_fri’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_mon’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sat’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sun’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_thu’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_tue’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_wed’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘name’ (String[16]), ‘output0’ (Byte), ‘output1’ (Byte), ‘pid_d’ (Byte), ‘pid_i’ (Byte), ‘pid_int’ (Byte), ‘pid_p’ (Byte), ‘sensor’ (Byte), ‘setp0’ (Temp), ‘setp1’ (Temp), ‘setp2’ (Temp), ‘setp3’ (Temp), ‘setp4’ (Temp), ‘setp5’ (Temp)''') – The thermostat_configuration to set
 
|config ('''thermostat_configuration dict: contains ‘id’ (Id), ‘auto_fri’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_mon’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sat’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sun’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_thu’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_tue’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_wed’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘name’ (String[16]), ‘output0’ (Byte), ‘output1’ (Byte), ‘pid_d’ (Byte), ‘pid_i’ (Byte), ‘pid_int’ (Byte), ‘pid_p’ (Byte), ‘sensor’ (Byte), ‘setp0’ (Temp), ‘setp1’ (Temp), ‘setp2’ (Temp), ‘setp3’ (Temp), ‘setp4’ (Temp), ‘setp5’ (Temp)''') – The thermostat_configuration to set
 
|}
 
|}
:♠ WebInterface.'''set_thermostat_configurations'''(token, config)
+
----
 +
==== WebInterface.'''set_thermostat_configurations'''(token, config) ====
 
::Set multiple thermostat_configurations.
 
::Set multiple thermostat_configurations.
 
::{|
 
::{|
Line 274: Line 305:
 
|config ('''list of thermostat_configuration dict: contains ‘id’ (Id), ‘auto_fri’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_mon’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sat’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sun’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_thu’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_tue’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_wed’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘name’ (String[16]), ‘output0’ (Byte), ‘output1’ (Byte), ‘pid_d’ (Byte), ‘pid_i’ (Byte), ‘pid_int’ (Byte), ‘pid_p’ (Byte), ‘sensor’ (Byte), ‘setp0’ (Temp), ‘setp1’ (Temp), ‘setp2’ (Temp), ‘setp3’ (Temp), ‘setp4’ (Temp), ‘setp5’ (Temp)''') – The list of thermostat_configurations to set
 
|config ('''list of thermostat_configuration dict: contains ‘id’ (Id), ‘auto_fri’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_mon’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sat’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sun’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_thu’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_tue’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_wed’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘name’ (String[16]), ‘output0’ (Byte), ‘output1’ (Byte), ‘pid_d’ (Byte), ‘pid_i’ (Byte), ‘pid_int’ (Byte), ‘pid_p’ (Byte), ‘sensor’ (Byte), ‘setp0’ (Temp), ‘setp1’ (Temp), ‘setp2’ (Temp), ‘setp3’ (Temp), ‘setp4’ (Temp), ‘setp5’ (Temp)''') – The list of thermostat_configurations to set
 
|}
 
|}
:♠ WebInterface.'''get_sensor_configuration'''(token, id, fields=None)
+
----
 +
==== WebInterface.'''get_sensor_configuration'''(token, id, fields=None) ====
 
::Get a specific sensor_configuration defined by its id.
 
::Get a specific sensor_configuration defined by its id.
 
::{|
 
::{|
Line 285: Line 317:
 
|‘config’: sensor_configuration dict: contains ‘id’ (Id), ‘name’ (String[16]), ‘offset’ (SignedTemp(-7.5 to 7.5 degrees))
 
|‘config’: sensor_configuration dict: contains ‘id’ (Id), ‘name’ (String[16]), ‘offset’ (SignedTemp(-7.5 to 7.5 degrees))
 
|}
 
|}
:♠ WebInterface.'''get_sensor_configurations'''(token, fields=None)
+
----
 +
==== WebInterface.'''get_sensor_configurations'''(token, fields=None) ====
 
::Get all sensor_configurations.
 
::Get all sensor_configurations.
 
::{|
 
::{|
Line 294: Line 327:
 
|‘config’: list of sensor_configuration dict: contains ‘id’ (Id), ‘name’ (String[16]), ‘offset’ (SignedTemp(-7.5 to 7.5 degrees))
 
|‘config’: list of sensor_configuration dict: contains ‘id’ (Id), ‘name’ (String[16]), ‘offset’ (SignedTemp(-7.5 to 7.5 degrees))
 
|}
 
|}
:♠ WebInterface.'''set_sensor_configuration'''(token, config)
+
----
 +
==== WebInterface.'''set_sensor_configuration'''(token, config) ====
 
::Set one sensor_configuration.
 
::Set one sensor_configuration.
 
::{|
 
::{|
Line 300: Line 334:
 
|config ('''sensor_configuration dict: contains ‘id’ (Id), ‘name’ (String[16]), ‘offset’ (SignedTemp(-7.5 to 7.5 degrees))''') – The sensor_configuration to set
 
|config ('''sensor_configuration dict: contains ‘id’ (Id), ‘name’ (String[16]), ‘offset’ (SignedTemp(-7.5 to 7.5 degrees))''') – The sensor_configuration to set
 
|}
 
|}
:♠ WebInterface.'''set_sensor_configurations'''(token, config)
+
----
 +
==== WebInterface.'''set_sensor_configurations'''(token, config) ====
 
::Set multiple sensor_configurations.
 
::Set multiple sensor_configurations.
 
::{|
 
::{|
Line 306: Line 341:
 
|config ('''list of sensor_configuration dict: contains ‘id’ (Id), ‘name’ (String[16]), ‘offset’ (SignedTemp(-7.5 to 7.5 degrees))''') – The list of sensor_configurations to set
 
|config ('''list of sensor_configuration dict: contains ‘id’ (Id), ‘name’ (String[16]), ‘offset’ (SignedTemp(-7.5 to 7.5 degrees))''') – The list of sensor_configurations to set
 
|}
 
|}
:♠ WebInterface.'''get_pump_group_configuration'''(token, id, fields=None)
+
----
 +
==== WebInterface.'''get_pump_group_configuration'''(token, id, fields=None) ====
 
::Get a specific pump_group_configuration defined by its id.
 
::Get a specific pump_group_configuration defined by its id.
 
::{|
 
::{|
Line 317: Line 353:
 
|‘config’: pump_group_configuration dict: contains ‘id’ (Id), ‘outputs’ (CSV[32])
 
|‘config’: pump_group_configuration dict: contains ‘id’ (Id), ‘outputs’ (CSV[32])
 
|}
 
|}
:♠ WebInterface.'''get_pump_group_configurations'''(token, fields=None)
+
----
 +
==== WebInterface.'''get_pump_group_configurations'''(token, fields=None) ====
 
::Get all pump_group_configurations.
 
::Get all pump_group_configurations.
 
::{|
 
::{|
Line 326: Line 363:
 
|‘config’: list of pump_group_configuration dict: contains ‘id’ (Id), ‘outputs’ (CSV[32])
 
|‘config’: list of pump_group_configuration dict: contains ‘id’ (Id), ‘outputs’ (CSV[32])
 
|}
 
|}
:♠ WebInterface.'''set_pump_group_configuration'''(token, config)
+
----
 +
==== WebInterface.'''set_pump_group_configuration'''(token, config) ====
 
::Set one pump_group_configuration.
 
::Set one pump_group_configuration.
 
::{|
 
::{|
Line 332: Line 370:
 
|config ('''pump_group_configuration dict: contains ‘id’ (Id), ‘outputs’ (CSV[32])''') – The pump_group_configuration to set
 
|config ('''pump_group_configuration dict: contains ‘id’ (Id), ‘outputs’ (CSV[32])''') – The pump_group_configuration to set
 
|}
 
|}
:♠ WebInterface.'''set_pump_group_configurations'''(token, config)
+
----
 +
==== WebInterface.'''set_pump_group_configurations'''(token, config) ====
 
::Set multiple pump_group_configurations.
 
::Set multiple pump_group_configurations.
 
::{|
 
::{|
Line 338: Line 377:
 
|config ('''list of pump_group_configuration dict: contains ‘id’ (Id), ‘outputs’ (CSV[32])''') – The list of pump_group_configurations to set
 
|config ('''list of pump_group_configuration dict: contains ‘id’ (Id), ‘outputs’ (CSV[32])''') – The list of pump_group_configurations to set
 
|}
 
|}
:♠ WebInterface.'''get_group_action_configuration'''(token, id, fields=None)
+
----
 +
==== WebInterface.'''get_group_action_configuration'''(token, id, fields=None) ====
 
::Get a specific group_action_configuration defined by its id.
 
::Get a specific group_action_configuration defined by its id.
 
::{|
 
::{|
Line 349: Line 389:
 
|‘config’: group_action_configuration dict: contains ‘id’ (Id), ‘actions’ (Actions[16]), ‘name’ (String[16])
 
|‘config’: group_action_configuration dict: contains ‘id’ (Id), ‘actions’ (Actions[16]), ‘name’ (String[16])
 
|}
 
|}
:♠ WebInterface.'''get_group_action_configurations'''(token, fields=None)
+
----
 +
==== WebInterface.'''get_group_action_configurations'''(token, fields=None) ====
 
::Get all group_action_configurations.
 
::Get all group_action_configurations.
 
::{|
 
::{|
Line 358: Line 399:
 
|‘config’: list of group_action_configuration dict: contains ‘id’ (Id), ‘actions’ (Actions[16]), ‘name’ (String[16])
 
|‘config’: list of group_action_configuration dict: contains ‘id’ (Id), ‘actions’ (Actions[16]), ‘name’ (String[16])
 
|}
 
|}
:♠ WebInterface.'''set_group_action_configuration'''(token, config)
+
----
 +
==== WebInterface.'''set_group_action_configuration'''(token, config) ====
 
::Set one group_action_configuration.
 
::Set one group_action_configuration.
 
::{|
 
::{|
Line 364: Line 406:
 
|config ('''group_action_configuration dict: contains ‘id’ (Id), ‘actions’ (Actions[16]), ‘name’ (String[16])''') – The group_action_configuration to set
 
|config ('''group_action_configuration dict: contains ‘id’ (Id), ‘actions’ (Actions[16]), ‘name’ (String[16])''') – The group_action_configuration to set
 
|}
 
|}
:♠ WebInterface.'''set_group_action_configurations'''(token, config)
+
----
 +
==== WebInterface.'''set_group_action_configurations'''(token, config) ====
 
::Set multiple group_action_configurations.
 
::Set multiple group_action_configurations.
 
::{|
 
::{|
Line 370: Line 413:
 
|config ('''list of group_action_configuration dict: contains ‘id’ (Id), ‘actions’ (Actions[16]), ‘name’ (String[16])''') – The list of group_action_configurations to set
 
|config ('''list of group_action_configuration dict: contains ‘id’ (Id), ‘actions’ (Actions[16]), ‘name’ (String[16])''') – The list of group_action_configurations to set
 
|}
 
|}
:♠ WebInterface.'''get_scheduled_action_configuration'''(token, id, fields=None)
+
----
 +
==== WebInterface.'''get_scheduled_action_configuration'''(token, id, fields=None) ====
 
::Get a specific scheduled_action_configuration defined by its id.
 
::Get a specific scheduled_action_configuration defined by its id.
 
::{|
 
::{|
Line 381: Line 425:
 
|‘config’: scheduled_action_configuration dict: contains ‘id’ (Id), ‘action’ (Actions[1]), ‘day’ (Byte), ‘hour’ (Byte), ‘minute’ (Byte)
 
|‘config’: scheduled_action_configuration dict: contains ‘id’ (Id), ‘action’ (Actions[1]), ‘day’ (Byte), ‘hour’ (Byte), ‘minute’ (Byte)
 
|}
 
|}
:♠ WebInterface.'''get_scheduled_action_configurations'''(token, fields=None)
+
----
 +
==== WebInterface.'''get_scheduled_action_configurations'''(token, fields=None) ====
 
::Get all scheduled_action_configurations.
 
::Get all scheduled_action_configurations.
 
::{|
 
::{|
Line 390: Line 435:
 
|‘config’: list of scheduled_action_configuration dict: contains ‘id’ (Id), ‘action’ (Actions[1]), ‘day’ (Byte), ‘hour’ (Byte), ‘minute’ (Byte)
 
|‘config’: list of scheduled_action_configuration dict: contains ‘id’ (Id), ‘action’ (Actions[1]), ‘day’ (Byte), ‘hour’ (Byte), ‘minute’ (Byte)
 
|}
 
|}
:♠ WebInterface.'''set_scheduled_action_configuration'''(token, config)
+
----
 +
==== WebInterface.'''set_scheduled_action_configuration'''(token, config) ====
 
::Set one scheduled_action_configuration.
 
::Set one scheduled_action_configuration.
 
::{|
 
::{|
Line 396: Line 442:
 
|config ('''scheduled_action_configuration dict: contains ‘id’ (Id), ‘action’ (Actions[1]), ‘day’ (Byte), ‘hour’ (Byte), ‘minute’ (Byte)''') – The scheduled_action_configuration to set
 
|config ('''scheduled_action_configuration dict: contains ‘id’ (Id), ‘action’ (Actions[1]), ‘day’ (Byte), ‘hour’ (Byte), ‘minute’ (Byte)''') – The scheduled_action_configuration to set
 
|}
 
|}
:♠ WebInterface.'''set_scheduled_action_configurations'''(token, config)
+
----
 +
==== WebInterface.'''set_scheduled_action_configurations'''(token, config) ====
 
::Set multiple scheduled_action_configurations.
 
::Set multiple scheduled_action_configurations.
 
::{|
 
::{|
Line 402: Line 449:
 
|config ('''list of scheduled_action_configuration dict: contains ‘id’ (Id), ‘action’ (Actions[1]), ‘day’ (Byte), ‘hour’ (Byte), ‘minute’ (Byte)''') – The list of scheduled_action_configurations to set
 
|config ('''list of scheduled_action_configuration dict: contains ‘id’ (Id), ‘action’ (Actions[1]), ‘day’ (Byte), ‘hour’ (Byte), ‘minute’ (Byte)''') – The list of scheduled_action_configurations to set
 
|}
 
|}
:♠ WebInterface.'''get_pulse_counter_configuration'''(token, id, fields=None)
+
----
 +
==== WebInterface.'''get_pulse_counter_configuration'''(token, id, fields=None) ====
 
::Get a specific pulse_counter_configuration defined by its id.
 
::Get a specific pulse_counter_configuration defined by its id.
 
::{|
 
::{|
Line 413: Line 461:
 
|‘config’: pulse_counter_configuration dict: contains ‘id’ (Id), ‘input’ (Byte), ‘name’ (String[16])
 
|‘config’: pulse_counter_configuration dict: contains ‘id’ (Id), ‘input’ (Byte), ‘name’ (String[16])
 
|}
 
|}
:♠ WebInterface.'''get_pulse_counter_configurations'''(token, fields=None)
+
----
 +
==== WebInterface.'''get_pulse_counter_configurations'''(token, fields=None) ====
 
::Get all pulse_counter_configurations.
 
::Get all pulse_counter_configurations.
 
::{|
 
::{|
Line 422: Line 471:
 
|‘config’: list of pulse_counter_configuration dict: contains ‘id’ (Id), ‘input’ (Byte), ‘name’ (String[16])
 
|‘config’: list of pulse_counter_configuration dict: contains ‘id’ (Id), ‘input’ (Byte), ‘name’ (String[16])
 
|}
 
|}
:♠ WebInterface.'''set_pulse_counter_configuration'''(token, config)
+
----
 +
==== WebInterface.'''set_pulse_counter_configuration'''(token, config) ====
 
::Set one pulse_counter_configuration.
 
::Set one pulse_counter_configuration.
 
::{|
 
::{|
Line 428: Line 478:
 
|config ('''pulse_counter_configuration dict: contains ‘id’ (Id), ‘input’ (Byte), ‘name’ (String[16])''') – The pulse_counter_configuration to set
 
|config ('''pulse_counter_configuration dict: contains ‘id’ (Id), ‘input’ (Byte), ‘name’ (String[16])''') – The pulse_counter_configuration to set
 
|}
 
|}
:♠ WebInterface.'''set_pulse_counter_configurations'''(token, config)
+
----
 +
==== WebInterface.'''set_pulse_counter_configurations'''(token, config) ====
 
::Set multiple pulse_counter_configurations.
 
::Set multiple pulse_counter_configurations.
 
::{|
 
::{|
Line 434: Line 485:
 
|config ('''list of pulse_counter_configuration dict: contains ‘id’ (Id), ‘input’ (Byte), ‘name’ (String[16])''') – The list of pulse_counter_configurations to set
 
|config ('''list of pulse_counter_configuration dict: contains ‘id’ (Id), ‘input’ (Byte), ‘name’ (String[16])''') – The list of pulse_counter_configurations to set
 
|}
 
|}
:♠ WebInterface.'''get_startup_action_configuration'''(token, fields=None)
+
----
 +
==== WebInterface.'''get_startup_action_configuration'''(token, fields=None) ====
 
::Get the startup_action_configuration.
 
::Get the startup_action_configuration.
 
::{|
 
::{|
Line 443: Line 495:
 
|‘config’: startup_action_configuration dict: contains ‘actions’ (Actions[100])
 
|‘config’: startup_action_configuration dict: contains ‘actions’ (Actions[100])
 
|}
 
|}
:♠ WebInterface.'''set_startup_action_configuration'''(token, config)
+
----
 +
==== WebInterface.'''set_startup_action_configuration'''(token, config) ====
 
::Set the startup_action_configuration.
 
::Set the startup_action_configuration.
 
::{|
 
::{|
Line 449: Line 502:
 
|config ('''startup_action_configuration dict: contains ‘actions’ (Actions[100])''') – The startup_action_configuration to set
 
|config ('''startup_action_configuration dict: contains ‘actions’ (Actions[100])''') – The startup_action_configuration to set
 
|}
 
|}
:♠ WebInterface.'''get_dimmer_configuration'''(token, fields=None)
+
----
 +
==== WebInterface.'''get_dimmer_configuration'''(token, fields=None) ====
 
::Get the dimmer_configuration.
 
::Get the dimmer_configuration.
 
::{|
 
::{|
Line 458: Line 512:
 
|‘config’: dimmer_configuration dict: contains ‘dim_memory’ (Byte), ‘dim_step’ (Byte), ‘dim_wait_cycle’ (Byte), ‘min_dim_level’ (Byte)
 
|‘config’: dimmer_configuration dict: contains ‘dim_memory’ (Byte), ‘dim_step’ (Byte), ‘dim_wait_cycle’ (Byte), ‘min_dim_level’ (Byte)
 
|}
 
|}
:♠ WebInterface.'''set_dimmer_configuration'''(token, config)
+
----
 +
==== WebInterface.'''set_dimmer_configuration'''(token, config) ====
 
::Set the dimmer_configuration.
 
::Set the dimmer_configuration.
 
::{|
 
::{|
Line 464: Line 519:
 
|config ('''dimmer_configuration dict: contains ‘dim_memory’ (Byte), ‘dim_step’ (Byte), ‘dim_wait_cycle’ (Byte), ‘min_dim_level’ (Byte)''') – The dimmer_configuration to set
 
|config ('''dimmer_configuration dict: contains ‘dim_memory’ (Byte), ‘dim_step’ (Byte), ‘dim_wait_cycle’ (Byte), ‘min_dim_level’ (Byte)''') – The dimmer_configuration to set
 
|}
 
|}
:♠ WebInterface.'''get_global_thermostat_configuration'''(token, fields=None)
+
----
 +
==== WebInterface.'''get_global_thermostat_configuration'''(token, fields=None) ====
 
::Get the global_thermostat_configuration.
 
::Get the global_thermostat_configuration.
 
::{|
 
::{|
Line 473: Line 529:
 
|‘config’: global_thermostat_configuration dict: contains ‘outside_sensor’ (Byte), ‘pump_delay’ (Byte), ‘threshold_temp’ (Temp)
 
|‘config’: global_thermostat_configuration dict: contains ‘outside_sensor’ (Byte), ‘pump_delay’ (Byte), ‘threshold_temp’ (Temp)
 
|}
 
|}
:♠ WebInterface.'''set_global_thermostat_configuration'''(token, config)
+
----
 +
==== WebInterface.'''set_global_thermostat_configuration'''(token, config) ====
 
::Set the global_thermostat_configuration.
 
::Set the global_thermostat_configuration.
 
::{|
 
::{|
Line 481: Line 538:
 
== Power modules ==
 
== Power modules ==
  
:♠ WebInterface.'''get_power_modules'''(token)
+
----
 +
==== WebInterface.'''get_power_modules'''(token) ====
 
::Get information on the power modules. The times format is a comma seperated list ofHH:MM formatted times times (index 0 = start Monday, index 1 = stop Monday,index 2 = start Tuesday, ...).
 
::Get information on the power modules. The times format is a comma seperated list ofHH:MM formatted times times (index 0 = start Monday, index 1 = stop Monday,index 2 = start Tuesday, ...).
 
::{|
 
::{|
Line 487: Line 545:
 
|‘modules’: list of dictionaries with the following keys: ‘id’, ‘name’,        ‘address’, ‘input0’, ‘input1’, ‘input2’, ‘input3’, ‘input4’, ‘input5’, ‘input6’,        ‘input7’, ‘sensor0’, ‘sensor1’, ‘sensor2’, ‘sensor3’, ‘sensor4’, ‘sensor5’, ‘sensor6’,        ‘sensor7’, ‘times0’, ‘times1’, ‘times2’, ‘times3’, ‘times4’, ‘times5’, ‘times6’, ‘times7’.
 
|‘modules’: list of dictionaries with the following keys: ‘id’, ‘name’,        ‘address’, ‘input0’, ‘input1’, ‘input2’, ‘input3’, ‘input4’, ‘input5’, ‘input6’,        ‘input7’, ‘sensor0’, ‘sensor1’, ‘sensor2’, ‘sensor3’, ‘sensor4’, ‘sensor5’, ‘sensor6’,        ‘sensor7’, ‘times0’, ‘times1’, ‘times2’, ‘times3’, ‘times4’, ‘times5’, ‘times6’, ‘times7’.
 
|}
 
|}
:♠ WebInterface.'''set_power_modules'''(token, modules)
+
----
 +
==== WebInterface.'''set_power_modules'''(token, modules) ====
 
::Set information for the power modules.
 
::Set information for the power modules.
 
::{|
 
::{|
Line 493: Line 552:
 
|modules – json encoded list of dicts with keys: ‘id’, ‘name’, ‘input0’, ‘input1’,        ‘input2’, ‘input3’, ‘input4’, ‘input5’, ‘input6’, ‘input7’, ‘sensor0’, ‘sensor1’,        ‘sensor2’, ‘sensor3’, ‘sensor4’, ‘sensor5’, ‘sensor6’, ‘sensor7’, ‘times0’, ‘times1’,        ‘times2’, ‘times3’, ‘times4’, ‘times5’, ‘times6’, ‘times7’.
 
|modules – json encoded list of dicts with keys: ‘id’, ‘name’, ‘input0’, ‘input1’,        ‘input2’, ‘input3’, ‘input4’, ‘input5’, ‘input6’, ‘input7’, ‘sensor0’, ‘sensor1’,        ‘sensor2’, ‘sensor3’, ‘sensor4’, ‘sensor5’, ‘sensor6’, ‘sensor7’, ‘times0’, ‘times1’,        ‘times2’, ‘times3’, ‘times4’, ‘times5’, ‘times6’, ‘times7’.
 
|}
 
|}
:♠ WebInterface.'''get_realtime_power'''(token)
+
----
 +
==== WebInterface.'''get_realtime_power'''(token) ====
 
::Get the realtime power measurements.
 
::Get the realtime power measurements.
 
::{|
 
::{|
Line 499: Line 559:
 
|module id as the keys: [voltage, frequency, current, power].
 
|module id as the keys: [voltage, frequency, current, power].
 
|}
 
|}
:♠ WebInterface.'''get_total_energy'''(token)
+
----
 +
==== WebInterface.'''get_total_energy'''(token) ====
 
::Get the total energy (Wh) consumed by the power modules.
 
::Get the total energy (Wh) consumed by the power modules.
 
::{|
 
::{|
Line 505: Line 566:
 
|modules id as key: [day, night].
 
|modules id as key: [day, night].
 
|}
 
|}
:♠ WebInterface.'''start_power_address_mode'''(token)
+
----
 +
==== WebInterface.'''start_power_address_mode'''(token) ====
 
::Start the address mode on the power modules.
 
::Start the address mode on the power modules.
:♠ WebInterface.'''stop_power_address_mode'''(token)
+
----
 +
==== WebInterface.'''stop_power_address_mode'''(token) ====
 
::Stop the address mode on the power modules.
 
::Stop the address mode on the power modules.
:♠ WebInterface.'''in_power_address_mode'''(token)
+
----
 +
==== WebInterface.'''in_power_address_mode'''(token) ====
 
::Check if the power modules are in address mode.
 
::Check if the power modules are in address mode.
 
::{|
 
::{|
Line 515: Line 579:
 
|‘address_mode’: Boolean
 
|‘address_mode’: Boolean
 
|}
 
|}
:♠ WebInterface.'''set_power_voltage'''(token, module_id, voltage)
+
----
 +
==== WebInterface.'''set_power_voltage'''(token, module_id, voltage) ====
 
::Set the voltage for a given module.
 
::Set the voltage for a given module.
 
::{|
 
::{|
Line 525: Line 590:
 
== Timezones ==
 
== Timezones ==
  
:♠ WebInterface.'''set_timezone'''(token, timezone)
+
----
 +
==== WebInterface.'''set_timezone'''(token, timezone) ====
 
::Set the timezone for the gateway.
 
::Set the timezone for the gateway.
 
::{|
 
::{|
Line 531: Line 597:
 
|timezone ('''String''') – in format ‘Continent/City’.
 
|timezone ('''String''') – in format ‘Continent/City’.
 
|}
 
|}
:♠ WebInterface.'''get_timezone'''(token)
+
----
 +
==== WebInterface.'''get_timezone'''(token) ====
 
::Get the timezone for the gateway.
 
::Get the timezone for the gateway.
 
::{|
 
::{|
Line 539: Line 606:
 
== Special actions ==
 
== Special actions ==
  
:♠ WebInterface.'''do_group_action'''(token, group_action_id)
+
----
 +
==== WebInterface.'''do_group_action'''(token, group_action_id) ====
 
::Execute a group action.
 
::Execute a group action.
 
::{|
 
::{|
Line 545: Line 613:
 
|group_action_id ('''Integer [0, 159]''') – The id of the group action
 
|group_action_id ('''Integer [0, 159]''') – The id of the group action
 
|}
 
|}
:♠ WebInterface.'''do_url_action'''(token, url, method='GET', headers=None, data=None, auth=None, timeout=10)
+
----
 +
==== WebInterface.'''do_url_action'''(token, url, method='GET', headers=None, data=None, auth=None, timeout=10) ====
 
::Execute an url action.
 
::Execute an url action.
 
::{|
 
::{|
Line 560: Line 629:
 
|‘headers’: response headers, ‘data’: response body.
 
|‘headers’: response headers, ‘data’: response body.
 
|}
 
|}
:♠ WebInterface.'''schedule_action'''(token, timestamp, action)
+
----
 +
==== WebInterface.'''schedule_action'''(token, timestamp, action) ====
 
::Schedule an action at a given point in the future. An action can be any function of theOpenMotics webservice. The action is JSON encoded dict with keys: ‘type’, ‘action’, ‘params’and ‘description’. At the moment ‘type’ can only be ‘basic’. ‘action’ contains the name ofthe function on the webservice. ‘params’ is a dict maps the names of the parameters given tothe function to their desired values. ‘description’ can be used to identify the scheduledaction.
 
::Schedule an action at a given point in the future. An action can be any function of theOpenMotics webservice. The action is JSON encoded dict with keys: ‘type’, ‘action’, ‘params’and ‘description’. At the moment ‘type’ can only be ‘basic’. ‘action’ contains the name ofthe function on the webservice. ‘params’ is a dict maps the names of the parameters given tothe function to their desired values. ‘description’ can be used to identify the scheduledaction.
 
::{|
 
::{|
Line 568: Line 638:
 
* action ('''String.''') – JSON encoded dict (see above).
 
* action ('''String.''') – JSON encoded dict (see above).
 
|}
 
|}
:♠ WebInterface.'''list_scheduled_actions'''(token)
+
----
 +
==== WebInterface.'''list_scheduled_actions'''(token) ====
 
::Get a list of all scheduled actions.
 
::Get a list of all scheduled actions.
 
::{|
 
::{|
Line 574: Line 645:
 
|‘actions’: a list of dicts with keys: ‘timestamp’, ‘from_now’, ‘id’,        ‘description’ and ‘action’. ‘timestamp’ is the UNIX timestamp when the action will be        executed. ‘from_now’ is the number of seconds until the action will be scheduled. ‘id’        is a unique integer for the scheduled action. ‘description’ contains a user set        description for the action. ‘action’ contains the function and params that will be        used to execute the scheduled action.
 
|‘actions’: a list of dicts with keys: ‘timestamp’, ‘from_now’, ‘id’,        ‘description’ and ‘action’. ‘timestamp’ is the UNIX timestamp when the action will be        executed. ‘from_now’ is the number of seconds until the action will be scheduled. ‘id’        is a unique integer for the scheduled action. ‘description’ contains a user set        description for the action. ‘action’ contains the function and params that will be        used to execute the scheduled action.
 
|}
 
|}
:♠ WebInterface.'''remove_scheduled_action'''(token, id)
+
----
 +
==== WebInterface.'''remove_scheduled_action'''(token, id) ====
 
::Remove a scheduled action when the id of the action is given.
 
::Remove a scheduled action when the id of the action is given.
 
::{|
 
::{|
Line 582: Line 654:
 
== Maintenance functions ==
 
== Maintenance functions ==
  
:♠ WebInterface.'''get_master_backup'''(token)
+
----
 +
==== WebInterface.'''get_master_backup'''(token) ====
 
::Get a backup of the eeprom of the master.
 
::Get a backup of the eeprom of the master.
 
::{|
 
::{|
Line 588: Line 661:
 
|This function does not return a dict, unlike all other API functions: it        returns a string of bytes (size = 64kb).
 
|This function does not return a dict, unlike all other API functions: it        returns a string of bytes (size = 64kb).
 
|}
 
|}
:♠ WebInterface.'''master_restore'''(token, data)
+
----
 +
==== WebInterface.'''master_restore'''(token, data) ====
 
::Restore a backup of the eeprom of the master.
 
::Restore a backup of the eeprom of the master.
 
::{|
 
::{|
Line 597: Line 671:
 
|‘output’: array with the addresses that were written.
 
|‘output’: array with the addresses that were written.
 
|}
 
|}
:♠ WebInterface.'''get_errors'''(token)
+
----
 +
==== WebInterface.'''get_errors'''(token) ====
 
::Get the number of seconds since the last successul communication with the master andpower modules (master_last_success, power_last_success) and the error list per module(input and output modules). The modules are identified by O1, O2, I1, I2, ...
 
::Get the number of seconds since the last successul communication with the master andpower modules (master_last_success, power_last_success) and the error list per module(input and output modules). The modules are identified by O1, O2, I1, I2, ...
 
::{|
 
::{|
Line 603: Line 678:
 
|‘errors’: list of tuples (module, nr_errors), ‘master_last_success’: UNIX        timestamp of the last succesful master communication and ‘power_last_success’: UNIX        timestamp of the last successful power communication.
 
|‘errors’: list of tuples (module, nr_errors), ‘master_last_success’: UNIX        timestamp of the last succesful master communication and ‘power_last_success’: UNIX        timestamp of the last successful power communication.
 
|}
 
|}
:♠ WebInterface.'''master_clear_error_list'''(token)
+
----
 +
==== WebInterface.'''master_clear_error_list'''(token) ====
 
::Clear the number of errors.
 
::Clear the number of errors.
:♠ WebInterface.'''get_version'''(token)
+
----
 +
==== WebInterface.'''get_version'''(token) ====
 
::Get the version of the openmotics software.
 
::Get the version of the openmotics software.
 
::{|
 
::{|
Line 611: Line 688:
 
|‘version’: String (a.b.c).
 
|‘version’: String (a.b.c).
 
|}
 
|}
:♠ WebInterface.'''get_status'''(token)
+
----
 +
==== WebInterface.'''get_status'''(token) ====
 
::Get the status of the master.
 
::Get the status of the master.
 
::{|
 
::{|
Line 617: Line 695:
 
|‘time’: hour and minutes (HH:MM), ‘date’: day, month, year (DD:MM:YYYY),        ‘mode’: Integer, ‘version’: a.b.c and ‘hw_version’: hardware version (Integer).
 
|‘time’: hour and minutes (HH:MM), ‘date’: day, month, year (DD:MM:YYYY),        ‘mode’: Integer, ‘version’: a.b.c and ‘hw_version’: hardware version (Integer).
 
|}
 
|}
:♠ WebInterface.'''update'''(token, version, md5, update_data)
+
----
 +
==== WebInterface.'''update'''(token, version, md5, update_data) ====
 
::Perform an update.
 
::Perform an update.
 
::{|
 
::{|
Line 626: Line 705:
 
* update_data ('''multipart/form-data encoded byte string.''') – a tgz file containing the update script (update.sh) and data.
 
* update_data ('''multipart/form-data encoded byte string.''') – a tgz file containing the update script (update.sh) and data.
 
|}
 
|}
:♠ WebInterface.'''get_update_output'''(token)
+
----
 +
==== WebInterface.'''get_update_output'''(token) ====
 
::Get the output of the last update.
 
::Get the output of the last update.
 
::{|
 
::{|
Line 632: Line 712:
 
|‘output’: String with the output from the update script.
 
|‘output’: String with the output from the update script.
 
|}
 
|}
:♠ WebInterface.'''open_maintenance'''(token)
+
----
 +
==== WebInterface.'''open_maintenance'''(token) ====
 
::Open maintenance mode, return the port of the maintenance socket.
 
::Open maintenance mode, return the port of the maintenance socket.
 
::{|
 
::{|
Line 638: Line 719:
 
|‘port’: Port on which the maintenance ssl socket is listening (Integer between 6000 and 7000).
 
|‘port’: Port on which the maintenance ssl socket is listening (Integer between 6000 and 7000).
 
|}
 
|}
:♠ WebInterface.'''set_master_status_leds'''(token, status)
+
----
 +
==== WebInterface.'''set_master_status_leds'''(token, status) ====
 
::Set the status of the leds on the master.
 
::Set the status of the leds on the master.
 
::{|
 
::{|

Revision as of 17:15, 2 March 2014

This page describes the Gateway API (exposed as a secure webservice on the OpenMotics Gateway). The response is a json-formatted dict, by default the dict contains the 'success' key which has a boolean value that indicates whether the API call was successfully executed. The documentation below show the return value in the following format: 'key': description. Eg. returns 'on': boolean means the full response is something like { 'success' : true, 'on' : false }.

Contents

Authentication

Most API calls require an authentication token, use the login call to get a token (tokens are valid for 1 hour).


WebInterface.login(username, password)

Login to the web service, returns a token if successful, returns HTTP status code 401 otherwise.
Parameters:
  • username (String) – Name of the user.
  • password (String) – Password of the user.
Returns: ‘token’ : String

User management is enabled when the gateway is in authorized mode (authorized mode can be enabled by pressing the white button on the gateway for more than 5 seconds). If the gateway is not in authorized mode, HTTP status code 401 is returned.


WebInterface.create_user(username, password)

Create a new user using a username and a password. Only possible in authorized mode.
Parameters:
  • username (String) – Name of the user.
  • password (String) – Password of the user.

WebInterface.get_usernames()

Get the names of the users on the gateway. Only possible in authorized mode.
Returns: ‘usernames’: list of usernames (String).

WebInterface.remove_user(username)

Remove a user. Only possible in authorized mode.
Parameters: username (String) – Name of the user to remove.

Master modules

These API functions return which modules are known by the OpenMotics master. Discover mode can be used to detect new modules on the bus (this is only for modules attached to the master, power modules use seperate API calls).


WebInterface.get_modules(token)

Get a list of all modules attached and registered with the master.
Returns: ‘output’: list of module types (O,R,D) and ‘input’: list of input module types (I,T,L).

WebInterface.module_discover_start(token)

Start the module discover mode on the master.
Returns: ‘status’: ‘OK’.

WebInterface.module_discover_stop(token)

Stop the module discover mode on the master.
Returns: ‘status’: ‘OK’.

WebInterface.flash_leds(token, type, id)

Flash the leds on the module for an output/input/sensor.
Parameters:
  • type (Integer) – The module type: output/dimmer (0), input (1), sensor/temperatur (2).
  • id (Integer) – The id of the output/input/sensor.
Returns: ‘status’: ‘OK’.

Output status

Below are the API functions for getting and setting the output status.


WebInterface.get_output_status(token)

Get the status of the outputs.
Returns: ‘status’: list of dictionaries with the following keys: id, status, dimmer and ctimer.

WebInterface.set_output(token, id, is_on, dimmer=None, timer=None)

Set the status, dimmer and timer of an output.
Parameters:
  • id (Integer [0, 240]) – The id of the output to set
  • is_on (Boolean) – Whether the output should be on
  • dimmer (Integer [0, 100] or None) – The dimmer value to set, None if unchanged
  • timer (Integer in (150, 450, 900, 1500, 2220, 3120)) – The timer value to set, None if unchanged

WebInterface.set_all_lights_off(token)

Turn all lights off.

WebInterface.set_all_lights_floor_off(token, floor)

Turn all lights on a given floor off.
Parameters: floor (Byte) – The id of the floor

WebInterface.set_all_lights_floor_on(token, floor)

Turn all lights on a given floor on.
Parameters: floor (Byte) – The id of the floor

Thermostat status

Below are the API functions for getting and setting the thermostat status.


WebInterface.get_thermostat_status(token)

Get the status of the thermostats.
Returns: global status information about the thermostats: ‘thermostats_on’,
::‘automatic’ and ‘setpoint’ and ‘status’: a list with status information for allthermostats, each element in the list is a dict with the following keys:‘id’, ‘act’, ‘csetp’, ‘output0’, ‘output1’, ‘outside’, ‘mode’.

WebInterface.set_current_setpoint(token, thermostat, temperature)

Set the current setpoint of a thermostat.
Parameters:
  • thermostat (Integer [0, 24]) – The id of the thermostat to set
  • temperature (float) – The temperature to set in degrees Celcius
Returns: ‘status’: ‘OK’.

WebInterface.set_thermostat_mode(token, thermostat_on, automatic, setpoint)

Set the mode of the thermostats. Thermostats can be on or off, automatic or manualand is set to one of the 6 setpoints.
Parameters:
  • thermostat_on (Boolean) – Whether the thermostats are on
  • automatic (Boolean) – Automatic mode (True) or Manual mode (False)
  • setpoint (Integer [0, 5]) – The current setpoint
Returns: ‘status’: ‘OK’.

WebInterface.get_sensor_temperature_status(token)

Get the current temperature of all sensors.
Returns: ‘status’: list of 32 temperatures, 1 for each sensor.

Other status


WebInterface.get_last_inputs(token)

Get the 5 last pressed inputs during the last 5 minutes.
Returns: ‘inputs’: list of tuples (input, output).

WebInterface.get_pulse_counter_status(token)

Get the pulse counter values.
Returns: ‘counters’: array with the 8 pulse counter values.

WebInterface.get_sensor_humidity_status(token)

Get the current humidity of all sensors.
Returns: ‘status’: List of 32 bytes, 1 for each sensor.

WebInterface.get_sensor_brightness_status(token)

Get the current brightness of all sensors.
Returns: ‘status’: List of 32 bytes, 1 for each sensor.

Configuration

Below are the API functions for getting and setting the OpenMotics Master configuration.


WebInterface.get_output_configuration(token, id, fields=None)

Get a specific output_configuration defined by its id.
Parameters:
  • id (Id) – The id of the output_configuration
  • fields (Json encoded list of strings) – The field of the output_configuration to get. (None gets all fields)
Returns: ‘config’: output_configuration dict: contains ‘id’ (Id), ‘floor’ (Byte), ‘module_type’ (String[1]), ‘name’ (String[16]), ‘timer’ (Word), ‘type’ (Byte)

WebInterface.get_output_configurations(token, fields=None)

Get all output_configurations.
Parameters: fields (Json encoded list of strings) – The field of the output_configuration to get. (None gets all fields)
Returns: ‘config’: list of output_configuration dict: contains ‘id’ (Id), ‘floor’ (Byte), ‘module_type’ (String[1]), ‘name’ (String[16]), ‘timer’ (Word), ‘type’ (Byte)

WebInterface.set_output_configuration(token, config)

Set one output_configuration.
Parameters: config (output_configuration dict: contains ‘id’ (Id), ‘floor’ (Byte), ‘name’ (String[16]), ‘timer’ (Word), ‘type’ (Byte)) – The output_configuration to set

WebInterface.set_output_configurations(token, config)

Set multiple output_configurations.
Parameters: config (list of output_configuration dict: contains ‘id’ (Id), ‘floor’ (Byte), ‘name’ (String[16]), ‘timer’ (Word), ‘type’ (Byte)) – The list of output_configurations to set

WebInterface.get_input_configuration(token, id, fields=None)

Get a specific input_configuration defined by its id.
Parameters:
  • id (Id) – The id of the input_configuration
  • fields (Json encoded list of strings) – The field of the input_configuration to get. (None gets all fields)
Returns: ‘config’: input_configuration dict: contains ‘id’ (Id), ‘action’ (Byte), ‘basic_actions’ (Actions[15]), ‘module_type’ (String[1]), ‘name’ (String[8])

WebInterface.get_input_configurations(token, fields=None)

Get all input_configurations.
Parameters: fields (Json encoded list of strings) – The field of the input_configuration to get. (None gets all fields)
Returns: ‘config’: list of input_configuration dict: contains ‘id’ (Id), ‘action’ (Byte), ‘basic_actions’ (Actions[15]), ‘module_type’ (String[1]), ‘name’ (String[8])

WebInterface.set_input_configuration(token, config)

Set one input_configuration.
Parameters: config (input_configuration dict: contains ‘id’ (Id), ‘action’ (Byte), ‘basic_actions’ (Actions[15]), ‘name’ (String[8])) – The input_configuration to set

WebInterface.set_input_configurations(token, config)

Set multiple input_configurations.
Parameters: config (list of input_configuration dict: contains ‘id’ (Id), ‘action’ (Byte), ‘basic_actions’ (Actions[15]), ‘name’ (String[8])) – The list of input_configurations to set

WebInterface.get_thermostat_configuration(token, id, fields=None)

Get a specific thermostat_configuration defined by its id.
Parameters:
  • id (Id) – The id of the thermostat_configuration
  • fields (Json encoded list of strings) – The field of the thermostat_configuration to get. (None gets all fields)
Returns: ‘config’: thermostat_configuration dict: contains ‘id’ (Id), ‘auto_fri’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_mon’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sat’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sun’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_thu’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_tue’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_wed’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘name’ (String[16]), ‘output0’ (Byte), ‘output1’ (Byte), ‘pid_d’ (Byte), ‘pid_i’ (Byte), ‘pid_int’ (Byte), ‘pid_p’ (Byte), ‘sensor’ (Byte), ‘setp0’ (Temp), ‘setp1’ (Temp), ‘setp2’ (Temp), ‘setp3’ (Temp), ‘setp4’ (Temp), ‘setp5’ (Temp)

WebInterface.get_thermostat_configurations(token, fields=None)

Get all thermostat_configurations.
Parameters: fields (Json encoded list of strings) – The field of the thermostat_configuration to get. (None gets all fields)
Returns: ‘config’: list of thermostat_configuration dict: contains ‘id’ (Id), ‘auto_fri’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_mon’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sat’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sun’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_thu’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_tue’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_wed’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘name’ (String[16]), ‘output0’ (Byte), ‘output1’ (Byte), ‘pid_d’ (Byte), ‘pid_i’ (Byte), ‘pid_int’ (Byte), ‘pid_p’ (Byte), ‘sensor’ (Byte), ‘setp0’ (Temp), ‘setp1’ (Temp), ‘setp2’ (Temp), ‘setp3’ (Temp), ‘setp4’ (Temp), ‘setp5’ (Temp)

WebInterface.set_thermostat_configuration(token, config)

Set one thermostat_configuration.
Parameters: config (thermostat_configuration dict: contains ‘id’ (Id), ‘auto_fri’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_mon’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sat’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sun’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_thu’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_tue’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_wed’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘name’ (String[16]), ‘output0’ (Byte), ‘output1’ (Byte), ‘pid_d’ (Byte), ‘pid_i’ (Byte), ‘pid_int’ (Byte), ‘pid_p’ (Byte), ‘sensor’ (Byte), ‘setp0’ (Temp), ‘setp1’ (Temp), ‘setp2’ (Temp), ‘setp3’ (Temp), ‘setp4’ (Temp), ‘setp5’ (Temp)) – The thermostat_configuration to set

WebInterface.set_thermostat_configurations(token, config)

Set multiple thermostat_configurations.
Parameters: config (list of thermostat_configuration dict: contains ‘id’ (Id), ‘auto_fri’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_mon’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sat’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_sun’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_thu’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_tue’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘auto_wed’ ([temp_n(Temp),start_d1(Time),stop_d1(Time),temp_d1(Temp),start_d2(Time),stop_d2(Time),temp_d2(Temp)]), ‘name’ (String[16]), ‘output0’ (Byte), ‘output1’ (Byte), ‘pid_d’ (Byte), ‘pid_i’ (Byte), ‘pid_int’ (Byte), ‘pid_p’ (Byte), ‘sensor’ (Byte), ‘setp0’ (Temp), ‘setp1’ (Temp), ‘setp2’ (Temp), ‘setp3’ (Temp), ‘setp4’ (Temp), ‘setp5’ (Temp)) – The list of thermostat_configurations to set

WebInterface.get_sensor_configuration(token, id, fields=None)

Get a specific sensor_configuration defined by its id.
Parameters:
  • id (Id) – The id of the sensor_configuration
  • fields (Json encoded list of strings) – The field of the sensor_configuration to get. (None gets all fields)
Returns: ‘config’: sensor_configuration dict: contains ‘id’ (Id), ‘name’ (String[16]), ‘offset’ (SignedTemp(-7.5 to 7.5 degrees))

WebInterface.get_sensor_configurations(token, fields=None)

Get all sensor_configurations.
Parameters: fields (Json encoded list of strings) – The field of the sensor_configuration to get. (None gets all fields)
Returns: ‘config’: list of sensor_configuration dict: contains ‘id’ (Id), ‘name’ (String[16]), ‘offset’ (SignedTemp(-7.5 to 7.5 degrees))

WebInterface.set_sensor_configuration(token, config)

Set one sensor_configuration.
Parameters: config (sensor_configuration dict: contains ‘id’ (Id), ‘name’ (String[16]), ‘offset’ (SignedTemp(-7.5 to 7.5 degrees))) – The sensor_configuration to set

WebInterface.set_sensor_configurations(token, config)

Set multiple sensor_configurations.
Parameters: config (list of sensor_configuration dict: contains ‘id’ (Id), ‘name’ (String[16]), ‘offset’ (SignedTemp(-7.5 to 7.5 degrees))) – The list of sensor_configurations to set

WebInterface.get_pump_group_configuration(token, id, fields=None)

Get a specific pump_group_configuration defined by its id.
Parameters:
  • id (Id) – The id of the pump_group_configuration
  • fields (Json encoded list of strings) – The field of the pump_group_configuration to get. (None gets all fields)
Returns: ‘config’: pump_group_configuration dict: contains ‘id’ (Id), ‘outputs’ (CSV[32])

WebInterface.get_pump_group_configurations(token, fields=None)

Get all pump_group_configurations.
Parameters: fields (Json encoded list of strings) – The field of the pump_group_configuration to get. (None gets all fields)
Returns: ‘config’: list of pump_group_configuration dict: contains ‘id’ (Id), ‘outputs’ (CSV[32])

WebInterface.set_pump_group_configuration(token, config)

Set one pump_group_configuration.
Parameters: config (pump_group_configuration dict: contains ‘id’ (Id), ‘outputs’ (CSV[32])) – The pump_group_configuration to set

WebInterface.set_pump_group_configurations(token, config)

Set multiple pump_group_configurations.
Parameters: config (list of pump_group_configuration dict: contains ‘id’ (Id), ‘outputs’ (CSV[32])) – The list of pump_group_configurations to set

WebInterface.get_group_action_configuration(token, id, fields=None)

Get a specific group_action_configuration defined by its id.
Parameters:
  • id (Id) – The id of the group_action_configuration
  • fields (Json encoded list of strings) – The field of the group_action_configuration to get. (None gets all fields)
Returns: ‘config’: group_action_configuration dict: contains ‘id’ (Id), ‘actions’ (Actions[16]), ‘name’ (String[16])

WebInterface.get_group_action_configurations(token, fields=None)

Get all group_action_configurations.
Parameters: fields (Json encoded list of strings) – The field of the group_action_configuration to get. (None gets all fields)
Returns: ‘config’: list of group_action_configuration dict: contains ‘id’ (Id), ‘actions’ (Actions[16]), ‘name’ (String[16])

WebInterface.set_group_action_configuration(token, config)

Set one group_action_configuration.
Parameters: config (group_action_configuration dict: contains ‘id’ (Id), ‘actions’ (Actions[16]), ‘name’ (String[16])) – The group_action_configuration to set

WebInterface.set_group_action_configurations(token, config)

Set multiple group_action_configurations.
Parameters: config (list of group_action_configuration dict: contains ‘id’ (Id), ‘actions’ (Actions[16]), ‘name’ (String[16])) – The list of group_action_configurations to set

WebInterface.get_scheduled_action_configuration(token, id, fields=None)

Get a specific scheduled_action_configuration defined by its id.
Parameters:
  • id (Id) – The id of the scheduled_action_configuration
  • fields (Json encoded list of strings) – The field of the scheduled_action_configuration to get. (None gets all fields)
Returns: ‘config’: scheduled_action_configuration dict: contains ‘id’ (Id), ‘action’ (Actions[1]), ‘day’ (Byte), ‘hour’ (Byte), ‘minute’ (Byte)

WebInterface.get_scheduled_action_configurations(token, fields=None)

Get all scheduled_action_configurations.
Parameters: fields (Json encoded list of strings) – The field of the scheduled_action_configuration to get. (None gets all fields)
Returns: ‘config’: list of scheduled_action_configuration dict: contains ‘id’ (Id), ‘action’ (Actions[1]), ‘day’ (Byte), ‘hour’ (Byte), ‘minute’ (Byte)

WebInterface.set_scheduled_action_configuration(token, config)

Set one scheduled_action_configuration.
Parameters: config (scheduled_action_configuration dict: contains ‘id’ (Id), ‘action’ (Actions[1]), ‘day’ (Byte), ‘hour’ (Byte), ‘minute’ (Byte)) – The scheduled_action_configuration to set

WebInterface.set_scheduled_action_configurations(token, config)

Set multiple scheduled_action_configurations.
Parameters: config (list of scheduled_action_configuration dict: contains ‘id’ (Id), ‘action’ (Actions[1]), ‘day’ (Byte), ‘hour’ (Byte), ‘minute’ (Byte)) – The list of scheduled_action_configurations to set

WebInterface.get_pulse_counter_configuration(token, id, fields=None)

Get a specific pulse_counter_configuration defined by its id.
Parameters:
  • id (Id) – The id of the pulse_counter_configuration
  • fields (Json encoded list of strings) – The field of the pulse_counter_configuration to get. (None gets all fields)
Returns: ‘config’: pulse_counter_configuration dict: contains ‘id’ (Id), ‘input’ (Byte), ‘name’ (String[16])

WebInterface.get_pulse_counter_configurations(token, fields=None)

Get all pulse_counter_configurations.
Parameters: fields (Json encoded list of strings) – The field of the pulse_counter_configuration to get. (None gets all fields)
Returns: ‘config’: list of pulse_counter_configuration dict: contains ‘id’ (Id), ‘input’ (Byte), ‘name’ (String[16])

WebInterface.set_pulse_counter_configuration(token, config)

Set one pulse_counter_configuration.
Parameters: config (pulse_counter_configuration dict: contains ‘id’ (Id), ‘input’ (Byte), ‘name’ (String[16])) – The pulse_counter_configuration to set

WebInterface.set_pulse_counter_configurations(token, config)

Set multiple pulse_counter_configurations.
Parameters: config (list of pulse_counter_configuration dict: contains ‘id’ (Id), ‘input’ (Byte), ‘name’ (String[16])) – The list of pulse_counter_configurations to set

WebInterface.get_startup_action_configuration(token, fields=None)

Get the startup_action_configuration.
Parameters: fields (Json encoded list of strings) – The field of the startup_action_configuration to get. (None gets all fields)
Returns: ‘config’: startup_action_configuration dict: contains ‘actions’ (Actions[100])

WebInterface.set_startup_action_configuration(token, config)

Set the startup_action_configuration.
Parameters: config (startup_action_configuration dict: contains ‘actions’ (Actions[100])) – The startup_action_configuration to set

WebInterface.get_dimmer_configuration(token, fields=None)

Get the dimmer_configuration.
Parameters: fields (Json encoded list of strings) – The field of the dimmer_configuration to get. (None gets all fields)
Returns: ‘config’: dimmer_configuration dict: contains ‘dim_memory’ (Byte), ‘dim_step’ (Byte), ‘dim_wait_cycle’ (Byte), ‘min_dim_level’ (Byte)

WebInterface.set_dimmer_configuration(token, config)

Set the dimmer_configuration.
Parameters: config (dimmer_configuration dict: contains ‘dim_memory’ (Byte), ‘dim_step’ (Byte), ‘dim_wait_cycle’ (Byte), ‘min_dim_level’ (Byte)) – The dimmer_configuration to set

WebInterface.get_global_thermostat_configuration(token, fields=None)

Get the global_thermostat_configuration.
Parameters: fields (Json encoded list of strings) – The field of the global_thermostat_configuration to get. (None gets all fields)
Returns: ‘config’: global_thermostat_configuration dict: contains ‘outside_sensor’ (Byte), ‘pump_delay’ (Byte), ‘threshold_temp’ (Temp)

WebInterface.set_global_thermostat_configuration(token, config)

Set the global_thermostat_configuration.
Parameters: config (global_thermostat_configuration dict: contains ‘outside_sensor’ (Byte), ‘pump_delay’ (Byte), ‘threshold_temp’ (Temp)) – The global_thermostat_configuration to set

Power modules


WebInterface.get_power_modules(token)

Get information on the power modules. The times format is a comma seperated list ofHH:MM formatted times times (index 0 = start Monday, index 1 = stop Monday,index 2 = start Tuesday, ...).
Returns: ‘modules’: list of dictionaries with the following keys: ‘id’, ‘name’, ‘address’, ‘input0’, ‘input1’, ‘input2’, ‘input3’, ‘input4’, ‘input5’, ‘input6’, ‘input7’, ‘sensor0’, ‘sensor1’, ‘sensor2’, ‘sensor3’, ‘sensor4’, ‘sensor5’, ‘sensor6’, ‘sensor7’, ‘times0’, ‘times1’, ‘times2’, ‘times3’, ‘times4’, ‘times5’, ‘times6’, ‘times7’.

WebInterface.set_power_modules(token, modules)

Set information for the power modules.
Parameters: modules – json encoded list of dicts with keys: ‘id’, ‘name’, ‘input0’, ‘input1’, ‘input2’, ‘input3’, ‘input4’, ‘input5’, ‘input6’, ‘input7’, ‘sensor0’, ‘sensor1’, ‘sensor2’, ‘sensor3’, ‘sensor4’, ‘sensor5’, ‘sensor6’, ‘sensor7’, ‘times0’, ‘times1’, ‘times2’, ‘times3’, ‘times4’, ‘times5’, ‘times6’, ‘times7’.

WebInterface.get_realtime_power(token)

Get the realtime power measurements.
Returns: module id as the keys: [voltage, frequency, current, power].

WebInterface.get_total_energy(token)

Get the total energy (Wh) consumed by the power modules.
Returns: modules id as key: [day, night].

WebInterface.start_power_address_mode(token)

Start the address mode on the power modules.

WebInterface.stop_power_address_mode(token)

Stop the address mode on the power modules.

WebInterface.in_power_address_mode(token)

Check if the power modules are in address mode.
Returns: ‘address_mode’: Boolean

WebInterface.set_power_voltage(token, module_id, voltage)

Set the voltage for a given module.
Parameters:
  • module_id (Byte) – The id of the power module.
  • voltage (Float) – The voltage to set for the power module.

Timezones


WebInterface.set_timezone(token, timezone)

Set the timezone for the gateway.
Parameters: timezone (String) – in format ‘Continent/City’.

WebInterface.get_timezone(token)

Get the timezone for the gateway.
Returns: ‘timezone’: the timezone in ‘Continent/City’ format (String).

Special actions


WebInterface.do_group_action(token, group_action_id)

Execute a group action.
Parameters: group_action_id (Integer [0, 159]) – The id of the group action

WebInterface.do_url_action(token, url, method='GET', headers=None, data=None, auth=None, timeout=10)

Execute an url action.
Parameters:
  • url (String) – The url to fetch.
  • method (String) – (optional) The http method (defaults to GET).
  • headers (String) – (optional) The http headers to send (format: json encoded dict)
  • data (String) – (optional) Bytes to send in the body of the request.
  • auth (String) – (optional) Json encoded tuple (username, password).
  • timeout (Integer) – (optional) Timeout in seconds for the http request (default = 10 sec).
Returns: ‘headers’: response headers, ‘data’: response body.

WebInterface.schedule_action(token, timestamp, action)

Schedule an action at a given point in the future. An action can be any function of theOpenMotics webservice. The action is JSON encoded dict with keys: ‘type’, ‘action’, ‘params’and ‘description’. At the moment ‘type’ can only be ‘basic’. ‘action’ contains the name ofthe function on the webservice. ‘params’ is a dict maps the names of the parameters given tothe function to their desired values. ‘description’ can be used to identify the scheduledaction.
Parameters:
  • timestamp (Integer.) – UNIX timestamp.
  • action (String.) – JSON encoded dict (see above).

WebInterface.list_scheduled_actions(token)

Get a list of all scheduled actions.
Returns: ‘actions’: a list of dicts with keys: ‘timestamp’, ‘from_now’, ‘id’, ‘description’ and ‘action’. ‘timestamp’ is the UNIX timestamp when the action will be executed. ‘from_now’ is the number of seconds until the action will be scheduled. ‘id’ is a unique integer for the scheduled action. ‘description’ contains a user set description for the action. ‘action’ contains the function and params that will be used to execute the scheduled action.

WebInterface.remove_scheduled_action(token, id)

Remove a scheduled action when the id of the action is given.
Parameters: id (Integer) – the id of the scheduled action to remove.

Maintenance functions


WebInterface.get_master_backup(token)

Get a backup of the eeprom of the master.
Returns: This function does not return a dict, unlike all other API functions: it returns a string of bytes (size = 64kb).

WebInterface.master_restore(token, data)

Restore a backup of the eeprom of the master.
Parameters: data (multipart/form-data encoded bytes (size = 64 kb).) – The eeprom backup to restore.
Returns: ‘output’: array with the addresses that were written.

WebInterface.get_errors(token)

Get the number of seconds since the last successul communication with the master andpower modules (master_last_success, power_last_success) and the error list per module(input and output modules). The modules are identified by O1, O2, I1, I2, ...
Returns: ‘errors’: list of tuples (module, nr_errors), ‘master_last_success’: UNIX timestamp of the last succesful master communication and ‘power_last_success’: UNIX timestamp of the last successful power communication.

WebInterface.master_clear_error_list(token)

Clear the number of errors.

WebInterface.get_version(token)

Get the version of the openmotics software.
Returns: ‘version’: String (a.b.c).

WebInterface.get_status(token)

Get the status of the master.
Returns: ‘time’: hour and minutes (HH:MM), ‘date’: day, month, year (DD:MM:YYYY), ‘mode’: Integer, ‘version’: a.b.c and ‘hw_version’: hardware version (Integer).

WebInterface.update(token, version, md5, update_data)

Perform an update.
Parameters:
  • version (String) – the new version number.
  • md5 (String) – the md5 sum of update_data.
  • update_data (multipart/form-data encoded byte string.) – a tgz file containing the update script (update.sh) and data.

WebInterface.get_update_output(token)

Get the output of the last update.
Returns: ‘output’: String with the output from the update script.

WebInterface.open_maintenance(token)

Open maintenance mode, return the port of the maintenance socket.
Returns: ‘port’: Port on which the maintenance ssl socket is listening (Integer between 6000 and 7000).

WebInterface.set_master_status_leds(token, status)

Set the status of the leds on the master.
Parameters: status – whether the leds should be on (true) or off (false).