mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-06-04 17:26:50 +00:00
52 lines
1.4 KiB
Markdown
52 lines
1.4 KiB
Markdown
---
|
|
layout: page
|
|
title: "Modbus Switch"
|
|
description: "Instructions how to integrate Modbus switches into Home Assistant."
|
|
date: 2015-08-30 23:38
|
|
sidebar: true
|
|
comments: false
|
|
sharing: true
|
|
footer: true
|
|
logo: modbus.png
|
|
ha_category: Switch
|
|
ha_release: pre 0.7
|
|
---
|
|
|
|
|
|
The `modbus` switch platform allows you to control [Modbus](http://www.modbus.org/) switches.
|
|
|
|
To use your Modbus switches in your installation, add the following to your `configuration.yaml` file:
|
|
|
|
```yaml
|
|
# Example configuration.yml entry
|
|
switch:
|
|
platform: modbus
|
|
slave: 1
|
|
registers:
|
|
24:
|
|
bits:
|
|
0:
|
|
name: My switch
|
|
2:
|
|
name: My other switch
|
|
coils:
|
|
0:
|
|
name: My coil switch
|
|
```
|
|
|
|
Configuration variables:
|
|
|
|
- **slave** (*Required*): The number of the slave (ignored and can be omitted if not serial Modbus).
|
|
- **registers** array (*Required*): The array contains a list of relevant registers to read from.
|
|
- **number of register** (*Required*): Listing relevant bits. It must contain a `bits` section.
|
|
- **bits** array (*Required*): Listing relevant bits. It must contain a `bits` section.
|
|
- **name** (*Required*): Name of the switch.
|
|
- **coils** (*Optional*): A list of relevant coils to read from/write to
|
|
- **number of coil** array (*Required*):
|
|
- **name** (*Required*): Name of the coil.
|
|
|
|
<p class='note warning'>
|
|
Each named bit will create a switch.
|
|
</p>
|
|
|