You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,7 @@ update_rate: 5
55
55
address_offset: 0
56
56
variant: sungrow
57
57
scan_batching: 100
58
+
word_order: highlow
58
59
```
59
60
| Field name | Required | Default | Description |
60
61
| ---------- | -------- | ------- | ----------- |
@@ -64,6 +65,7 @@ scan_batching: 100
64
65
| address_offset | Optional | 0 | This offset is applied to every register address to accommodate different Modbus addressing systems. In many Modbus devices the first register is enumerated as 1, other times 0. See section 4.4 of the Modbus spec. |
65
66
| variant | Optional | N/A | Allows variants of the ModbusTcpClient library to be used. Setting this to 'sungrow' enables support of SungrowModbusTcpClient. This library transparently decrypts the modbus comms with sungrow SH inverters running newer firmware versions. |
66
67
| scan_batching | Optional | 100 | Must be between 1 and 100 inclusive. Modbus read operations are more efficient in bigger batches of contiguous registers, but different devices have different limits on the size of the batched reads. This setting can also be helpful when building a modbus register map for an uncharted device. In some modbus devices a single invalid register in a read range will fail the entire read operation. By setting `scan_batching` to `1` each register will be scanned individually. This will be very inefficient and should not be used in production as it will saturate the link with many read operations. |
68
+
| word_order | Optional | 'highlow' | Must be either `highlow` or `lowhigh`. This determines how multi-word values are interpreted. `highlow` means a 32-bit number at address 1 will have its high two bytes stored in register 1, and its low two bytes stored in register 2. The default is typically correct, as modbus has a big-endian memory structure, but this is not universal. |
67
69
68
70
### Register settings
69
71
```yaml
@@ -97,6 +99,9 @@ registers:
97
99
- pub_topic: "external_temperature"
98
100
address: 13015
99
101
type: int16
102
+
- pub_topic: "minutes_online"
103
+
address: 13016
104
+
type: uint32
100
105
```
101
106
102
107
This section of the YAML lists all the modbus registers that you consider interesting.
@@ -113,4 +118,4 @@ This section of the YAML lists all the modbus registers that you consider intere
113
118
| scale | Optional | 1 | After reading a value from the Modbus register it will be multiplied by this scalar before being published to MQTT. Values published on this register's `set_topic` will be divided by this scalar before being written to Modbus. |
114
119
| mask | Optional | 0xFFFF | This is a 16-bit number that can be used to select a part of a Modbus register to be referenced by this register. For example a mask of `0xFF00` will map to the most significant byte of the 16-bit Modbus register at `address`. A mask of `0x0001` will reference only the least significant bit of this register. |
115
120
| json_key | Optional | N/A | The value of this register will be published to its pub_topic in JSON format. E.G. `{ key: value }` Registers with a json_key specified can share a pub_topic. All registers with shared pub_topics must have a json_key specified. In this way, multiple registers can be published to the same topic in a single JSON message. If any of the registers that share a pub_topic have the retain field set that will affect the published JSON message. Conflicting retain settings are invalid. The keys will be alphabetically sorted. |
116
-
| type | Optional | uint16 | The type of the value stored at the modbus address provided. Only uint16 (unsigned 16-bit integer) and int16 (signed 16-bit integer) are currently supported. |
121
+
| type | Optional | uint16 | The type of the value stored at the modbus address provided. Only uint16 (unsigned 16-bit integer), int16 (signed 16-bit integer), uint32, int32, uint64 and int64 are currently supported. |
- pub_topic: "energy_meter_power"# Feed-in power is negative and taken-back power is positive (W)
9
+
address: 5082
10
+
table: 'input'
11
+
type: int32
12
+
- pub_topic: "output_power"#total output power kWh
13
+
type: uint16
14
+
address: 5000
15
+
table: 'input'
16
+
scale: 0.1
17
+
- pub_topic: "daily_yield"#daily yield kWh
18
+
address: 5002
19
+
table: 'input'
20
+
scale: 0.1
21
+
- pub_topic: "total_yield"#Total yield kWh
22
+
address: 5003
23
+
table: 'input'
24
+
- pub_topic: "total_running_time"#Total running time (h)
25
+
address: 5005
26
+
table: 'input'
27
+
- pub_topic: "internal_temperature"#inverter internal temperature 0.1C
28
+
address: 5007
29
+
table: 'input'
30
+
scale: 0.1
31
+
- pub_topic: "dc_output"#dc output power (W)
32
+
address: 5016
33
+
table: 'input'
34
+
- pub_topic: "phase_a_voltage"#Phase A Voltage (0.1V)
35
+
address: 5018
36
+
table: 'input'
37
+
scale: 0.1
38
+
- pub_topic: "phase_a_current"#Phase A Current (0.1A)
39
+
address: 5021
40
+
table: 'input'
41
+
scale: 0.1
42
+
- pub_topic: "ac_output"#AC output power, total active power (W)
43
+
address: 5030
44
+
table: 'input'
45
+
- pub_topic: "power_factor"#Power factor (0.001)
46
+
address: 5034
47
+
table: 'input'
48
+
scale: 0.001
49
+
- pub_topic: "grid_frequency"#Grid Frequency (0.1Hz)
50
+
address: 5035
51
+
table: 'input'
52
+
scale: 0.1
53
+
- pub_topic: "device_state"#Device State (see comments below for states)
54
+
address: 5037
55
+
table: 'input'
56
+
- pub_topic: "daily_running_time"#Daily running time (1m)
57
+
address: 5112
58
+
table: 'input'
59
+
60
+
#see https://github.com/tjhowse/modbus4mqtt/files/5732710/TI_20190704_Communication.Protocol.for.Residential.Single-phase.Grid-Connected.Inverters_V10_EN.pdf for full list of registers and details
0 commit comments