diff --git a/atom.xml b/atom.xml index 5bc4882778..9ed9085366 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/announcements/atom.xml b/blog/categories/announcements/atom.xml index c511af6af4..16196ed89a 100644 --- a/blog/categories/announcements/atom.xml +++ b/blog/categories/announcements/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Announcements | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/community/atom.xml b/blog/categories/community/atom.xml index 5fc9892a33..7843724ee6 100644 --- a/blog/categories/community/atom.xml +++ b/blog/categories/community/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Community | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/device-tracking/atom.xml b/blog/categories/device-tracking/atom.xml index c3493d4c75..481c626970 100644 --- a/blog/categories/device-tracking/atom.xml +++ b/blog/categories/device-tracking/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Device-Tracking | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/esp8266/atom.xml b/blog/categories/esp8266/atom.xml index 9b702ce37d..f303b9b27b 100644 --- a/blog/categories/esp8266/atom.xml +++ b/blog/categories/esp8266/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: ESP8266 | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/how-to/atom.xml b/blog/categories/how-to/atom.xml index 94e45a26df..bf2ca914b4 100644 --- a/blog/categories/how-to/atom.xml +++ b/blog/categories/how-to/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: How-To | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/ibeacons/atom.xml b/blog/categories/ibeacons/atom.xml index 989cb15cd7..bf93673d42 100644 --- a/blog/categories/ibeacons/atom.xml +++ b/blog/categories/ibeacons/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: iBeacons | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/internet-of-things/atom.xml b/blog/categories/internet-of-things/atom.xml index b49af2658e..2206923432 100644 --- a/blog/categories/internet-of-things/atom.xml +++ b/blog/categories/internet-of-things/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Internet-of-Things | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/iot-data/atom.xml b/blog/categories/iot-data/atom.xml index 4b6a4469b8..d9dd18dd99 100644 --- a/blog/categories/iot-data/atom.xml +++ b/blog/categories/iot-data/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: IoT-Data | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/merchandise/atom.xml b/blog/categories/merchandise/atom.xml index 1a36ee1bae..3235c71799 100644 --- a/blog/categories/merchandise/atom.xml +++ b/blog/categories/merchandise/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Merchandise | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/micropython/atom.xml b/blog/categories/micropython/atom.xml index 42b5e41b49..6d4f21d361 100644 --- a/blog/categories/micropython/atom.xml +++ b/blog/categories/micropython/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Micropython | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/mqtt/atom.xml b/blog/categories/mqtt/atom.xml index 7199a2400e..d3427c6f2f 100644 --- a/blog/categories/mqtt/atom.xml +++ b/blog/categories/mqtt/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: MQTT | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/organisation/atom.xml b/blog/categories/organisation/atom.xml index 06a3f44456..c9a109878f 100644 --- a/blog/categories/organisation/atom.xml +++ b/blog/categories/organisation/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Organisation | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/owntracks/atom.xml b/blog/categories/owntracks/atom.xml index 29d17613a6..eaa6bc33d7 100644 --- a/blog/categories/owntracks/atom.xml +++ b/blog/categories/owntracks/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: OwnTracks | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/presence-detection/atom.xml b/blog/categories/presence-detection/atom.xml index 19c3db98a0..0e89515b0a 100644 --- a/blog/categories/presence-detection/atom.xml +++ b/blog/categories/presence-detection/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Presence-Detection | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/public-service-announcement/atom.xml b/blog/categories/public-service-announcement/atom.xml index dd0ec59cb2..a7d1181ac3 100644 --- a/blog/categories/public-service-announcement/atom.xml +++ b/blog/categories/public-service-announcement/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Public-Service-Announcement | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/release-notes/atom.xml b/blog/categories/release-notes/atom.xml index ed30209772..fe41dbf491 100644 --- a/blog/categories/release-notes/atom.xml +++ b/blog/categories/release-notes/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Release-Notes | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/survey/atom.xml b/blog/categories/survey/atom.xml index e13e81b928..0a75b89b31 100644 --- a/blog/categories/survey/atom.xml +++ b/blog/categories/survey/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Survey | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/talks/atom.xml b/blog/categories/talks/atom.xml index 66cdcb7b41..a9b13be0fe 100644 --- a/blog/categories/talks/atom.xml +++ b/blog/categories/talks/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Talks | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/technology/atom.xml b/blog/categories/technology/atom.xml index 07bd9691bf..cef2937a6d 100644 --- a/blog/categories/technology/atom.xml +++ b/blog/categories/technology/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Technology | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/user-stories/atom.xml b/blog/categories/user-stories/atom.xml index d7da6f2a77..3828ba9f62 100644 --- a/blog/categories/user-stories/atom.xml +++ b/blog/categories/user-stories/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: User-Stories | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/video/atom.xml b/blog/categories/video/atom.xml index 758273ad5c..24392fb533 100644 --- a/blog/categories/video/atom.xml +++ b/blog/categories/video/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Video | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/blog/categories/website/atom.xml b/blog/categories/website/atom.xml index 35c3df7491..9179a73e51 100644 --- a/blog/categories/website/atom.xml +++ b/blog/categories/website/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Website | Home Assistant]]> - 2017-05-28T09:27:08+00:00 + 2017-05-28T16:52:16+00:00 https://home-assistant.io/ diff --git a/components/switch.rest/index.html b/components/switch.rest/index.html index 7564587ea3..241555e9aa 100644 --- a/components/switch.rest/index.html +++ b/components/switch.rest/index.html @@ -80,11 +80,25 @@
  • name (Optional): Name of the REST switch.
  • 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, 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":}'.
  • 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 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.
  • +
  • is_on_template (Optional): A template 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). If the value is valid JSON, it will be available in the template as the variable value_json. See this example in the template docs. 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.
  • Make sure that the URL matches exactly your endpoint or resource.

    +

    Example

    +

    Switch with templated value

    +

    This example shows a switch that uses a template to allow Home Assistant to determine its state. In this example the REST endpoint returns this JSON response with true indicating the switch is on.

    +
    {"is_active": "true"}
    +
    +
    +
    switch:
    +  - platform: rest
    +    resource: http://<address>/led_endpoint
    +    body_on: '{"active": "true"}'
    +    body_off: '{"active": "false"}'
    +    is_on_template: '{{value_json.is_active}}'
    +
    +