Update modbus.markdown (#6910)

- Organize connection types
- List the allowed values
This commit is contained in:
Jorim Tielemans 2018-10-17 23:29:21 +02:00 committed by Fabian Affolter
parent 29bbbf64e7
commit 916c906b4e

View File

@ -14,13 +14,16 @@ ha_iot_class: "Local Push"
--- ---
[Modbus](http://www.modbus.org/) is a serial communication protocol to control PLCs (Programmable logic controller). It currently supports sensors and switches which can be controlled over serial, TCP, and UDP connections. [Modbus](http://www.modbus.org/) is a serial communication protocol to control PLCs (Programmable logic controller).
It currently supports sensors and switches which can be controlled over serial, TCP, and UDP connections.
## {% linkable_title Configuration %} ## {% linkable_title Configuration %}
To add modbus to your installation, add the following to your `configuration.yaml` file: The configuration for adding modbus to your installation depends on the connection type, either a network or serial connection.
For a network connection: ### {% linkable_title Network connection %}
For a network connection, add the following to your `configuration.yaml` file:
```yaml ```yaml
# Example configuration.yaml entry for a TCP connection # Example configuration.yaml entry for a TCP connection
@ -40,7 +43,7 @@ host:
required: true required: true
type: string type: string
port: port:
description: The port for the communication. description: The network port for the communication.
required: true required: true
type: integer type: integer
timeout: timeout:
@ -50,7 +53,9 @@ timeout:
type: integer type: integer
{% endconfiguration %} {% endconfiguration %}
For a serial connection: ### {% linkable_title Serial connection %}
For a serial connection, add the following to your `configuration.yaml` file:
```yaml ```yaml
# Example configuration.yaml entry for a serial connection # Example configuration.yaml entry for a serial connection
@ -66,11 +71,11 @@ modbus:
{% configuration %} {% configuration %}
type: type:
description: Type of the connection to Modbus. description: "Type of the connection to Modbus, needs to be `serial` for this setup."
required: true required: true
type: string type: string
method: method:
description: Method of the connection to Modbus. description: "Method of the connection to Modbus, either `rtu` or `ascii`."
required: true required: true
type: string type: string
port: port:
@ -82,15 +87,15 @@ baudrate:
required: true required: true
type: integer type: integer
stopbits: stopbits:
description: The stopbits for the serial connection. description: "The stopbits for the serial connection, either `1` or `2`."
required: true required: true
type: integer type: integer
bytesize: bytesize:
description: The bytesize for the serial connection. description: "The bytesize for the serial connection; can be `5`, `6`, `7` or `8`."
required: true required: true
type: integer type: integer
parity: parity:
description: The parity for the serial connection. description: "The parity for the serial connection; can be `E`, `O` or `N`."
required: true required: true
type: string type: string
timeout: timeout: