indevolt-modbus 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- indevolt_modbus-0.1.0/.github/CODEOWNERS +1 -0
- indevolt_modbus-0.1.0/.github/renovate.json +47 -0
- indevolt_modbus-0.1.0/.github/workflows/ci.yml +43 -0
- indevolt_modbus-0.1.0/.github/workflows/publish.yml +47 -0
- indevolt_modbus-0.1.0/.gitignore +10 -0
- indevolt_modbus-0.1.0/LICENSE +202 -0
- indevolt_modbus-0.1.0/PKG-INFO +182 -0
- indevolt_modbus-0.1.0/README.md +165 -0
- indevolt_modbus-0.1.0/RELEASING.md +88 -0
- indevolt_modbus-0.1.0/docs/modeling.md +41 -0
- indevolt_modbus-0.1.0/docs/registers.json +6618 -0
- indevolt_modbus-0.1.0/docs/sources.json +5 -0
- indevolt_modbus-0.1.0/pyproject.toml +63 -0
- indevolt_modbus-0.1.0/script/generate.py +119 -0
- indevolt_modbus-0.1.0/script/query.py +47 -0
- indevolt_modbus-0.1.0/script/set_version.py +23 -0
- indevolt_modbus-0.1.0/src/indevolt_modbus/__init__.py +7 -0
- indevolt_modbus-0.1.0/src/indevolt_modbus/components.py +1503 -0
- indevolt_modbus-0.1.0/src/indevolt_modbus/device.py +126 -0
- indevolt_modbus-0.1.0/src/indevolt_modbus/enums.py +535 -0
- indevolt_modbus-0.1.0/src/indevolt_modbus/model.py +29 -0
- indevolt_modbus-0.1.0/src/indevolt_modbus/py.typed +0 -0
- indevolt_modbus-0.1.0/src/indevolt_modbus/registers.py +4764 -0
- indevolt_modbus-0.1.0/src/indevolt_modbus/transport.py +33 -0
- indevolt_modbus-0.1.0/src/indevolt_modbus/validation.py +56 -0
- indevolt_modbus-0.1.0/tests/test_device.py +296 -0
- indevolt_modbus-0.1.0/tests/test_transport.py +58 -0
- indevolt_modbus-0.1.0/uv.lock +456 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* @eliaslecomte
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
+
"description": "Renovate configuration for indevolt-modbus",
|
|
4
|
+
"dependencyDashboard": false,
|
|
5
|
+
"extends": [
|
|
6
|
+
"config:recommended",
|
|
7
|
+
":separateMajorReleases",
|
|
8
|
+
":combinePatchMinorReleases",
|
|
9
|
+
"helpers:pinGitHubActionDigests"
|
|
10
|
+
],
|
|
11
|
+
"rebaseWhen": "conflicted",
|
|
12
|
+
"ignorePaths": [
|
|
13
|
+
"**/node_modules/**"
|
|
14
|
+
],
|
|
15
|
+
"github-actions": {
|
|
16
|
+
"enabled": true
|
|
17
|
+
},
|
|
18
|
+
"lockFileMaintenance": {
|
|
19
|
+
"enabled": true,
|
|
20
|
+
"schedule": [
|
|
21
|
+
"before 5am on monday"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"packageRules": [
|
|
25
|
+
{
|
|
26
|
+
"matchManagers": [
|
|
27
|
+
"github-actions"
|
|
28
|
+
],
|
|
29
|
+
"groupName": "GitHub Actions",
|
|
30
|
+
"minimumReleaseAge": "3 days"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"matchDepTypes": [
|
|
34
|
+
"dev",
|
|
35
|
+
"test"
|
|
36
|
+
],
|
|
37
|
+
"groupName": "Dev & Test Dependencies",
|
|
38
|
+
"minimumReleaseAge": "3 days"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"matchPackageNames": [
|
|
42
|
+
"modbus-connection"
|
|
43
|
+
],
|
|
44
|
+
"groupName": "Core Protocol Dependencies"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
lint:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
17
|
+
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
|
|
18
|
+
- name: Install dependencies
|
|
19
|
+
run: uv sync --locked
|
|
20
|
+
- name: Ruff format
|
|
21
|
+
run: uv run ruff format --check .
|
|
22
|
+
- name: Ruff lint
|
|
23
|
+
run: uv run ruff check .
|
|
24
|
+
- name: Mypy
|
|
25
|
+
run: uv run mypy
|
|
26
|
+
|
|
27
|
+
test:
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
31
|
+
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
|
|
32
|
+
- name: Install dependencies
|
|
33
|
+
run: uv sync --locked
|
|
34
|
+
- name: Run tests
|
|
35
|
+
run: uv run pytest
|
|
36
|
+
|
|
37
|
+
package:
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
41
|
+
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
|
|
42
|
+
- run: uv build
|
|
43
|
+
- run: uvx twine check --strict dist/*
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
tag:
|
|
9
|
+
description: Existing release tag to build and publish (e.g. 4.0.1)
|
|
10
|
+
required: true
|
|
11
|
+
type: string
|
|
12
|
+
|
|
13
|
+
env:
|
|
14
|
+
RELEASE_TAG: ${{ inputs.tag || github.event.release.tag_name }}
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
build:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
permissions:
|
|
20
|
+
contents: read
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
23
|
+
with:
|
|
24
|
+
ref: ${{ env.RELEASE_TAG }}
|
|
25
|
+
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
|
|
26
|
+
- name: Set package version from validated release tag
|
|
27
|
+
run: uv run --no-project script/set_version.py "$RELEASE_TAG"
|
|
28
|
+
- run: uv build
|
|
29
|
+
- name: Validate distribution metadata and README
|
|
30
|
+
run: uvx twine check --strict dist/*
|
|
31
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
|
|
32
|
+
with:
|
|
33
|
+
name: dist
|
|
34
|
+
path: dist/
|
|
35
|
+
|
|
36
|
+
publish:
|
|
37
|
+
needs: build
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
environment: pypi
|
|
40
|
+
permissions:
|
|
41
|
+
id-token: write
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
|
|
44
|
+
with:
|
|
45
|
+
name: dist
|
|
46
|
+
path: dist/
|
|
47
|
+
- uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2025 William Swann
|
|
190
|
+
Copyright 2026 darkrain-nl
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: indevolt-modbus
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Read and control Indevolt energy storage devices over Modbus.
|
|
5
|
+
Project-URL: Homepage, https://github.com/eliaslecomte/indevolt-modbus
|
|
6
|
+
Project-URL: Repository, https://github.com/eliaslecomte/indevolt-modbus
|
|
7
|
+
Project-URL: Issues, https://github.com/eliaslecomte/indevolt-modbus/issues
|
|
8
|
+
Author: indevolt-modbus contributors
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: indevolt,inverter,modbus,solar
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Home Automation
|
|
14
|
+
Requires-Python: >=3.12
|
|
15
|
+
Requires-Dist: modbus-connection[tmodbus]>=4.12.4
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# indevolt-modbus
|
|
19
|
+
|
|
20
|
+
A standalone, typed Python library for reading and controlling Indevolt energy
|
|
21
|
+
storage devices over Modbus. The caller supplies a `modbus_connection.ModbusUnit`
|
|
22
|
+
and owns the connection. Functional subsystems use `Component` fields, and
|
|
23
|
+
`IndevoltDevice` combines them with partial-failure reporting.
|
|
24
|
+
|
|
25
|
+
Repository: [eliaslecomte/indevolt-modbus](https://github.com/eliaslecomte/indevolt-modbus).
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
Requires Python 3.12 or newer. From this checkout:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
pip install .
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The package is not yet published. The release workflow builds a versioned wheel
|
|
36
|
+
and source archive and publishes them through PyPI Trusted Publishing.
|
|
37
|
+
|
|
38
|
+
## Read a device
|
|
39
|
+
|
|
40
|
+
Enable Modbus server mode in the Indevolt app. The documented TCP defaults are
|
|
41
|
+
port **8899** and unit **1**. The vendor currently describes physical RTU support
|
|
42
|
+
as forthcoming; the library accepts a serial unit but hardware support must be
|
|
43
|
+
confirmed for the installed firmware.
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from indevolt_modbus import IndevoltDevice
|
|
47
|
+
|
|
48
|
+
# unit comes from your modbus-connection backend/connection.
|
|
49
|
+
device = await IndevoltDevice.async_detect(unit)
|
|
50
|
+
report = await device.async_update(["inverter_real_time_data"])
|
|
51
|
+
for register in device.registers:
|
|
52
|
+
if register.component in report.updated:
|
|
53
|
+
print(register.name, device.value(register), register.unit)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Use typed subsystem attributes directly, for example
|
|
57
|
+
`device.system_info.modbus_version_7534`. Other subsystem classes are exported
|
|
58
|
+
from `indevolt_modbus.components`. `device.components` exposes the active models;
|
|
59
|
+
`REGISTERS` describes their public attributes. Values are `None` before a read
|
|
60
|
+
or when a known enumeration receives an unknown code.
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
uv sync
|
|
64
|
+
uv run script/query.py 192.168.1.50 --port 8899 --unit 1 --component inverter_real_time_data
|
|
65
|
+
uv run script/query.py 192.168.1.50 --port 8899 --raw --component system_info
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Raw output contains unredacted device data. A full poll can take several minutes:
|
|
69
|
+
the library requests five seconds of spacing around Modbus messages, following
|
|
70
|
+
the vendor recommendation. Select the components you need. An explicit
|
|
71
|
+
`message_spacing` of at least one second is supported for bench testing.
|
|
72
|
+
|
|
73
|
+
## Writes
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
register = next(r for r in device.registers if r.address == 1142)
|
|
77
|
+
await device.async_write(register, 20) # Backup SoC, percent
|
|
78
|
+
await device.async_update([register.component]) # Read back actual state
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Read-only fields reject writes. Numeric values must be finite integers within
|
|
82
|
+
the documented range, or the wire type's range where no narrower limit is
|
|
83
|
+
published. Packed dates/times are validated. Enumerations and protocol-version
|
|
84
|
+
gates are enforced by `async_write`. Power commands at 1151 and in schedule
|
|
85
|
+
slots use the single-unit 3600 W limit; parallel-system overrides are not exposed.
|
|
86
|
+
Direct component writes enforce field validation but callers should use
|
|
87
|
+
`async_write` for protocol-version-dependent enumeration restrictions.
|
|
88
|
+
|
|
89
|
+
## Register coverage and source decisions
|
|
90
|
+
|
|
91
|
+
[Register catalog](docs/registers.json) records all 194 explicit source rows,
|
|
92
|
+
plus the documented intervening load-profile and schedule points (350 entries).
|
|
93
|
+
344 numeric fields are implemented. Six serial fields remain catalog-only:
|
|
94
|
+
the source does not specify their length. No serial length or product identity
|
|
95
|
+
is guessed. Alarm words remain raw 32-bit integers because the source's `Value`
|
|
96
|
+
column does not state its bit-index convention. Multiword values use big-endian
|
|
97
|
+
word order, pending a real-device capture. The source does not specify a word
|
|
98
|
+
swap. Scales, signedness and zero-based addresses are used as published.
|
|
99
|
+
|
|
100
|
+
Register 7592 is labeled “Grid voltage” but has Hz units and a 0.01 scale; its
|
|
101
|
+
catalog label is preserved. The power-factor unit `Pct` and 0.001 scale are also
|
|
102
|
+
preserved, without assuming percent versus ratio. Capacity register 89 is not
|
|
103
|
+
an accumulated-energy counter. Unsupported fields are removed before polling
|
|
104
|
+
using protocol version register 7534. Optional/unavailable subsystems report
|
|
105
|
+
failures independently; temporary failures are retried on subsequent polls.
|
|
106
|
+
|
|
107
|
+
The linked vendor page contained a Markdown table, not a device YAML, when this
|
|
108
|
+
library was prepared. The JSON catalog is the reviewed, deterministic input to
|
|
109
|
+
`script/generate.py`. Source revisions are in [sources.json](docs/sources.json).
|
|
110
|
+
See the [vendor register table](https://docs.indevolt.com/docs/hardware/open-data/modbus-register-table/)
|
|
111
|
+
and [communication guide](https://docs.indevolt.com/docs/hardware/open-data/modbus/).
|
|
112
|
+
|
|
113
|
+
## Development
|
|
114
|
+
|
|
115
|
+
Layout, query helper, CI, release workflow and release procedure follow
|
|
116
|
+
[sofar-modbus](https://github.com/darkrain-nl/sofar-modbus). Runtime modeling uses
|
|
117
|
+
[modbus-connection](https://github.com/home-assistant-libs/modbus-connection).
|
|
118
|
+
|
|
119
|
+
```sh
|
|
120
|
+
uv sync
|
|
121
|
+
uv run script/generate.py
|
|
122
|
+
uv run ruff check --fix .
|
|
123
|
+
uv run ruff format .
|
|
124
|
+
uv run ruff check .
|
|
125
|
+
uv run mypy
|
|
126
|
+
uv run pytest
|
|
127
|
+
uv build
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Two misplaced inverter fault continuation rows under grid charging were moved
|
|
131
|
+
to the inverter alarm catalog; grid charging uses its explicitly documented
|
|
132
|
+
0/1 values.
|
|
133
|
+
|
|
134
|
+
Hardware behavior has not been verified. Tests use the actual modbus-connection
|
|
135
|
+
mock backend; community captures are needed to resolve the documented gaps.
|
|
136
|
+
See [RELEASING.md](RELEASING.md) for publishing setup.
|
|
137
|
+
|
|
138
|
+
## Selective reads
|
|
139
|
+
|
|
140
|
+
After `await device.async_ensure_setup()`, `device.read_groups(register_keys)` returns
|
|
141
|
+
independent typed readers. Each reader covers one contiguous block of selected,
|
|
142
|
+
supported fields (at most 125 registers), with no undocumented gaps. Call
|
|
143
|
+
`await reader.async_update()` and read decoded attributes from that reader. Its
|
|
144
|
+
cache is independent of `device.value()` and the full subsystem caches. This lets
|
|
145
|
+
callers prioritize writes and fast telemetry between individual read requests
|
|
146
|
+
without narrowing the device's writable fields. Schedule all access through one
|
|
147
|
+
worker/connection and respect the device's message spacing.
|
|
148
|
+
|
|
149
|
+
### Directional AC power correction
|
|
150
|
+
|
|
151
|
+
The [vendor register table](https://docs.indevolt.com/docs/hardware/open-data/modbus-register-table/)
|
|
152
|
+
checked on 2026-10-15 labels **ACOutW (1284)** as `uint16`, while its
|
|
153
|
+
description defines directional inverter-plus-bypass power. A user hardware
|
|
154
|
+
capture reported raw `63609`, consistent with signed `-1927 W` (`63609 - 65536`).
|
|
155
|
+
The canonical catalog therefore overrides this field to `int16`, retaining the
|
|
156
|
+
vendor type and rationale in `source_data_type` and `type_override_reason`.
|
|
157
|
+
Generated decoding uses two's complement without reversing the sign.
|
|
158
|
+
|
|
159
|
+
- **174, inverter AC power:** positive = AC charging/input; negative = AC discharging/output.
|
|
160
|
+
- **6564, battery power:** positive = battery discharge; negative = battery charge.
|
|
161
|
+
- **1284, total AC power:** inverter power plus bypass power; the vendor describes
|
|
162
|
+
bypass as positive for EPS and negative for a microinverter.
|
|
163
|
+
|
|
164
|
+
Registers 174 and 6564 remain signed and retain their distinct conventions.
|
|
165
|
+
|
|
166
|
+
### Presentation metadata
|
|
167
|
+
|
|
168
|
+
`Register.display_format` describes documented decimal firmware versions and
|
|
169
|
+
packed clock/schedule fields. Decoded protocol values remain numeric; consumers
|
|
170
|
+
may render them as versions or text times while retaining the original value.
|
|
171
|
+
This includes the forced-full-charge start time (7269), sleep times, and all
|
|
172
|
+
24 schedule start/end pairs. Split device date/time words are not a timestamp:
|
|
173
|
+
they are separate reads and carry no timezone.
|
|
174
|
+
|
|
175
|
+
The vendor table leaves the unit column blank for 7268 and 7270, but explicitly
|
|
176
|
+
specifies days and watts in their descriptions. The canonical catalog supplies
|
|
177
|
+
`d` and `W` respectively. No wire scaling or write bounds change.
|
|
178
|
+
|
|
179
|
+
Power factor (122) retains its signed 0.001 scale as a dimensionless ratio.
|
|
180
|
+
The vendor labels it `Pct`, but a live 0.99 reading agrees with approximately
|
|
181
|
+
173 W / 174 VA, not 0.99 percent. `source_unit` and `unit_override_reason`
|
|
182
|
+
record this discrepancy in the canonical catalog.
|