From 916c906b4e4c92856a22befee0e6977e0acd8698 Mon Sep 17 00:00:00 2001 From: Jorim Tielemans Date: Wed, 17 Oct 2018 23:29:21 +0200 Subject: [PATCH] Update modbus.markdown (#6910) - Organize connection types - List the allowed values --- source/_components/modbus.markdown | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/source/_components/modbus.markdown b/source/_components/modbus.markdown index 402cef31af2..75581a49746 100644 --- a/source/_components/modbus.markdown +++ b/source/_components/modbus.markdown @@ -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 %} -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 # Example configuration.yaml entry for a TCP connection @@ -40,7 +43,7 @@ host: required: true type: string port: - description: The port for the communication. + description: The network port for the communication. required: true type: integer timeout: @@ -50,7 +53,9 @@ timeout: type: integer {% endconfiguration %} -For a serial connection: +### {% linkable_title Serial connection %} + +For a serial connection, add the following to your `configuration.yaml` file: ```yaml # Example configuration.yaml entry for a serial connection @@ -66,11 +71,11 @@ modbus: {% configuration %} type: - description: Type of the connection to Modbus. + description: "Type of the connection to Modbus, needs to be `serial` for this setup." required: true type: string method: - description: Method of the connection to Modbus. + description: "Method of the connection to Modbus, either `rtu` or `ascii`." required: true type: string port: @@ -82,15 +87,15 @@ baudrate: required: true type: integer stopbits: - description: The stopbits for the serial connection. + description: "The stopbits for the serial connection, either `1` or `2`." required: true type: integer bytesize: - description: The bytesize for the serial connection. + description: "The bytesize for the serial connection; can be `5`, `6`, `7` or `8`." required: true type: integer parity: - description: The parity for the serial connection. + description: "The parity for the serial connection; can be `E`, `O` or `N`." required: true type: string timeout: