From 39fe5b5f10bef2f90d0b42475975fa4841f84056 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 13 Nov 2015 13:55:38 +0100 Subject: [PATCH 1/4] Add inital binary sensor page --- source/_components/binary_sensor.markdown | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 source/_components/binary_sensor.markdown diff --git a/source/_components/binary_sensor.markdown b/source/_components/binary_sensor.markdown new file mode 100644 index 00000000000..8e79aa0afd4 --- /dev/null +++ b/source/_components/binary_sensor.markdown @@ -0,0 +1,15 @@ +--- +layout: component +title: "Binary Sensor" +description: "Instructions how to setup your binary sensors with Home Assistant." +date: 2015-11-13 14:00 +sidebar: true +comments: false +sharing: true +footer: true +--- + +Binary sensors are gathering information about state of a switch/contact/pin. This means that those sensors knows only two states: **off/low/open*** and ***on/high/closed**. + + + From 7ca70ea0d8623536854de5cfe1d0a56d4ba6798b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 20 Nov 2015 15:37:17 +0100 Subject: [PATCH 2/4] Minor update --- source/_components/binary_sensor.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/_components/binary_sensor.markdown b/source/_components/binary_sensor.markdown index 8e79aa0afd4..82f2a1bb951 100644 --- a/source/_components/binary_sensor.markdown +++ b/source/_components/binary_sensor.markdown @@ -2,14 +2,14 @@ layout: component title: "Binary Sensor" description: "Instructions how to setup your binary sensors with Home Assistant." -date: 2015-11-13 14:00 +date: 2015-11-20 14:00 sidebar: true comments: false sharing: true footer: true --- -Binary sensors are gathering information about state of a switch/contact/pin. This means that those sensors knows only two states: **off/low/open*** and ***on/high/closed**. - +Binary sensors are gathering information about state of switches, contacts, pins, and alike. The return value of those sensors is usually digital (1/0). This means that those sensors knows only two states: **off/low/open*** and ***on/high/closed**. +For analog sensors please check the [component overview](https://home-assistant.io/components/#sensor). From 0afeb3907c28730c7d1e54b0f8c4cae4c8028398 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 22 Nov 2015 08:33:17 +0100 Subject: [PATCH 3/4] Initial MQTT binary sensor page --- .../_components/binary_sensor.mqtt.markdown | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 source/_components/binary_sensor.mqtt.markdown diff --git a/source/_components/binary_sensor.mqtt.markdown b/source/_components/binary_sensor.mqtt.markdown new file mode 100644 index 00000000000..50a97096714 --- /dev/null +++ b/source/_components/binary_sensor.mqtt.markdown @@ -0,0 +1,44 @@ +--- +layout: component +title: "MQTT binary sensor" +description: "Instructions how to integrate MQTT binary sensors within Home Assistant." +date: 2015-05-30 23:21 +sidebar: true +comments: false +sharing: true +footer: true +logo: mqtt.png +ha_category: Binary Sensor +--- + + +This MQTT binary sensor implementation uses the MQTT message payload as the sensor value. If messages in this state_topic are published with *RETAIN* flag, the sensor will receive an instant update with the last known value. Otherwise, the initial state will be off. + +To use your MQTT binary sensor in your installation, add the following to your `configuration.yaml` file: + +```yaml +# Example configuration.yml entry +binary_sensor: + platform: mqtt + state_topic: "home-assistant/window/contact" + name: "MQTT Sensor" + qos: 0 + payload_on: "ON" + payload_of: "OFF" +``` + +Configuration variables: + +- **state_topic** (*Required*): The MQTT topic subscribed to receive sensor values. +- **name** (*Optional*): The name of the sensor. Default is 'MQTT Sensor'. +- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0. +- **payload_on** (*Optional*): The payload that represents on state. Default is "ON". +- **payload_off** (*Optional*): The payload that represents state. Default is "OFF". + + +For a quick check you can use the commandline tools shipped with `mosquitto` to send MQTT messages. Set the state of your sensor manually: + +```bash +$ mosquitto_pub -h 127.0.0.1 -t home-assistant/window/contact -m "OFF" +``` + From c80546cb39b630041ad5c970b016e6489f84010f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 22 Nov 2015 08:37:03 +0100 Subject: [PATCH 4/4] Add initial aREST page for binary sensor --- .../_components/binary_sensor.arest.markdown | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 source/_components/binary_sensor.arest.markdown diff --git a/source/_components/binary_sensor.arest.markdown b/source/_components/binary_sensor.arest.markdown new file mode 100644 index 00000000000..9315bb68d3b --- /dev/null +++ b/source/_components/binary_sensor.arest.markdown @@ -0,0 +1,44 @@ +--- +layout: component +title: "aREST binary sensor" +description: "Instructions how to integrate aREST binary sensors within Home Assistant." +date: 2015-11-20 18:15 +sidebar: true +comments: false +sharing: true +footer: true +logo: arest.png +ha_category: Binary Sensor +--- + + +The arest binary sensor platform allows you to get all data from your devices (like Arduinos with a ethernet/wifi connection, the ESP8266, and the Raspberry Pi) running the [aREST](http://arest.io/) RESTful framework. + +To use your aREST binary sensor in your installation, add the following to your `configuration.yaml` file: + +```yaml +# Example configuration.yaml entry +sensor: + platform: arest + resource: http://IP_ADDRESS + name: Office Switch + 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. +- **name** (*Optional*): Let you overwrite the the name of the device. By default *name* from the device is used. +- **pin** (*Required*): Number of the pin to monitor. + +Accessing the URL http://IP_ADDRESS/digital/PIN_NUMBER should give you the state of the pin inside a JSON response as `return_value`. + +```bash +$ curl -X GET http://10.100.0.157/digital/9 +{"return_value": 0, "id": "office1", "name": "Office", "connected": true} + +``` + +

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