Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions source/_integrations/modbus.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ha_platforms:
- cover
- sensor
- switch
- fan
---

[Modbus](http://www.modbus.org/) is a serial communication protocol to control PLCs (Programmable Logic Controller).
Expand All @@ -31,6 +32,7 @@ Platforms:
- cover
- sensor
- switch
- fan

are all defined as part of the modbus configuration. The old configuration style, (having each outside the modbus configuration is still supported, but will cause a warning, and will be removed in a later release).

Expand Down Expand Up @@ -738,6 +740,124 @@ modbus:
address: 14
```

### Configuring platform fan

The `modbus` fan platform allows you to control [Modbus](http://www.modbus.org/)-enabled fans. We support two types of Modbus fans — coil-based and register-based.

To use your Modbus fans in your installation, add the following to your `configuration.yaml` file:

```yaml
# Example configuration.yaml entry
modbus:
- type: tcp
host: IP_ADDRESS
port: 502
fans:
- name: Fan1
address: 13
write_type: coil
- name: Fan2
slave: 2
address: 14
write_type: coil
verify:
- name: Register1
address: 11
command_on: 1
command_off: 0
verify:
input_type: holding
address: 127
state_on: 25
state_off: 1
```

{% configuration %}
fans:
description: The array contains a list of all your Modbus fans.
required: true
type: map
keys:
address:
description: Coil number or register
required: true
type: integer
command_on:
description: Value to write to turn on the fan.
required: false
default: 0x01
type: integer
command_off:
description: Value to write to turn off the fan.
required: false
default: 0x00
type: integer
write_type:
description: type of adddress (holding/coil)
required: false
default: holding
type: integer
name:
description: Name of the fan.
required: true
type: string
scan_interval:
description: Defines the update interval of the sensor in seconds.
required: false
type: integer
default: 15
slave:
description: The number of the slave (can be omitted for tcp and udp Modbus).
required: false
type: integer
default: 0
verify:
description: read from modbus device to verify fan.
required: false
type: map
keys:
address:
description: address to read from.
required: false
default: write address
type: integer
input_type:
description: type of adddress (holding/coil/discrete/input)
required: false
default: write_type
type: integer
state_on:
description: value when fan is on.
required: false
default: same as command_on
type: integer
state_off:
description: value when fan is off.
required: false
default: same as command_off
type: integer
{% endconfiguration %}

#### Full example

Example fans, for which the state is not polled.

```yaml
modbus:
- name: hub1
type: tcp
host: IP_ADDRESS
port: 502
switches:
- name: Fan1
slave: 1
address: 13
input_type: coil
- name: Fan2
slave: 2
address: 14
```

#### Multiple connections

Multiple connections are possible, add something like the following to your `configuration.yaml` file:
Expand Down