diff --git a/source/_components/apcupsd.markdown b/source/_components/apcupsd.markdown index 16deab840ef..9ecd802fa24 100644 --- a/source/_components/apcupsd.markdown +++ b/source/_components/apcupsd.markdown @@ -11,25 +11,19 @@ logo: apcupsd.png ha_category: Hub --- -[APCUPSd](http://www.apcupsd.org/) status information can be integrated into Home Assistant when the Network Information Server (NIS) [is configured](http://www.apcupsd.org/manual/manual.html#nis-server-client-configuration-using-the-net-driver). +[APCUPSd](http://www.apcupsd.org/) status information can be integrated into Home Assistant when the Network Information Server (NIS) [is configured](http://www.apcupsd.org/manual/manual.html#nis-server-client-configuration-using-the-net-driver) is enabled on the APC device. -Create an `apcupsd` section in your configuration, optionally containing the following parameters: - -- **host**: The hostname/IP address on which the APCUPSd NIS is being served. Default: `localhost` -- **port**: The port on which the APCUPSd NIS is listening. Default: `3551` - -#### Example - -Use defaults: +To enable this sensor, add the following lines to your `configuration.yaml`: ```yaml +# Example configuration.yaml entry apcupsd: + host: IP_ADDRESS + port: PORT ``` -Set parameters: +Configuration variables: + +- **host** (*Optional*): The hostname/IP address on which the APCUPSd NIS is being served. Defaults to `localhost`. +- **port** (*Optional*): The port on which the APCUPSd NIS is listening. Defaults to `3551`. -```yaml -apcupsd: - host: 192.168.1.10 - port: 1234 -``` diff --git a/source/_components/binary_sensor.apcupsd.markdown b/source/_components/binary_sensor.apcupsd.markdown index 7e346559ae0..4d8be1efbd1 100644 --- a/source/_components/binary_sensor.apcupsd.markdown +++ b/source/_components/binary_sensor.apcupsd.markdown @@ -11,12 +11,18 @@ logo: apcupsd.png ha_category: Binary Sensor --- -In addition to the [APCUPSd Sensor](/components/sensor.apcupsd/) devices, you may also create a device which is simply `on` when the UPS status is `ONLINE` and `off` at all other times. +In addition to the [APCUPSd Sensor](/components/sensor.apcupsd/) devices, you may also create a device which is simply "on" when the UPS status is online and "off" at all other times. -#### Example +To enable this sensor, add the following lines to your `configuration.yaml` file for a GET request: ```yaml +# Example configuration.yaml entry binary_sensor: - - name: UPS Online - platform: apcupsd + - platform: apcupsd + name: UPS Online ``` + +Configuration variables: + +- **resource** (*Required*): The resource or endpoint that contains the value. +- **method** (*Optional*): The method of the request. Default is GET. diff --git a/source/_components/binary_sensor.tcp.markdown b/source/_components/binary_sensor.tcp.markdown index e0a081c8829..d7551c044ac 100644 --- a/source/_components/binary_sensor.tcp.markdown +++ b/source/_components/binary_sensor.tcp.markdown @@ -9,6 +9,35 @@ sharing: true footer: true ha_category: Binary Sensor --- -The TCP Binary Sensor is a type of [TCP Sensor](/components/sensor.tcp/) which is either `OFF` or `ON`. In order the use this sensor type, in addition to the configuration for the TCP Sensor, you must supply a `value_on` value to represent what is returned when the device is turned `ON`. -- **value_on** (*Required*): The value returned when the device is `ON`. + +The TCP Binary Sensor is a type of [TCP Sensor](/components/sensor.tcp/) which is either "off" or "on". In order to use this sensor type, in addition to the configuration for the TCP Sensor, you must supply a `value_on` value to represent what is returned when the device is turned on. + +To enable this sensor, add the following lines to your `configuration.yaml`: + +```yaml +sensor: +# Example configuration.yaml entry + - platform: tcp + name: TCP Binary Sensor + host: IP_ADDRESS + port: PORT + payload: "r State\n" + value_on: 1 + timeout: 5 + value_template: "{% raw %}{{ value.split(';')[0] }}{% endraw %}" + unit: UNIT_OF_MEASUREMENT +``` + +Configuration options for the a TCP Sensor: + +- **name** (*Required*): The name you'd like to give the sensor in Home Assistant. +- **host** (*Required*): The hostname/IP address to connect to. +- **port** (*Required*): The port to connect to the host on. +- **payload** (*Required*): What to send to the host in order to get the response we're interested in. +- **value_on** (*Required*): The value returned when the device is "on". +- **timeout** (*Optional*): How long in seconds to wait for a response from the service before giving up and disconnecting. Defaults to 10. +- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract the value. By default it's assumed that the entire response is the value. +- **unit** (*Optional*): The unit of measurement to use for the value. +- **buffer_size** (*Optional*): The size of the receive buffer in bytes. Set this to a larger value if you expect to receive a response larger than the default. Defaults to 1024. + diff --git a/source/_components/sensor.tcp.markdown b/source/_components/sensor.tcp.markdown index 414a092ad11..f702902703c 100644 --- a/source/_components/sensor.tcp.markdown +++ b/source/_components/sensor.tcp.markdown @@ -9,36 +9,55 @@ sharing: true footer: true ha_category: Sensor --- + The TCP component allows the integration of some services for which a specific Home Assistant component does not exist. If the service communicates over a TCP socket with a simple request/reply mechanism then the chances are that this component will allow integration with it. -The configuration options for the a TCP Sensor: +To enable this sensor, add the following lines to your `configuration.yaml`: + +```yaml +sensor: +# Example configuration.yaml entry + - platform: tcp + name: Central Heating Pressure + host: IP_ADDRESS + port: PORT + timeout: 5 + payload: PAYLOAD + value_template: "{% raw %}{{ value.split(';')[0] }}{% endraw %}" + unit: UNIT_OF_MEASUREMENT +``` + +Configuration options for the a TCP Sensor: - **name** (*Required*): The name you'd like to give the sensor in Home Assistant. -- **platform** (*Required*): Set to `tcp`. - **host** (*Required*): The hostname/IP address to connect to. - **port** (*Required*): The port to connect to the host on. - **payload** (*Required*): What to send to the host in order to get the response we're interested in. -- **timeout**: How long in seconds to wait for a response from the service before giving up and disconnecting. Default: `10` -- **value_template**: A Jinja2 template to extract the desired value from the response returned by the server. By default we assume that the entire response is the value. -- **unit**: The unit of measurement to use for the value. -- **buffer_size**: The size of the receive buffer in bytes. Set this to a larger value if you expect to receive a response larger than the default. Default: `1024`. +- **timeout** (*Optional*): How long in seconds to wait for a response from the service before giving up and disconnecting. Defaults to `10` +- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract the value. By default it's assumed that the entire response is the value. +- **unit** (*Optional*): The unit of measurement to use for the value. +- **buffer_size** (*Optional*): The size of the receive buffer in bytes. Set this to a larger value if you expect to receive a response larger than the default. Defaults to `1024`. -#### Example +## {% linkable_title Examples %} -The usage of the TCP component is best explained with an example. The [EBUSd](https://github.com/john30/ebusd/wiki) service enables connection to an EBUS serial bus on some home heating/cooling systems. Using this service it is possible to extract various metrics which may be useful to have within Home Assistant. In order to use EBUSd, you connect to it using a TCP socket and send it a command. The service will respond with the value it has received from EBUS. On the command line, this would look something like: +In this section you find some real life examples of how to use this sensor. + +### {% linkable_title EBUSd %} + +The [EBUSd](https://github.com/john30/ebusd/wiki) service enables connection to an EBUS serial bus on some home heating/cooling systems. Using this service it is possible to extract various metrics which may be useful to have within Home Assistant. In order to use EBUSd, you connect to it using a TCP socket and send it a command. The service will respond with the value it has received from EBUS. On the command line, this would look something like: ```bash $ echo "r WaterPressure" | nc 10.0.0.127 8888 0.903;ok - ``` You will notice that the output from the service is not just a single value (it contains ";ok" as well). To grab the value we're interested in, we can use a Jinja2 template. The response received is injected into the template as the `value` variable. To use this value within Home Assistant, use the following configuration: ```yaml sensor: - - name: Central Heating Pressure - platform: tcp +# Example configuration.yaml entry + - platform: tcp + name: Central Heating Pressure host: 10.0.0.127 port: 8888 timeout: 5 @@ -47,4 +66,3 @@ sensor: unit: Bar ``` -