From 9a86824a7cf390d79ab7174a71dec7b41b390965 Mon Sep 17 00:00:00 2001 From: jan iversen Date: Sun, 4 Apr 2021 19:42:44 +0200 Subject: [PATCH] Modbus service (#17250) Co-authored-by: Martin Hjelmare --- source/_integrations/modbus.markdown | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/source/_integrations/modbus.markdown b/source/_integrations/modbus.markdown index 5d9e7f06b9e..0c452af1bed 100644 --- a/source/_integrations/modbus.markdown +++ b/source/_integrations/modbus.markdown @@ -296,7 +296,9 @@ climates: default: C {% endconfiguration %} -#### Services +## Services + +### Service `modbus.set-temperature` | Service | Description | | ------- | ----------- | @@ -756,14 +758,13 @@ modbus: name: hub2 ``` -### Services - +### Service `modbus.write_register` | Service | Description | | ------- | ----------- | | write_register | Write register. Requires `hub`, `unit`, `address` and `value` fields. `value` can be either single value or an array | -#### Service Data Attributes +Description: | Attribute | Description | | --------- | ----------- | @@ -772,6 +773,22 @@ modbus: | address | Address of the Register (e.g., 138) | | value | A single value or an array of 16-bit values. Single value will call modbus function code 6. Array will call modbus function code 16. Array might need reverse ordering. E.g., to set 0x0004 you might need to set `[4,0]` | +### Service `modbus.write_coil` + +| Service | Description | +| ------- | ----------- | +| write_coil | Write coil. Requires `hub`, `unit`, `address` and `state` fields. `state` can be either single bolean or an array | + +Description: + +| Attribute | Description | +| --------- | ----------- | +| hub | Hub name (defaults to 'default' when omitted) | +| unit | Slave address (1-255, mostly 255 if you talk to Modbus via TCP) | +| address | Address of the Register (e.g., 138) | +| state | A single boolean or an array of booleans. Single boolean will call modbus function code 6. Array will call modbus function code 16. +.. + ## Log warning (v1.0.8 and onwards) Pymodbus (which is the implementation library) was updated and issues a warning: