mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-22 16:56:50 +00:00
switch.rest updates (#1030)
* updates corresponding to PR#3329 * more explanation * de-jargoned iff
This commit is contained in:
parent
a1e5682613
commit
7935284290
@ -28,8 +28,10 @@ Configuration variables:
|
|||||||
|
|
||||||
- **resource** (*Required*): The resource or endpoint that contains the value.
|
- **resource** (*Required*): The resource or endpoint that contains the value.
|
||||||
- **name** (*Optional*): Name of the REST switch.
|
- **name** (*Optional*): Name of the REST switch.
|
||||||
- **body_on** (*Optional*): The body that represents enabled state. Default is "ON".
|
- **body_on** (*Optional*): The body of the POST request that commands the switch to become enabled. Default is "ON". This value can be a [template](/topics/templating/), which is useful if the POST request needs to depend on the state of the system. For example, to enable remote-temperature-sensor tracking on a radio thermostat, one has to send the current value of the remote temperature sensor. On can achieve this using the template `'{"rem_temp":{{states.sensor.bedroom_temp.state}}}'`.
|
||||||
- **body_off** (*Optional*):The body that represents disabled state. Default is "OFF".
|
- **body_off** (*Optional*): The body of the POST request that commands the switch to become disabled. Default is "OFF". This value can also be a template.
|
||||||
|
- **is_on_template** (*Optional*): A [template](/topics/templating/) that determines the state of the switch from the value returned by the GET request on the resource url. This template should compute to a boolean (True or False). Default is equivalent to `'{{ value.json == body_on }}'`. This means that by default, the state of the switch is on if and only if the response to the GET request matches `body_on`.
|
||||||
|
|
||||||
|
|
||||||
<p class='note warning'>
|
<p class='note warning'>
|
||||||
Make sure that the URL matches exactly your endpoint or resource.
|
Make sure that the URL matches exactly your endpoint or resource.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user