wiki:02_hiq-hotel:01_grms:03_s-rms:01.api
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
wiki:02_hiq-hotel:01_grms:03_s-rms:01.api [2024/09/05 08:38] – removed - external edit (Unknown date) 127.0.0.1 | wiki:02_hiq-hotel:01_grms:03_s-rms:01.api [2024/09/05 08:38] (current) – ↷ Page name changed from wiki:02_hiq-hotel:01_grms:03_s-rms:api to wiki:02_hiq-hotel:01_grms:03_s-rms:01.api goran.kocjancic | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== S-RMS API ====== | ||
+ | |||
+ | The API is a REST API with a bearer token authorization. | ||
+ | The API specification can be found [[https:// | ||
+ | |||
+ | ===== Adding an access code ===== | ||
+ | |||
+ | An access code can be added with a POST to / | ||
+ | |||
+ | The response is a HTTP 202 Accepted. | ||
+ | |||
+ | The access_code_controller_id path parameter is the ID of the controller to add the code to (eg.: access_code_controller_01, | ||
+ | |||
+ | The POST data is a JSON containing the necessary data for a valid access code. | ||
+ | |||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | A valid code must contain at least one access point with the remaining number of passes greater than 0 and must not be expired. | ||
+ | |||
+ | ===== Removing an access code ===== | ||
+ | |||
+ | An access code can be removed with a DELETE to / | ||
+ | |||
+ | The response is a HTTP 204. | ||
+ | |||
+ | The access_code_controller_id path parameter is the ID of the controller to remove the code from (eg.: access_code_controller_01, | ||
+ | The code path parameter is the decimal representation of the code to remove. | ||
+ | |||
+ | ===== Updating an access code ===== | ||
+ | |||
+ | An access code can be updated with a PUT to / | ||
+ | |||
+ | The response is a HTTP 202 Accepted. | ||
+ | |||
+ | The access_code_controller_id path parameter is the ID of the controller to update the code on (eg.: access_code_controller_01, | ||
+ | The code path parameter is the decimal representation of the code to update. | ||
+ | |||
+ | The PUT data is a JSON containing the necessary data for a valid access code. | ||
+ | |||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | A valid code must contain at least one access point with the remaining number of passes greater than 0 and must not be expired. | ||
+ | |||
+ | If no access points are specified then the access points of the access code are **not modified**. | ||
+ | |||
+ | ==== Updating only one access point of a code ==== | ||
+ | |||
+ | === Removing an access point === | ||
+ | |||
+ | An access point of an access code can be removed with a DELETE to / | ||
+ | |||
+ | The response is a HTTP 204. | ||
+ | |||
+ | The access_code_controller_id path parameter is the ID of the controller to update the code on (eg.: access_code_controller_01, | ||
+ | The code path parameter is the decimal representation of the code to update. | ||
+ | The ap_id path parameter is the ID of the access point to remove. | ||
+ | |||
+ | === Adding or updating an access point === | ||
+ | |||
+ | An access point of an access code can be added/ | ||
+ | |||
+ | The response is a HTTP 202. | ||
+ | |||
+ | The access_code_controller_id path parameter is the ID of the controller to update the code on (eg.: access_code_controller_01, | ||
+ | The code path parameter is the decimal representation of the code to update. | ||
+ | The ap_id path parameter is the ID of the access point to remove. | ||
+ | |||
+ | The PUT data is a JSON containing the necessary data for a valid access point. | ||
+ | |||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Reading an access code ===== | ||
+ | |||
+ | An access code can be read with a GET to / | ||
+ | |||
+ | The access_code_controller_id path parameter is the ID of the controller to update the code on (eg.: access_code_controller_01, | ||
+ | The code path parameter is the decimal representation of the code to update. | ||
+ | |||
+ | The response is a JSON containing code data. | ||
+ | |||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== Reading code data of a specified access point ==== | ||
+ | |||
+ | Access point data of an access code can be read with a GET to / | ||
+ | |||
+ | The access_code_controller_id path parameter is the ID of the controller to read the code from (eg.: access_code_controller_01, | ||
+ | The code path parameter is the decimal representation of the code to read. | ||
+ | The ap_id path parameter is the ID of the access point to read. | ||
+ | |||
+ | The response is a JSON with the access point data. | ||
+ | |||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Reading/ | ||
+ | |||
+ | Each room is split into logical //things// that represent controllable devices in the room. | ||
+ | |||
+ | The different types of things are: | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | The parent of all these things is the [[https:// | ||
+ | |||
+ | ==== Reading room device data ==== | ||
+ | |||
+ | Geting the room device state is done with a GET to / | ||
+ | |||
+ | The thing_id path parameter is the ID of the device to read the state from (eg.: room_01_light_1, | ||
+ | |||
+ | The response is a JSON with the device state. | ||
+ | |||
+ | === Light state === | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Dimmable light state === | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Scene state === | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Blinds state === | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === DND/MUR state === | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === SOS state === | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Fire alert state === | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Door state === | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === HVAC state === | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === HVAC setpoints state === | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Bathroom ventilation state === | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Room presence state === | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Room power supply state === | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Room state === | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Wake up state === | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== Setting room device state ==== | ||
+ | |||
+ | For writable device variables the state can be changed with a POST to / | ||
+ | |||
+ | The thing_id path parameter is the ID of the device to read the state to (eg.: room_01_light_1, | ||
+ | |||
+ | The POST data is a JSON containing **only** the variables to change. | ||
+ | |||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | The variable structure is the same as the response for reading device states. | ||
+ | |||
+ | The response is the updated device state (same as in a read request). | ||
+ | |||