mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-13 20:36:52 +00:00
New modbus switch. (#17516)
This commit is contained in:
parent
c58ce45323
commit
9736614db8
@ -647,22 +647,27 @@ To use your Modbus switches in your installation, add the following to your `con
|
|||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
modbus:
|
modbus:
|
||||||
- name: hub1
|
- type: tcp
|
||||||
type: tcp
|
|
||||||
host: IP_ADDRESS
|
host: IP_ADDRESS
|
||||||
port: 502
|
port: 502
|
||||||
switches:
|
switches:
|
||||||
- name: Switch1
|
- name: Switch1
|
||||||
address: 13
|
address: 13
|
||||||
input_type: coil
|
write_type: coil
|
||||||
- name: Switch2
|
- name: Switch2
|
||||||
slave: 2
|
slave: 2
|
||||||
address: 14
|
address: 14
|
||||||
input_type: coil
|
write_type: coil
|
||||||
|
verify:
|
||||||
- name: Register1
|
- name: Register1
|
||||||
address: 11
|
address: 11
|
||||||
command_on: 1
|
command_on: 1
|
||||||
command_off: 0
|
command_off: 0
|
||||||
|
verify:
|
||||||
|
input_type: holding
|
||||||
|
address: 127
|
||||||
|
state_on: 25
|
||||||
|
state_off: 1
|
||||||
```
|
```
|
||||||
|
|
||||||
{% configuration %}
|
{% configuration %}
|
||||||
@ -677,14 +682,16 @@ switches:
|
|||||||
type: integer
|
type: integer
|
||||||
command_on:
|
command_on:
|
||||||
description: Value to write to turn on the switch.
|
description: Value to write to turn on the switch.
|
||||||
required: true
|
required: false
|
||||||
|
default: 0x01
|
||||||
type: integer
|
type: integer
|
||||||
command_off:
|
command_off:
|
||||||
description: Value to write to turn off the switch.
|
description: Value to write to turn off the switch.
|
||||||
required: true
|
required: false
|
||||||
|
default: 0x00
|
||||||
type: integer
|
type: integer
|
||||||
input_type:
|
write_type:
|
||||||
description: type of adddress (holding/input/coil)
|
description: type of adddress (holding/coil)
|
||||||
required: false
|
required: false
|
||||||
default: holding
|
default: holding
|
||||||
type: string
|
type: string
|
||||||
@ -699,33 +706,39 @@ switches:
|
|||||||
default: 15
|
default: 15
|
||||||
slave:
|
slave:
|
||||||
description: The number of the slave (can be omitted for tcp and udp Modbus).
|
description: The number of the slave (can be omitted for tcp and udp Modbus).
|
||||||
required: true
|
required: false
|
||||||
type: integer
|
type: integer
|
||||||
state_on:
|
default: 0
|
||||||
description: Register value when switch is on.
|
verify:
|
||||||
|
description: read from modbus device to verify switch.
|
||||||
required: false
|
required: false
|
||||||
default: same as command_on
|
type: map
|
||||||
type: integer
|
keys:
|
||||||
state_off:
|
address:
|
||||||
description: Register value when switch is off.
|
description: address to read from.
|
||||||
required: false
|
required: false
|
||||||
default: same as command_off
|
default: write address
|
||||||
type: integer
|
type: integer
|
||||||
verify_register:
|
input_type:
|
||||||
description: Register to readback.
|
description: type of adddress (holding/coil/discrete/input)
|
||||||
required: false
|
required: false
|
||||||
default: same as register
|
default: write_type
|
||||||
type: string
|
type: integer
|
||||||
verify_state:
|
state_on:
|
||||||
description: Define if is possible to readback the status of the switch.
|
description: value when switch is on.
|
||||||
required: false
|
required: false
|
||||||
default: true
|
default: same as command_on
|
||||||
type: boolean
|
type: integer
|
||||||
|
state_off:
|
||||||
|
description: value when switch is off.
|
||||||
|
required: false
|
||||||
|
default: same as command_off
|
||||||
|
type: integer
|
||||||
{% endconfiguration %}
|
{% endconfiguration %}
|
||||||
|
|
||||||
#### Full example
|
#### Full example
|
||||||
|
|
||||||
Example switches, for which the state is polled from Modbus every 15 seconds (default).
|
Example switches, for which the state is not polled.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
modbus:
|
modbus:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user