home-assistant.io/source/_components/binary_sensor.arest.markdown
Alok Saboo 1aca7b08cf Misc fixes: e.g. -> e.g., and proper case for Home Assistant (#4942)
* e.g. to e.g., and proper case for Home Assistant

* Instructions how to -> Instructions on how to
2018-03-17 20:20:37 +01:00

1.7 KiB

layout, title, description, date, sidebar, comments, sharing, footer, logo, ha_category, ha_iot_class, ha_release
layout title description date sidebar comments sharing footer logo ha_category ha_iot_class ha_release
page aREST Binary Sensor Instructions on how to integrate aREST binary sensors within Home Assistant. 2015-11-20 18:15 true false true true arest.png Binary Sensor Local Polling 0.9

The arest binary sensor platform allows you to get all data from your devices (like Arduinos with an ethernet/wifi connection, the ESP8266, and the Raspberry Pi) running the aREST RESTful framework.

To use your aREST binary sensor in your installation, add the following to your configuration.yaml file:

# Example configuration.yaml entry
binary_sensor:
  - platform: arest
    resource: http://IP_ADDRESS
    pin: 8

Configuration variables:

  • resource (Required): IP address and schema of the device that is exposing an aREST API, e.g., http://192.168.1.10.
  • pin (Required): Number of the pin to monitor.
  • name (Optional): Let you overwrite the name of the device. By default name from the device is used.

Accessing the URL http://IP_ADDRESS/digital/PIN_NUMBER should give you the state of the pin inside a JSON response as return_value.

$ curl -X GET http://192.168.0.5/digital/9
{"return_value": 0, "id": "office1", "name": "Office", "connected": true}

An example for Pin 9 inspired by the command above could look like this:

# Example configuration.yaml entry
binary_sensor:
  - platform: arest
    resource: http://192.168.0.5/digital/9
    pin: 9
    name: Office

This sensor is not suitable for fast state changes because there is a high possibility that the change took place between two update cycle.