Home API
API
Cancel

API

Here you can find information about the TerrariumPI REST API. An interactive version can be found at your own TerrariumPI at http://[raspberrypi]:8090/api/swagger/

/api/areas/types/

GET Get available area types

Responses

200 Zero or more area types with supported sensor types.
Name Located in Description Type
type body Area type ID String
name body Area type readable name String
sensors body List of sensor types that can be used by this area type Array of

/api/areas/

GET Get existing areas

Responses

200 Zero or more areas
Name Located in Description Type
id body Auto generated ID String
enclosure body The ID of the enclosure of which this area belongs to String
name body Name of the area String
type body Area type from the AreaType list String
mode body Operating mode String
setup body JSON setup data String
Default: {}
state body JSON state data String
Default: {}

POST Add a new area to an enclosure {"Basic"=>[]}

Parameters

Name Located in Description Type
enclosure body The ID of the enclosure of which this area belongs to String
name body Name of the area String
type body Area type from the AreaType list String
mode body Operating mode String
setup body JSON setup data String
Default: {}

Responses

200 A new created area
Name Located in Description Type
id body Auto generated ID String
enclosure body The ID of the enclosure of which this area belongs to String
name body Name of the area String
type body Area type from the AreaType list String
mode body Operating mode String
setup body JSON setup data String
Default: {}
state body JSON state data String
Default: {}
500 Unexpected server error

/api/areas/{id}/

GET Get a specific area

Parameters

Name Located in Description Type
id path ID of area to return String

Responses

200 The requested area
Name Located in Description Type
id body Auto generated ID String
enclosure body The ID of the enclosure of which this area belongs to String
name body Name of the area String
type body Area type from the AreaType list String
mode body Operating mode String
setup body JSON setup data String
Default: {}
state body JSON state data String
Default: {}
404 Area does not exists
500 Unexpected server error

PUT Update an existing area with new data {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of area to update String
enclosure body The ID of the enclosure of which this area belongs to String
name body Name of the area String
type body Area type from the AreaType list String
mode body Operating mode String
setup body JSON setup data String
Default: {}

Responses

200 The updated area
Name Located in Description Type
id body Auto generated ID String
enclosure body The ID of the enclosure of which this area belongs to String
name body Name of the area String
type body Area type from the AreaType list String
mode body Operating mode String
setup body JSON setup data String
Default: {}
state body JSON state data String
Default: {}
404 Area does not exists
500 Unexpected server error

DELETE Delete an existing area {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of area to delete String

Responses

200 Delete successfull
404 Area does not exists
500 Unexpected server error

/api/audio/hardware/

GET Get a list of supported soundcards

Responses

200 List of supported soundcards
Name Located in Description Type
index body Audio hardware ID Integer
name body Audio hardware readable name String

/api/audio/files/

GET Get a list of existing audio files

Responses

200 Zero or more audio files
Name Located in Description Type
id body Auto generated ID String
name body Artist and song name based on ID3 tag data String
filename body The full path of the audio file String
duration body Audio file duration in seconds Number
filesize body Audio file size in bytes Number

POST Upload a new audio file {"Basic"=>[]}

Parameters

Name Located in Description Type
audiofiles body The uploaded audio file
{"type"=>"array", "items"=>{"type"=>"string"}}

Responses

200 Audio file is uploaded
Name Located in Description Type
id body Auto generated ID String
name body Artist and song name based on ID3 tag data String
filename body The full path of the audio file String
duration body Audio file duration in seconds Number
filesize body Audio file size in bytes Number
500 Unexpected server error

/api/audio/files/{file}

GET Get an existing audio file

Parameters

Name Located in Description Type
file path ID of audio file String

Responses

200 The requested audio file
Name Located in Description Type
id body Auto generated ID String
name body Artist and song name based on ID3 tag data String
filename body The full path of the audio file String
duration body Audio file duration in seconds Number
filesize body Audio file size in bytes Number
404 Audio file does not exists
500 Unexpected server error

DELETE Delete an existing audio file {"Basic"=>[]}

Parameters

Name Located in Description Type
file path ID of audio file String

Responses

200 The requested audio file is deleted
404 Audio file does not exists
500 Unexpected server error

/api/buttons/hardware/

GET Get a list of supported buttons

Responses

200 List of supported hardware
Name Located in Description Type
hardware body Button hardware type ID String
name body Button hardware type name String

/api/buttons/

GET Get a list of existing buttons

Responses

200 Zero or more buttons
Name Located in Description Type
id body Auto generated ID String
hardware body Button hardware type from ButtonHardware list String
name body Name of the button String
address body The address of the button String
calibration body JSON data String
Default: {}
value body The current state of the button Number

POST Add a new button {"Basic"=>[]}

Parameters

Name Located in Description Type
hardware body Button hardware type from ButtonHardware list String
name body Name of the button String
address body The address of the button String
calibration body JSON data String
Default: {}

Responses

200 A new created button
Name Located in Description Type
id body Auto generated ID String
hardware body Button hardware type from ButtonHardware list String
name body Name of the button String
address body The address of the button String
calibration body JSON data String
Default: {}
value body The current state of the button Number
500 Unexpected server error

/api/buttons/{id}/

GET Get a specific button

Parameters

Name Located in Description Type
id path ID of button to return String

Responses

200 The requested button
Name Located in Description Type
id body Auto generated ID String
hardware body Button hardware type from ButtonHardware list String
name body Name of the button String
address body The address of the button String
calibration body JSON data String
Default: {}
value body The current state of the button Number
404 Button does not exists
500 Unexpected server error

PUT Update an existing button with new data {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of button to update String
hardware body Button hardware type from ButtonHardware list String
name body Name of the button String
address body The address of the button String
calibration body JSON data String
Default: {}

Responses

200 The updated button
Name Located in Description Type
id body Auto generated ID String
hardware body Button hardware type from ButtonHardware list String
name body Name of the button String
address body The address of the button String
calibration body JSON data String
Default: {}
value body The current state of the button Number
404 Button does not exists
500 Unexpected server error

DELETE Delete an existing button {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of button to delete String

Responses

200 Delete successfull
404 Button does not exists
500 Unexpected server error

/api/buttons/{id}/history/

GET Get the history for a specific button for a period of 1 day

Parameters

Name Located in Description Type
id path ID of button for which to get the history String

Responses

200 Button history for 1 day
Name Located in Description Type
timestamp body Button measurement unix timestamp Integer
value body Button measurement state Number
404 Button does not exists
500 Unexpected server error

/api/buttons/{id}/history/{period}/

GET Get the history for a specific button for a period

Parameters

Name Located in Description Type
id path ID of button to return String
period path Period String

Responses

200 Button history for {period}
Name Located in Description Type
timestamp body Button measurement unix timestamp Integer
value body Button measurement state Number
404 Button does not exists
500 Unexpected server error

/api/calendar/

GET Get existing calendars

Parameters

Name Located in Description Type
start query Start date and time for calendar items String
end query End date and time for calendar items String

Responses

200 Zero or more calendars
Name Located in Description Type
id body Auto generated ID String
summary body Event title String
description body Event description String
location body Event location String
dtstart body Event start date and time String
dtend body Event end date and time String
all_day body True when the event is an all day event Boolean
freq body Event repeat period String
interval body Event repeat period value Integer
repeatend body Event repeat end date and time String

POST Add a new calendar event {"Basic"=>[]}

Parameters

Name Located in Description Type
summary body Event title String
description body Event description String
location body Event location String
dtstart body Event start date and time String
dtend body Event end date and time String
all_day body True when the event is an all day event Boolean
freq body Event repeat period String
interval body Event repeat period value Integer
repeatend body Event repeat end date and time String

Responses

200 A new created calendar
Name Located in Description Type
id body Auto generated ID String
summary body Event title String
description body Event description String
location body Event location String
dtstart body Event start date and time String
dtend body Event end date and time String
all_day body True when the event is an all day event Boolean
freq body Event repeat period String
interval body Event repeat period value Integer
repeatend body Event repeat end date and time String
500 Unexpected server error

/api/calendar/{id}/

GET Get a specific calendar

Parameters

Name Located in Description Type
id path ID of calendar to return String

Responses

200 The requested calendar
Name Located in Description Type
id body Auto generated ID String
summary body Event title String
description body Event description String
location body Event location String
dtstart body Event start date and time String
dtend body Event end date and time String
all_day body True when the event is an all day event Boolean
freq body Event repeat period String
interval body Event repeat period value Integer
repeatend body Event repeat end date and time String
404 Calendar does not exists
500 Unexpected server error

PUT Update an existing calendar with new data {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of calendar to update String
summary body Event title String
description body Event description String
location body Event location String
dtstart body Event start date and time String
dtend body Event end date and time String
all_day body True when the event is an all day event Boolean
freq body Event repeat period String
interval body Event repeat period value Integer
repeatend body Event repeat end date and time String

Responses

200 The updated calendar
Name Located in Description Type
id body Auto generated ID String
summary body Event title String
description body Event description String
location body Event location String
dtstart body Event start date and time String
dtend body Event end date and time String
all_day body True when the event is an all day event Boolean
freq body Event repeat period String
interval body Event repeat period value Integer
repeatend body Event repeat end date and time String
404 Calendar does not exists
500 Unexpected server error

DELETE Delete an existing calendar {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of calendar to delete String

Responses

200 Delete successfull
404 Calendar does not exists
500 Unexpected server error

/api/calendar/download/

GET Download iCal

Responses

200 The calendar in iCal format
404 Calendar does not exists
500 Unexpected server error

/api/enclosures/

GET Get a list of existing enclosures

Responses

200 Zero or more enclosures
Name Located in Description Type
id body Auto generated ID String
name body Name of the enclosure String
image body Enclosure image String
areas body A list of areas that are in this enclosure Array of
doors body A list of doors (button) that are in this enclosure Array of
webcams body A list of webcams that are in this enclosure Array of

POST Add a new enclosure {"Basic"=>[]}

Parameters

Name Located in Description Type
name body Name of the enclosure String
image body Enclosure image String
areas body A list of areas that are in this enclosure Array of
doors body A list of doors (button) that are in this enclosure Array of
webcams body A list of webcams that are in this enclosure Array of

Responses

200 A new created enclosure
Name Located in Description Type
id body Auto generated ID String
name body Name of the enclosure String
image body Enclosure image String
areas body A list of areas that are in this enclosure Array of
doors body A list of doors (button) that are in this enclosure Array of
webcams body A list of webcams that are in this enclosure Array of
500 Unexpected server error

/api/enclosures/{id}/

GET Get a specific enclosure

Parameters

Name Located in Description Type
id path ID of enclosure to return String

Responses

200 The requested enclosure
Name Located in Description Type
id body Auto generated ID String
name body Name of the enclosure String
image body Enclosure image String
areas body A list of areas that are in this enclosure Array of
doors body A list of doors (button) that are in this enclosure Array of
webcams body A list of webcams that are in this enclosure Array of
404 Enclosure does not exists
500 Unexpected server error

PUT Update an existing enclosure with new data {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of enclosure to update String
name body Name of the enclosure String
image body Enclosure image String
areas body A list of areas that are in this enclosure Array of
doors body A list of doors (button) that are in this enclosure Array of
webcams body A list of webcams that are in this enclosure Array of

Responses

200 The updated enclosure
Name Located in Description Type
id body Auto generated ID String
name body Name of the enclosure String
image body Enclosure image String
areas body A list of areas that are in this enclosure Array of
doors body A list of doors (button) that are in this enclosure Array of
webcams body A list of webcams that are in this enclosure Array of
404 Enclosure does not exists
500 Unexpected server error

DELETE Delete an existing enclosure {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of enclosure to delete String

Responses

200 Delete successfull
404 Enclosure does not exists
500 Unexpected server error

/api/{action}/

POST Restart/reboot/shutdown TerrariumPI {"Basic"=>[]}

Parameters

Name Located in Description Type
action path Action to perform String

Responses

200 Result of the action
Name Located in Description Type
message body Holds the return message from the server String
Default: Action succeeded

/api/logfile/download/

GET Download the logfile {"Basic"=>[]}

Responses

200 Get the logfile in plain text

/api/playlists/

GET Get a list of existing playlists

Responses

200 Zero or more playlists
Name Located in Description Type
id body Auto generated ID String
name body Name of the playlist String
volume body Volume for this playlist Number
Default: 80
shuffle body Enable shuffle for this playlist Boolean
repeat body Enable repeating for this playlist Boolean
files body List of audio files Array of

POST Add a new playlist {"Basic"=>[]}

Parameters

Name Located in Description Type
id body Auto generated ID String
name body Name of the playlist String
volume body Volume for this playlist Number
Default: 80
shuffle body Enable shuffle for this playlist Boolean
repeat body Enable repeating for this playlist Boolean
files body List of audio files Array of

Responses

200 A new created playlist
Name Located in Description Type
id body Auto generated ID String
name body Name of the playlist String
volume body Volume for this playlist Number
Default: 80
shuffle body Enable shuffle for this playlist Boolean
repeat body Enable repeating for this playlist Boolean
files body List of audio files Array of
500 Unexpected server error

/api/playlists/{id}/

GET Get a specific playlist

Parameters

Name Located in Description Type
id path ID of playlist to return String

Responses

200 The requested playlist
Name Located in Description Type
id body Auto generated ID String
name body Name of the playlist String
volume body Volume for this playlist Number
Default: 80
shuffle body Enable shuffle for this playlist Boolean
repeat body Enable repeating for this playlist Boolean
files body List of audio files Array of
404 Playlist does not exists
500 Unexpected server error

PUT Update an existing playlist with new data {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of playlist to update String
id body Auto generated ID String
name body Name of the playlist String
volume body Volume for this playlist Number
Default: 80
shuffle body Enable shuffle for this playlist Boolean
repeat body Enable repeating for this playlist Boolean
files body List of audio files Array of

Responses

200 The updated playlist
Name Located in Description Type
id body Auto generated ID String
name body Name of the playlist String
volume body Volume for this playlist Number
Default: 80
shuffle body Enable shuffle for this playlist Boolean
repeat body Enable repeating for this playlist Boolean
files body List of audio files Array of
404 Playlist does not exists
500 Unexpected server error

DELETE Delete an existing playlist {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of playlist to delete String

Responses

200 Delete successfull
404 Playlist does not exists
500 Unexpected server error

/api/relays/hardware/

GET Get a list of supported relays

Responses

200 List of supported hardware
Name Located in Description Type
hardware body Relay hardware type ID String
name body Relay hardware type name String

/api/relays/scan/

POST Scan for new relays {"Basic"=>[]}

Responses

200 Found zero or more new relays
Name Located in Description Type
message body Holds the return message from the server String
Default: Action succeeded

/api/relays/

GET Get a list of existing relays

Responses

200 Zero or more relays
Name Located in Description Type
id body Auto generated ID String
hardware body Relay hardware type from RelayHardware list String
name body Name of the relay String
address body The address of the relay String
wattage body The amount of power in watts the relay uses when on Number
Default: 0
flow body The amount of water in liter per minute the relay uses when on Number
Default: 0
manual_mode body Is the relay in manual mode Boolean
replacement body Last replacement date and time of the attached hardware String
Default: 1970-01-01 00:00:00
calibration body JSON data Object
value body The current state of the relay Number
dimmer body Is the relay a dimmer Boolean

POST Add a new relay {"Basic"=>[]}

Parameters

Name Located in Description Type
hardware body Relay hardware type from RelayHardware list String
name body Name of the relay String
address body The address of the relay String
wattage body The amount of power in watts the relay uses when on Number
Default: 0
flow body The amount of water in liter per minute the relay uses when on Number
Default: 0
calibration body JSON data Object

Responses

200 A new created relay
Name Located in Description Type
id body Auto generated ID String
hardware body Relay hardware type from RelayHardware list String
name body Name of the relay String
address body The address of the relay String
wattage body The amount of power in watts the relay uses when on Number
Default: 0
flow body The amount of water in liter per minute the relay uses when on Number
Default: 0
manual_mode body Is the relay in manual mode Boolean
replacement body Last replacement date and time of the attached hardware String
Default: 1970-01-01 00:00:00
calibration body JSON data Object
value body The current state of the relay Number
dimmer body Is the relay a dimmer Boolean
500 Unexpected server error

/api/relays/{id}/

GET Get a specific relay

Parameters

Name Located in Description Type
id path ID of relay to return String

Responses

200 The requested relay
Name Located in Description Type
id body Auto generated ID String
hardware body Relay hardware type from RelayHardware list String
name body Name of the relay String
address body The address of the relay String
wattage body The amount of power in watts the relay uses when on Number
Default: 0
flow body The amount of water in liter per minute the relay uses when on Number
Default: 0
manual_mode body Is the relay in manual mode Boolean
replacement body Last replacement date and time of the attached hardware String
Default: 1970-01-01 00:00:00
calibration body JSON data Object
value body The current state of the relay Number
dimmer body Is the relay a dimmer Boolean
404 Relay does not exists
500 Unexpected server error

PUT Update an existing relay with new data {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of relay to update String
hardware body Relay hardware type from RelayHardware list String
name body Name of the relay String
address body The address of the relay String
wattage body The amount of power in watts the relay uses when on Number
Default: 0
flow body The amount of water in liter per minute the relay uses when on Number
Default: 0
calibration body JSON data Object

Responses

200 The updated relay
Name Located in Description Type
id body Auto generated ID String
hardware body Relay hardware type from RelayHardware list String
name body Name of the relay String
address body The address of the relay String
wattage body The amount of power in watts the relay uses when on Number
Default: 0
flow body The amount of water in liter per minute the relay uses when on Number
Default: 0
manual_mode body Is the relay in manual mode Boolean
replacement body Last replacement date and time of the attached hardware String
Default: 1970-01-01 00:00:00
calibration body JSON data Object
value body The current state of the relay Number
dimmer body Is the relay a dimmer Boolean
404 Relay does not exists
500 Unexpected server error

DELETE Delete an existing relay {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of relay to delete String

Responses

200 Delete successfull
404 Relay does not exists
500 Unexpected server error

/api/relays/{id}/history/

GET Get the history for a specific relay for a period of 1 day

Parameters

Name Located in Description Type
id path ID of relay for which to get the history String

Responses

200 Relay history for 1 day
Name Located in Description Type
timestamp body Relay measurement unix timestamp Integer
value body Relay measurement state Number
404 Relay does not exists
500 Unexpected server error

/api/relays/{id}/history/{period}/

GET Get the history for a specific relay for a period

Parameters

Name Located in Description Type
id path ID of relay to return String
period path Period String

Responses

200 Relay history for {period}
Name Located in Description Type
timestamp body Relay measurement unix timestamp Integer
value body Relay measurement state Number
404 Relay does not exists
500 Unexpected server error

/api/relays/{id}/export/

GET Get the export for a specific relay for a period of 1 day {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of relay for which to get the export String

Responses

200 Relay export for 1 day
404 Relay does not exists
500 Unexpected server error

/api/relays/{id}/export/{period}/

GET Get the export for a specific relay for a period {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of relay to return String
period path Period String

Responses

200 Relay export for {period}
404 Relay does not exists
500 Unexpected server error

/api/relays/{id}/{action}/

POST Change relay {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of relay String
action path Relay action String

Responses

200 Return the new state
Name Located in Description Type
message body Holds the return message from the server String
Default: Action succeeded
404 Relay does not exists
500 Unexpected server error

/api/sensors/hardware/

GET Get a list of supported sensors

Responses

200 List of supported hardware
Name Located in Description Type
hardware body Sensor hardware type ID String
name body Sensor hardware type name String
types body List of supported sensor types Array of

/api/sensors/scan/

POST Scan for new sensors

Responses

200 Found zero or more new sensors
Name Located in Description Type
message body Holds the return message from the server String
Default: Action succeeded

/api/sensors/

GET Get a list of existing sensors

Responses

200 Zero or more sensors
Name Located in Description Type
id body Auto generated ID String
hardware body Sensor hardware type from SensorHardware list String
type body The sensor measurement type String
name body Name of the sensor String
address body The address of the sensor String
limit_min body The minimum value which is a valid measurement Number
Default: 0
limit_max body The maximum value which is a valid measurement Number
Default: 100
alarm_min body The minimum value which triggers the alarm Number
Default: 0
alarm_max body The maximum value which triggers the alarm Number
Default: 100
max_diff body The maximum difference between two measurements that is valid Number
Default: 0
exclude_avg body Exclude this sensor from average calculation on the dashboard Boolean
calibration body JSON data Object
value body The current value of the sensor Number
alarm body Is there a high or low alarm Boolean
error body Is there a hardware problem with the sensor Boolean

POST Add a new sensor {"Basic"=>[]}

Parameters

Name Located in Description Type
hardware body Sensor hardware type from SensorHardware list String
type body The sensor measurement type String
name body Name of the sensor String
address body The address of the sensor String
limit_min body The minimum value which is a valid measurement Number
Default: 0
limit_max body The maximum value which is a valid measurement Number
Default: 100
alarm_min body The minimum value which triggers the alarm Number
Default: 0
alarm_max body The maximum value which triggers the alarm Number
Default: 100
max_diff body The maximum difference between two measurements that is valid Number
Default: 0
exclude_avg body Exclude this sensor from average calculation on the dashboard Boolean
calibration body JSON data Object

Responses

200 A new created sensor
Name Located in Description Type
id body Auto generated ID String
hardware body Sensor hardware type from SensorHardware list String
type body The sensor measurement type String
name body Name of the sensor String
address body The address of the sensor String
limit_min body The minimum value which is a valid measurement Number
Default: 0
limit_max body The maximum value which is a valid measurement Number
Default: 100
alarm_min body The minimum value which triggers the alarm Number
Default: 0
alarm_max body The maximum value which triggers the alarm Number
Default: 100
max_diff body The maximum difference between two measurements that is valid Number
Default: 0
exclude_avg body Exclude this sensor from average calculation on the dashboard Boolean
calibration body JSON data Object
value body The current value of the sensor Number
alarm body Is there a high or low alarm Boolean
error body Is there a hardware problem with the sensor Boolean
500 Unexpected server error

/api/sensors/{id}/

GET Get a specific sensor

Parameters

Name Located in Description Type
id path ID of sensor to return String

Responses

200 The requested sensor
Name Located in Description Type
id body Auto generated ID String
hardware body Sensor hardware type from SensorHardware list String
type body The sensor measurement type String
name body Name of the sensor String
address body The address of the sensor String
limit_min body The minimum value which is a valid measurement Number
Default: 0
limit_max body The maximum value which is a valid measurement Number
Default: 100
alarm_min body The minimum value which triggers the alarm Number
Default: 0
alarm_max body The maximum value which triggers the alarm Number
Default: 100
max_diff body The maximum difference between two measurements that is valid Number
Default: 0
exclude_avg body Exclude this sensor from average calculation on the dashboard Boolean
calibration body JSON data Object
value body The current value of the sensor Number
alarm body Is there a high or low alarm Boolean
error body Is there a hardware problem with the sensor Boolean
404 Sensor does not exists
500 Unexpected server error

PUT Update an existing sensor with new data {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of sensor to update String
hardware body Sensor hardware type from SensorHardware list String
type body The sensor measurement type String
name body Name of the sensor String
address body The address of the sensor String
limit_min body The minimum value which is a valid measurement Number
Default: 0
limit_max body The maximum value which is a valid measurement Number
Default: 100
alarm_min body The minimum value which triggers the alarm Number
Default: 0
alarm_max body The maximum value which triggers the alarm Number
Default: 100
max_diff body The maximum difference between two measurements that is valid Number
Default: 0
exclude_avg body Exclude this sensor from average calculation on the dashboard Boolean
calibration body JSON data Object

Responses

200 The updated sensor
Name Located in Description Type
id body Auto generated ID String
hardware body Sensor hardware type from SensorHardware list String
type body The sensor measurement type String
name body Name of the sensor String
address body The address of the sensor String
limit_min body The minimum value which is a valid measurement Number
Default: 0
limit_max body The maximum value which is a valid measurement Number
Default: 100
alarm_min body The minimum value which triggers the alarm Number
Default: 0
alarm_max body The maximum value which triggers the alarm Number
Default: 100
max_diff body The maximum difference between two measurements that is valid Number
Default: 0
exclude_avg body Exclude this sensor from average calculation on the dashboard Boolean
calibration body JSON data Object
value body The current value of the sensor Number
alarm body Is there a high or low alarm Boolean
error body Is there a hardware problem with the sensor Boolean
404 Sensor does not exists
500 Unexpected server error

DELETE Delete an existing sensor {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of sensor to delete String

Responses

200 Delete successfull
404 Sensor does not exists
500 Unexpected server error

/api/sensors/{type}/

GET Get all sensor of {type}

Parameters

Name Located in Description Type
type path A valid sensor type String

Responses

200 The requested sensors
Name Located in Description Type
id body Auto generated ID String
hardware body Sensor hardware type from SensorHardware list String
type body The sensor measurement type String
name body Name of the sensor String
address body The address of the sensor String
limit_min body The minimum value which is a valid measurement Number
Default: 0
limit_max body The maximum value which is a valid measurement Number
Default: 100
alarm_min body The minimum value which triggers the alarm Number
Default: 0
alarm_max body The maximum value which triggers the alarm Number
Default: 100
max_diff body The maximum difference between two measurements that is valid Number
Default: 0
exclude_avg body Exclude this sensor from average calculation on the dashboard Boolean
calibration body JSON data Object
value body The current value of the sensor Number
alarm body Is there a high or low alarm Boolean
error body Is there a hardware problem with the sensor Boolean
404 Sensor type does not exists
500 Unexpected server error

/api/sensors/{filter}/history/

GET Get the history for a specific sensor or sensor type.

Parameters

Name Located in Description Type
filter path Either a sensor ID or sensor type can be used as filter String

Responses

200 Sensor history for 1 day
Name Located in Description Type
timestamp body Sensor measurement unix timestamp Integer
value body Sensor measurement value Number
alarm_min body Sensor measurement low alarm value Number
alarm_max body Sensor measurement high alarm value Number
404 Sensor does not exists
500 Unexpected server error

/api/sensors/{filter}/history/{period}/

GET Get the history for a specific sensor or sensor type.

Parameters

Name Located in Description Type
filter path Either a sensor ID or sensor type can be used as filter String
period path Period String

Responses

200 Sensor history for {period}
Name Located in Description Type
timestamp body Sensor measurement unix timestamp Integer
value body Sensor measurement value Number
alarm_min body Sensor measurement low alarm value Number
alarm_max body Sensor measurement high alarm value Number
404 Sensor does not exists
500 Unexpected server error

/api/sensors/{filter}/export/

GET Get the export for a specific sensor or sensor type. {"Basic"=>[]}

Parameters

Name Located in Description Type
filter path Either a sensor ID or sensor type can be used as filter String

Responses

200 Sensor export for 1 day
404 Sensor does not exists
500 Unexpected server error

/api/sensors/{filter}/export/{period}/

GET Get the export for a specific sensor or sensor type. {"Basic"=>[]}

Parameters

Name Located in Description Type
filter path Either a sensor ID or sensor type can be used as filter String
period path Period String

Responses

200 Sensor export for {period}
404 Sensor does not exists
500 Unexpected server error

/api/system_status/

GET Get the current state

Responses

200 System status
Name Located in Description Type
is_day body Is the system in day mode Boolean
uptime body System uptime in seconds Integer
load body System load in percentage and absolute values. It contains the current, last 5 minutes and last 15 minutes load Object
cpu_temperature body The current system CPU temperature Integer
memory body System memory usage status Object
storage body System disk usage status Object

/api/settings/

GET Get all settings {"Basic"=>[]}

Responses

200 All settings
Name Located in Description Type
id body Setting ID String
value body Setting value String

PUT Update multiple settings {"Basic"=>[]}

Parameters

Name Located in Description Type
body body All settings to change in one action
{"type"=>"array", "items"=>{"$ref"=>"#/definitions/Setting"}}

Responses

200 All settings
Name Located in Description Type
message body Holds the return message from the server String
Default: Action succeeded
400 Password fields do not match.

POST Add a new setting {"Basic"=>[]}

Parameters

Name Located in Description Type
value body Setting value String

Responses

200 All settings
Name Located in Description Type
id body Setting ID String
value body Setting value String

/api/settings/{id}/

GET Get a setting {"Basic"=>[]}

Parameters

Name Located in Description Type
id path Setting ID String

Responses

200 All settings
Name Located in Description Type
id body Setting ID String
value body Setting value String

PUT Update a setting {"Basic"=>[]}

Parameters

Name Located in Description Type
id path The setting to update String
value body Setting value String

Responses

200 All settings
Name Located in Description Type
message body Holds the return message from the server String
Default: Action succeeded
400 Password fields do not match.

DELETE Delete a setting {"Basic"=>[]}

Parameters

Name Located in Description Type
id path The setting to delete String

Responses

200 All settings
Name Located in Description Type
message body Holds the return message from the server String
Default: Action succeeded
404 Setting does not exists

/api/weather/

GET Get weather data

Responses

200 Weather data
Name Located in Description Type
location body The location based on the weather setting data Object
sun body The sun rise and set values based on the weather setting data Object
is_day body Is it currently day? Boolean
indicators body Temperature and other indicators based on locale Object
credits body Credits information from the free weather source Object
forecast body A seven day weather forecast Array of Object

/api/weather/forecast/

GET Get weather temperature forecast

Responses

200 Weather forecast data
Name Located in Description Type
value body Weather forecast temperature in the selected temperature indicator value Number
timestamp body Weather forecast unix timestamp Number

/api/webcams/hardware/

GET Get a list of supported webcams

Responses

200 List of supported hardware
Name Located in Description Type
hardware body Webcam hardware ID String
name body Webcam hardware readable name String

/api/webcams/

GET Get a list of existing webcams

Responses

200 Zero or more webcams
Name Located in Description Type
id body Auto generated ID String
hardware body Webcam hardware type from WebcamHardware list String
name body Name of the webcam String
address body The address of the webcam String
width body The webcam resolution width in pixels Integer
height body The webcam resolution height in pixels Integer
rotation body The webcam rotation String
awb body The webcam white balance mode String
is_live body Is the webcam a live streaming webcam Boolean
flash body The relays that works like a flash before taking a picture from the webcam Array of
archive body Webcam archiving setting Object
motion body Webcam motion settings when archiving is set to motion Object
markers body A list of markers for the webcam with live sensor data Array of

POST Add a new webcam {"Basic"=>[]}

Parameters

Name Located in Description Type
hardware body Webcam hardware type from WebcamHardware list String
name body Name of the webcam String
address body The address of the webcam String
width body The webcam resolution width in pixels Integer
height body The webcam resolution height in pixels Integer
rotation body The webcam rotation String
awb body The webcam white balance mode String
flash body The relays that works like a flash before taking a picture from the webcam Array of
archive body Webcam archiving setting Object
motion body Webcam motion settings when archiving is set to motion Object
markers body A list of markers for the webcam with live sensor data Array of

Responses

200 A new created webcam
Name Located in Description Type
id body Auto generated ID String
hardware body Webcam hardware type from WebcamHardware list String
name body Name of the webcam String
address body The address of the webcam String
width body The webcam resolution width in pixels Integer
height body The webcam resolution height in pixels Integer
rotation body The webcam rotation String
awb body The webcam white balance mode String
is_live body Is the webcam a live streaming webcam Boolean
flash body The relays that works like a flash before taking a picture from the webcam Array of
archive body Webcam archiving setting Object
motion body Webcam motion settings when archiving is set to motion Object
markers body A list of markers for the webcam with live sensor data Array of
500 Unexpected server error

/api/webcams/{id}/

GET Get a specific webcam

Parameters

Name Located in Description Type
id path ID of webcam to return String

Responses

200 The requested webcam
Name Located in Description Type
id body Auto generated ID String
hardware body Webcam hardware type from WebcamHardware list String
name body Name of the webcam String
address body The address of the webcam String
width body The webcam resolution width in pixels Integer
height body The webcam resolution height in pixels Integer
rotation body The webcam rotation String
awb body The webcam white balance mode String
is_live body Is the webcam a live streaming webcam Boolean
flash body The relays that works like a flash before taking a picture from the webcam Array of
archive body Webcam archiving setting Object
motion body Webcam motion settings when archiving is set to motion Object
markers body A list of markers for the webcam with live sensor data Array of
404 Webcam does not exists
500 Unexpected server error

PUT Update an existing webcam with new data {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of webcam to update String
hardware body Webcam hardware type from WebcamHardware list String
name body Name of the webcam String
address body The address of the webcam String
width body The webcam resolution width in pixels Integer
height body The webcam resolution height in pixels Integer
rotation body The webcam rotation String
awb body The webcam white balance mode String
flash body The relays that works like a flash before taking a picture from the webcam Array of
archive body Webcam archiving setting Object
motion body Webcam motion settings when archiving is set to motion Object
markers body A list of markers for the webcam with live sensor data Array of

Responses

200 The updated webcam
Name Located in Description Type
id body Auto generated ID String
hardware body Webcam hardware type from WebcamHardware list String
name body Name of the webcam String
address body The address of the webcam String
width body The webcam resolution width in pixels Integer
height body The webcam resolution height in pixels Integer
rotation body The webcam rotation String
awb body The webcam white balance mode String
is_live body Is the webcam a live streaming webcam Boolean
flash body The relays that works like a flash before taking a picture from the webcam Array of
archive body Webcam archiving setting Object
motion body Webcam motion settings when archiving is set to motion Object
markers body A list of markers for the webcam with live sensor data Array of
404 Webcam does not exists
500 Unexpected server error

DELETE Delete an existing webcam {"Basic"=>[]}

Parameters

Name Located in Description Type
id path ID of webcam to delete String

Responses

200 Delete successfull
404 Webcam does not exists
500 Unexpected server error

/api/webcams/{id}/archive/{period}/

GET Get a list of archived images for the selected period

Parameters

Name Located in Description Type
id path ID of webcam for which to get the archive String
period path The date for which to get archive images. Format %Y/%m/%d String

Responses

200 Webcam history for 1 day
Name Located in Description Type
String
404 Webcam does not exists
500 Unexpected server error
This post is licensed under CC BY 4.0 by the author.