Add custom data type support for Modbus climate (#12250)

This commit is contained in:
Vladimír Záhradník 2020-10-21 00:06:03 +02:00 committed by GitHub
parent 336dbea330
commit 2084f50da8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 21 deletions

View File

@ -17,10 +17,14 @@ To use your Modbus thermostat in your installation, add the following to your `c
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
climate: modbus:
- platform: modbus - name: hub1
name: Watlow F4T type: tcp
hub: hub1 host: IP_ADDRESS
port: 502
climates:
- name: Watlow F4T
slave: 1 slave: 1
data_type: uint data_type: uint
data_count: 1 data_count: 1
@ -39,11 +43,6 @@ name:
description: Name of the device description: Name of the device
required: true required: true
type: string type: string
hub:
description: The name of the hub.
required: false
default: default
type: string
slave: slave:
description: The number of the slave (Optional for tcp and upd Modbus, use 1). description: The number of the slave (Optional for tcp and upd Modbus, use 1).
required: true required: true
@ -66,6 +65,11 @@ data_type:
required: false required: false
type: string type: string
default: float default: float
structure:
description: "If `data_type` is custom specified a double-quoted Python struct is expected here, to format the string to unpack the value. See Python documentation for details. Example: `>i`."
required: false
type: string
default: ">f"
data_count: data_count:
description: Number of registers to read. description: Number of registers to read.
required: false required: false
@ -106,6 +110,11 @@ temperature_unit:
required: false required: false
type: string type: string
default: C default: C
scan_interval:
description: Defines the update interval of the sensor in seconds.
required: false
type: integer
default: 15
{% endconfiguration %} {% endconfiguration %}

View File

@ -109,7 +109,7 @@ registers:
default: int default: int
type: string type: string
structure: structure:
description: "If data_type is custom specify here a double quoted Python struct format string to unpack the value. See Python documentation for details. Ex: >i." description: "If `data_type` is custom specified a double-quoted Python struct is expected here, to format the string to unpack the value. See Python documentation for details. Example: `>i`."
required: false required: false
type: string type: string
{% endconfiguration %} {% endconfiguration %}