Skip to content

Commit 6eb3460

Browse files
Adds documentation for Alarm Control Panel REST API endpoints (#4517)
1 parent 75e64bd commit 6eb3460

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

web-api/index.rst

+27
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,33 @@ method is ``set``. The following parameter can be used:
320320

321321
For example POST ``/number/desired_delay/set?value=24`` will set the number to 24.
322322

323+
Alarm Control Panel
324+
*******************
325+
326+
The current state of an Alarm Control Panel can be retrieved by a GET request to ``alarm_control_panel/my_alarm``
327+
which may yield:
328+
329+
.. code-block:: json
330+
331+
{
332+
"id": "alarm-control-panel-my_alarm",
333+
"state": "ARMED_AWAY",
334+
"value": 2
335+
}
336+
337+
- **id**: The ID of the alarm control panel, prefixed with ``alarm-control-panel-``.
338+
- **state**: ``DISARMED``, ``ARMED_HOME``, ``ARMED_AWAY``, ``ARMED_NIGHT``, ``ARMED_VACATION``,
339+
``ARMED_CUSTOM_BYPASS``, ``PENDING``, ``ARMING``, ``DISARMING``, or ``TRIGGERED``.
340+
- **value**: Current state as number. See the ``AlarmControlPanelState`` enum.
341+
342+
A POST request allows arming and disarming the alarm control panel. Available methods are ``arm_away``, ``arm_home``,
343+
``arm_night``, ``arm_vacation`` and ``disarm``. The ``code`` parameter may be given if the alarm control panel requires
344+
a code for disarming or arming. For example, a POST to ``alarm_control_panel/my_alarm/disarm?code=1234`` would attempt to
345+
disarm the alarm control panel named "My Alarm" using the code 1234.
346+
347+
A valid POST request will always return a 200 OK status response. This does not indicate that the alarm was armed or
348+
disarmed successfully. It only indicates that the command was received and processed by the web server.
349+
323350
See Also
324351
--------
325352

0 commit comments

Comments
 (0)