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: customization.md
+30-23Lines changed: 30 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
# Customizing
2
2
3
-
The hart of this component is the parameter-definition file ex*deye_hybrid.yaml*. By changing the file, the behaviour is totally changed.
3
+
The heart of this component is the parameter-definition file, such as*deye_hybrid.yaml*. By changing the file, the behaviour is totally changed.
4
4
5
5
NOTE:
6
-
In order to leave your customized file intact during upgrades, copy the most relevant yaml file to a file called "custom_parameters.yaml, and set the "lookup_file" option in configuration.yaml to point to it.
6
+
In order to leave your customized file intact during upgrades, copy the most relevant yaml file to a file called `custom_parameters.yaml`, and set the "lookup_file" option in configuration.yaml to point to it (or just select the file in the configuration flow UI).
7
7
8
8
~~~YAML
9
9
sensor:
@@ -35,13 +35,16 @@ requests:
35
35
- start: 0x00f4
36
36
end: 0x00f8
37
37
mb_functioncode: 0x03
38
-
39
38
~~~
40
39
41
40
This block specifies that the component should issue three requests to the logger, the first one requesting parameters 0x0003 up to 0x000E, then a second request for parmeters 0x003B up to 0x0070, and the last for parameters 0x000f4 up to 0x00f8. All of the requests will be sent using Modbus Function Code 0x03.
42
41
42
+
The **maximum number** of registers that can be queried using the protocol **for each request is 125** (see [here](https://github.com/jmccrohan/pysolarmanv5/issues/51#issuecomment-1902238661)), but some loggers may get errors like `CRC validation failed` if the length is too much; in that case, reduce the length (`end-start`) by doing multiple requests.
43
+
44
+
If you get `V5FrameError: V5 frame contains invalid sequence number` errors in the log, it might be caused by concurrency (i.e. more than one client connected to the same logger stick).
45
+
43
46
## 2. Parameters
44
-
This section defines the induvidual parameter definitions. For example:
47
+
This section defines the individual parameter definitions: each parameter creates one sensor in Home Assistant. For example:
45
48
46
49
~~~ YAML
47
50
parameters:
@@ -57,33 +60,36 @@ parameters:
57
60
icon: 'mdi:solar-power'
58
61
~~~
59
62
60
-
### group
63
+
The register must be included in the requests of the previous point, otherwise the sensor will have an `Unknown` value in Home Assistant.
64
+
65
+
Pay attention to the registers order when more than one are required; it could be descending when 2 registers are joint together or not, depending on the inverter.
66
+
67
+
### Group
61
68
The group just groups parameters that belong together. The induvidual parameter-items has to be placed in a group. The *items* parameters contains the parameter definitions that belong in the group.
62
69
63
70
### Parameter-item
64
71
65
72
66
-
|field||description|
73
+
|Field||Description|
67
74
|-|-|-|
68
75
|name||The *name* field of the home-assistant entity #|
69
76
|class||The *class* field of the home-assistant entity #|
70
-
|state_class||The *state_class* field of the homeassistant entity ##|
77
+
|state_class||The *state_class* field of the home-assistant entity ##|
71
78
|uom||The *unit_of_measurement* field of the home-assistant entity #|
72
79
|icon||The *icon* field of the home-assistant entity #|
73
80
|| **The fields below define how the value from the logger is parsed** |
74
-
|scale||Scaling factor for the value read from the logger|
75
-
|rule||Method to interpret the data from the logger ###|
76
-
|mask||A mask to filter only used bit fields. This is especialy useful for flag fields|
77
-
|registers||Array of register fields that comprises the value. If the value is placed in a number of registers, this array will contain more than one item.|
81
+
|scale||Scaling factor for the value read from the logger (default: 1)|
82
+
|rule||Method to interpret the data from the logger (see the table below)|
83
+
|mask||A mask to filter only used bit fields; this is especialy useful for flag fields|
84
+
|registers||Array of register fields that comprises the value; if the value is placed in a number of registers, this array will contain more than one item (note: order is important)|
78
85
|lookup||Defines a key-value pair for values where an integer maps to a string field|
79
-
||**The following is optional and could be used, if the inverter delivers sometimes nonusable data (e.g. Total Production == 0.0)**|
86
+
||**The following is optional and could be used, if the inverter delivers sometimes non-usable data (e.g. Total Production == 0.0)**|
80
87
|validation| ||
81
88
||min|Spefifies the minimum value to accept|
82
89
||max|Specifies the maximum value to accept|
83
-
||invalidate_all| Optional: invalidate complete dataset if specified. If not specified, it will only invalidate the specific parameter|
84
-
90
+
||invalidate_all| Optional: invalidate the complete dataset if specified; if not specified, it will only invalidate the specific parameter|
85
91
86
-
Example yaml file for the example mentioned above:
92
+
Example yaml file for the mentioned above:
87
93
88
94
~~~ YAML
89
95
- name: "Total Production"
@@ -103,17 +109,18 @@ Example yaml file for the example mentioned above:
103
109
104
110
\## see https://developers.home-assistant.io/docs/core/entity/sensor/#entities-representing-a-total-amount
105
111
106
-
### The rule field specifies how to interpret the binary data.
112
+
### Rule
113
+
The `rule` field specifies how to interpret the binary data contained in the register(s).
| 9 | Time | Time value as string<ul><li>Example 1: Register Value 2200 => Time Value: 22:00</li><li>Example 2: Register value: 400 => 04:00</li></ul>|
125
+
| 9 | Time | Time value as string<ul><li>Example 1: Register Value 2200 => Time Value: 22:00</li><li>Example 2: Register value: 400 => 04:00</li></ul>|
0 commit comments